demarches-normaliennes/db/migrate/20230228134859_create_dossier_resolutions.rb
2023-06-02 16:13:15 +02:00

15 lines
476 B
Ruby

class CreateDossierCorrections < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
create_table :dossier_corrections do |t|
t.references :dossier, null: false, foreign_key: true
t.references :commentaire, foreign_key: true
t.datetime :resolved_at, precision: 6
t.timestamps
end
add_index :dossier_corrections, :resolved_at, where: "(resolved_at IS NULL OR resolved_at IS NOT NULL)", algorithm: :concurrently
end
end