chore(schema): +dossier_corrections#kind
This commit is contained in:
parent
93b0af50cc
commit
1c977c72bf
3 changed files with 9 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
# Table name: dossier_corrections
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# kind :string default("correction"), not null
|
||||
# resolved_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
|
@ -17,6 +18,8 @@ class DossierCorrection < ApplicationRecord
|
|||
|
||||
scope :pending, -> { where(resolved_at: nil) }
|
||||
|
||||
enum kind: { correction: 'correction', incomplete: 'incomplete' }
|
||||
|
||||
def resolved?
|
||||
resolved_at.present?
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddKindToDossierCorrections < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :dossier_corrections, :kind, :string, default: 'correction', null: false
|
||||
end
|
||||
end
|
|
@ -323,6 +323,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_29_102031) do
|
|||
t.bigint "dossier_id", null: false
|
||||
t.datetime "resolved_at", precision: 6
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.string "kind", default: "correction", null: false
|
||||
t.index ["commentaire_id"], name: "index_dossier_corrections_on_commentaire_id"
|
||||
t.index ["dossier_id"], name: "index_dossier_corrections_on_dossier_id"
|
||||
t.index ["resolved_at"], name: "index_dossier_corrections_on_resolved_at", where: "((resolved_at IS NULL) OR (resolved_at IS NOT NULL))"
|
||||
|
|
Loading…
Reference in a new issue