From 106698a2421b8d6efe6bd8a145e8360a8c46c666 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 18 Jul 2024 09:55:06 +0200 Subject: [PATCH] add dedicated dossier_folder, export_pdf, pjs columns to export model Destroy all previous incompatible ExportTemplate --- ...dd_dossier_folder_column_to_export_template.rb | 15 +++++++++++++++ db/schema.rb | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 db/migrate/20240713090744_add_dossier_folder_column_to_export_template.rb diff --git a/db/migrate/20240713090744_add_dossier_folder_column_to_export_template.rb b/db/migrate/20240713090744_add_dossier_folder_column_to_export_template.rb new file mode 100644 index 000000000..69a31e4b6 --- /dev/null +++ b/db/migrate/20240713090744_add_dossier_folder_column_to_export_template.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 9239db004..0544b546c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -599,9 +599,12 @@ ActiveRecord::Schema[7.0].define(version: 2024_07_16_091043) do create_table "export_templates", force: :cascade do |t| t.jsonb "content", default: {} 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.string "kind", null: false t.string "name", null: false + t.jsonb "pjs", default: [], null: false, array: true t.datetime "updated_at", null: false t.index ["groupe_instructeur_id"], name: "index_export_templates_on_groupe_instructeur_id" end