From 1c977c72bf0736c6536a4ee876d29b39fb40d6f5 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 14 Jun 2023 13:13:30 +0200 Subject: [PATCH] chore(schema): +dossier_corrections#kind --- app/models/dossier_correction.rb | 3 +++ db/migrate/20230614093944_add_kind_to_dossier_corrections.rb | 5 +++++ db/schema.rb | 1 + 3 files changed, 9 insertions(+) create mode 100644 db/migrate/20230614093944_add_kind_to_dossier_corrections.rb diff --git a/app/models/dossier_correction.rb b/app/models/dossier_correction.rb index eda8dfa40..a27524540 100644 --- a/app/models/dossier_correction.rb +++ b/app/models/dossier_correction.rb @@ -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 diff --git a/db/migrate/20230614093944_add_kind_to_dossier_corrections.rb b/db/migrate/20230614093944_add_kind_to_dossier_corrections.rb new file mode 100644 index 000000000..9798765ba --- /dev/null +++ b/db/migrate/20230614093944_add_kind_to_dossier_corrections.rb @@ -0,0 +1,5 @@ +class AddKindToDossierCorrections < ActiveRecord::Migration[7.0] + def change + add_column :dossier_corrections, :kind, :string, default: 'correction', null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 657c387d9..1ff80dc40 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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))"