From 474eb18016d50a41e6289fa26402d5a83dd9deda Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Sat, 2 Mar 2024 21:47:48 +0100 Subject: [PATCH] add export template migration --- db/migrate/20240130154452_create_export_templates.rb | 12 ++++++++++++ db/schema.rb | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 db/migrate/20240130154452_create_export_templates.rb diff --git a/db/migrate/20240130154452_create_export_templates.rb b/db/migrate/20240130154452_create_export_templates.rb new file mode 100644 index 000000000..f1306af2f --- /dev/null +++ b/db/migrate/20240130154452_create_export_templates.rb @@ -0,0 +1,12 @@ +class CreateExportTemplates < ActiveRecord::Migration[7.0] + def change + create_table :export_templates do |t| + t.string :name, null: false + t.string :kind, null: false + t.jsonb :content, default: {} + t.belongs_to :groupe_instructeur, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index b936bf6b3..054c32caa 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -593,6 +593,16 @@ ActiveRecord::Schema[7.0].define(version: 2024_04_17_053843) do t.index ["procedure_id"], name: "index_experts_procedures_on_procedure_id" end + create_table "export_templates", force: :cascade do |t| + t.jsonb "content", default: {} + t.datetime "created_at", null: false + t.bigint "groupe_instructeur_id", null: false + t.string "kind", null: false + t.string "name", null: false + t.datetime "updated_at", null: false + t.index ["groupe_instructeur_id"], name: "index_export_templates_on_groupe_instructeur_id" + end + create_table "exports", force: :cascade do |t| t.datetime "created_at", precision: nil, null: false t.integer "dossiers_count" @@ -1224,6 +1234,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_04_17_053843) do add_foreign_key "experts", "users" add_foreign_key "experts_procedures", "experts" add_foreign_key "experts_procedures", "procedures" + add_foreign_key "export_templates", "groupe_instructeurs" add_foreign_key "exports", "instructeurs" add_foreign_key "france_connect_informations", "users" add_foreign_key "geo_areas", "champs"