add dedicated dossier_folder, export_pdf, pjs columns to export model

Destroy all previous incompatible ExportTemplate
This commit is contained in:
simon lehericey 2024-07-18 09:55:06 +02:00
parent 53a48f963d
commit 106698a242
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,15 @@
class AddDossierFolderColumnToExportTemplate < ActiveRecord::Migration[7.0]
def up
execute "DELETE FROM export_templates;"
add_column :export_templates, :dossier_folder, :jsonb, default: nil, null: false
add_column :export_templates, :export_pdf, :jsonb, default: nil, null: false
add_column :export_templates, :pjs, :jsonb, array: true, default: [], null: false
end
def down
remove_column :export_templates, :dossier_folder
remove_column :export_templates, :export_pdf
remove_column :export_templates, :pjs
end
end

View file

@ -599,9 +599,12 @@ ActiveRecord::Schema[7.0].define(version: 2024_07_16_091043) do
create_table "export_templates", force: :cascade do |t| create_table "export_templates", force: :cascade do |t|
t.jsonb "content", default: {} t.jsonb "content", default: {}
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.jsonb "dossier_folder", null: false
t.jsonb "export_pdf", null: false
t.bigint "groupe_instructeur_id", null: false t.bigint "groupe_instructeur_id", null: false
t.string "kind", null: false t.string "kind", null: false
t.string "name", null: false t.string "name", null: false
t.jsonb "pjs", default: [], null: false, array: true
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["groupe_instructeur_id"], name: "index_export_templates_on_groupe_instructeur_id" t.index ["groupe_instructeur_id"], name: "index_export_templates_on_groupe_instructeur_id"
end end