Skip to content

Commit

Permalink
Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kara22 committed Nov 21, 2023
1 parent 0203867 commit c829774
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/models/individual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class Individual < ApplicationRecord
GENDER_MALE = "M."
GENDER_FEMALE = 'Mme'

enum notification_method: {
email: 'email',
no_notification: 'no_notification'
}

def self.from_france_connect(fc_information)
new(
nom: fc_information.family_name,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CombineDossierAndIndividualUpdates < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_column :dossiers, :mandataire_first_name, :string
add_column :dossiers, :mandataire_last_name, :string
add_column :dossiers, :for_tiers, :boolean, default: false, null: false

add_column :individuals, :notification_method, :string
add_column :individuals, :email, :string
add_index :individuals, :email, algorithm: :concurrently
end
end
24 changes: 18 additions & 6 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_11_14_113317) do
ActiveRecord::Schema[7.0].define(version: 2023_11_14_140154) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -417,6 +417,7 @@
t.datetime "en_construction_close_to_expiration_notice_sent_at", precision: nil
t.datetime "en_instruction_at", precision: nil
t.boolean "for_procedure_preview", default: false, null: false
t.boolean "for_tiers", default: false, null: false
t.boolean "forced_groupe_instructeur", default: false, null: false
t.bigint "groupe_instructeur_id"
t.datetime "groupe_instructeur_updated_at", precision: nil
Expand All @@ -429,6 +430,8 @@
t.datetime "last_champ_private_updated_at", precision: nil
t.datetime "last_champ_updated_at", precision: nil
t.datetime "last_commentaire_updated_at", precision: nil
t.string "mandataire_first_name"
t.string "mandataire_last_name"
t.text "motivation"
t.bigint "parent_dossier_id"
t.string "prefill_token"
Expand All @@ -437,13 +440,15 @@
t.datetime "processed_at", precision: nil
t.datetime "re_instructed_at"
t.bigint "revision_id"
t.string "search_terms"
t.text "search_terms"
t.string "state"
t.date "sva_svr_decision_on"
t.datetime "sva_svr_decision_triggered_at"
t.datetime "termine_close_to_expiration_notice_sent_at", precision: nil
t.datetime "updated_at", precision: nil
t.integer "user_id"
t.index "to_tsvector('french'::regconfig, (search_terms || private_search_terms))", name: "index_dossiers_on_search_terms_private_search_terms", using: :gin
t.index "to_tsvector('french'::regconfig, search_terms)", name: "index_dossiers_on_search_terms", using: :gin
t.index ["archived"], name: "index_dossiers_on_archived"
t.index ["batch_operation_id"], name: "index_dossiers_on_batch_operation_id"
t.index ["dossier_transfer_id"], name: "index_dossiers_on_dossier_transfer_id"
Expand Down Expand Up @@ -672,11 +677,14 @@
t.date "birthdate"
t.datetime "created_at", precision: nil
t.integer "dossier_id"
t.string "email"
t.string "gender"
t.string "nom"
t.string "notification_method"
t.string "prenom"
t.datetime "updated_at", precision: nil
t.index ["dossier_id"], name: "index_individuals_on_dossier_id", unique: true
t.index ["email"], name: "index_individuals_on_email"
end

create_table "initiated_mails", id: :serial, force: :cascade do |t|
Expand Down Expand Up @@ -1029,12 +1037,18 @@
t.text "description"
t.string "libelle"
t.boolean "mandatory", default: false
t.boolean "migrated_parent"
t.jsonb "options"
t.integer "order_place"
t.bigint "parent_id"
t.boolean "private", default: false, null: false
t.bigint "revision_id"
t.bigint "stable_id"
t.string "type_champ"
t.datetime "updated_at", precision: nil
t.index ["parent_id"], name: "index_types_de_champ_on_parent_id"
t.index ["private"], name: "index_types_de_champ_on_private"
t.index ["revision_id"], name: "index_types_de_champ_on_revision_id"
t.index ["stable_id"], name: "index_types_de_champ_on_stable_id"
end

Expand Down Expand Up @@ -1132,9 +1146,6 @@
add_foreign_key "bulk_messages_groupe_instructeurs", "bulk_messages"
add_foreign_key "bulk_messages_groupe_instructeurs", "groupe_instructeurs"
add_foreign_key "champs", "champs", column: "parent_id"
add_foreign_key "champs", "dossiers"
add_foreign_key "champs", "etablissements"
add_foreign_key "champs", "types_de_champ"
add_foreign_key "closed_mails", "procedures"
add_foreign_key "commentaires", "dossiers"
add_foreign_key "commentaires", "experts"
Expand All @@ -1153,7 +1164,6 @@
add_foreign_key "dossiers", "groupe_instructeurs"
add_foreign_key "dossiers", "procedure_revisions", column: "revision_id"
add_foreign_key "dossiers", "users"
add_foreign_key "etablissements", "dossiers"
add_foreign_key "experts", "users"
add_foreign_key "experts_procedures", "experts"
add_foreign_key "experts_procedures", "procedures"
Expand Down Expand Up @@ -1182,6 +1192,8 @@
add_foreign_key "targeted_user_links", "users"
add_foreign_key "traitements", "dossiers"
add_foreign_key "trusted_device_tokens", "instructeurs"
add_foreign_key "types_de_champ", "procedure_revisions", column: "revision_id"
add_foreign_key "types_de_champ", "types_de_champ", column: "parent_id"
add_foreign_key "users", "users", column: "requested_merge_into_id"
add_foreign_key "without_continuation_mails", "procedures"
add_foreign_key "zone_labels", "zones"
Expand Down

0 comments on commit c829774

Please sign in to comment.