2016-11-04 17:11:26 +01:00
|
|
|
# This file is auto-generated from the current state of the database. Instead
|
|
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
|
|
#
|
2021-02-16 16:14:43 +01:00
|
|
|
# This file is the source Rails uses to define your schema when running `bin/rails
|
|
|
|
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
2020-03-18 10:58:49 +01:00
|
|
|
# be faster and is potentially less error prone than running all of your
|
|
|
|
# migrations from scratch. Old migrations may fail to apply correctly if those
|
|
|
|
# migrations use external dependencies or application code.
|
2016-11-04 17:11:26 +01:00
|
|
|
#
|
|
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
|
|
|
2023-11-08 14:40:55 +01:00
|
|
|
ActiveRecord::Schema[7.0].define(version: 2023_11_07_150217) do
|
2016-11-04 17:11:26 +01:00
|
|
|
# These are extensions that must be enabled in order to support this database
|
2022-05-23 15:09:22 +02:00
|
|
|
enable_extension "pgcrypto"
|
2016-11-04 17:11:26 +01:00
|
|
|
enable_extension "plpgsql"
|
2023-07-04 11:38:18 +02:00
|
|
|
enable_extension "postgis"
|
2018-01-08 14:59:23 +01:00
|
|
|
enable_extension "unaccent"
|
2016-11-04 17:11:26 +01:00
|
|
|
|
2019-04-09 15:44:36 +02:00
|
|
|
create_table "action_text_rich_texts", force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "name", null: false
|
|
|
|
t.bigint "record_id", null: false
|
|
|
|
t.string "record_type", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-04-09 15:44:36 +02:00
|
|
|
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
|
|
|
end
|
|
|
|
|
2018-02-12 10:44:10 +01:00
|
|
|
create_table "active_storage_attachments", force: :cascade do |t|
|
|
|
|
t.bigint "blob_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "name", null: false
|
|
|
|
t.bigint "record_id", null: false
|
|
|
|
t.string "record_type", null: false
|
2018-02-12 10:44:10 +01:00
|
|
|
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
|
|
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "active_storage_blobs", force: :cascade do |t|
|
|
|
|
t.bigint "byte_size", null: false
|
2023-03-28 15:56:40 +02:00
|
|
|
t.string "checksum"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "content_type"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "filename", null: false
|
|
|
|
t.string "key", null: false
|
2021-11-04 11:27:23 +01:00
|
|
|
t.integer "lock_version"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "metadata"
|
|
|
|
t.string "service_name", null: false
|
2022-12-22 18:20:58 +01:00
|
|
|
t.string "virus_scan_result"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "virus_scanned_at", precision: 6
|
|
|
|
t.datetime "watermarked_at", precision: 6
|
2018-02-12 10:44:10 +01:00
|
|
|
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
2023-04-24 15:50:07 +02:00
|
|
|
t.index ["virus_scan_result"], name: "index_active_storage_blobs_on_virus_scan_result"
|
2018-02-12 10:44:10 +01:00
|
|
|
end
|
|
|
|
|
2021-03-09 12:05:02 +01:00
|
|
|
create_table "active_storage_variant_records", force: :cascade do |t|
|
|
|
|
t.bigint "blob_id", null: false
|
|
|
|
t.string "variation_digest", null: false
|
|
|
|
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "administrateurs", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2023-09-04 12:07:04 +02:00
|
|
|
t.bigint "groupe_gestionnaire_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-22 16:53:38 +01:00
|
|
|
t.bigint "user_id", null: false
|
2023-09-04 12:07:04 +02:00
|
|
|
t.index ["groupe_gestionnaire_id"], name: "index_administrateurs_on_groupe_gestionnaire_id"
|
2022-03-22 16:53:38 +01:00
|
|
|
t.index ["user_id"], name: "index_administrateurs_on_user_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2019-08-05 16:09:39 +02:00
|
|
|
create_table "administrateurs_instructeurs", id: false, force: :cascade do |t|
|
2022-03-22 13:31:34 +01:00
|
|
|
t.integer "administrateur_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2022-03-22 13:31:34 +01:00
|
|
|
t.integer "instructeur_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2019-08-05 16:09:39 +02:00
|
|
|
t.index ["administrateur_id"], name: "index_administrateurs_instructeurs_on_administrateur_id"
|
|
|
|
t.index ["instructeur_id", "administrateur_id"], name: "unique_couple_administrateur_instructeur", unique: true
|
|
|
|
t.index ["instructeur_id"], name: "index_administrateurs_instructeurs_on_instructeur_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-03-23 11:39:36 +01:00
|
|
|
create_table "administrateurs_procedures", id: false, force: :cascade do |t|
|
|
|
|
t.bigint "administrateur_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2021-10-06 19:33:49 +02:00
|
|
|
t.boolean "manager"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "procedure_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-03-23 11:39:36 +01:00
|
|
|
t.index ["administrateur_id", "procedure_id"], name: "index_unique_admin_proc_couple", unique: true
|
|
|
|
t.index ["administrateur_id"], name: "index_administrateurs_procedures_on_administrateur_id"
|
|
|
|
t.index ["procedure_id"], name: "index_administrateurs_procedures_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2022-12-01 10:46:42 +01:00
|
|
|
create_table "api_tokens", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
|
|
|
t.bigint "administrateur_id", null: false
|
2023-02-13 14:22:21 +01:00
|
|
|
t.bigint "allowed_procedure_ids", array: true
|
2022-12-01 10:46:42 +01:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.string "encrypted_token", null: false
|
2023-08-01 12:30:23 +02:00
|
|
|
t.datetime "last_v1_authenticated_at"
|
|
|
|
t.datetime "last_v2_authenticated_at"
|
2022-12-01 10:46:42 +01:00
|
|
|
t.string "name", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.integer "version", default: 3, null: false
|
2023-04-24 15:50:07 +02:00
|
|
|
t.boolean "write_access", default: true, null: false
|
2022-12-01 10:46:42 +01:00
|
|
|
t.index ["administrateur_id"], name: "index_api_tokens_on_administrateur_id"
|
|
|
|
end
|
|
|
|
|
2021-04-29 17:29:47 +02:00
|
|
|
create_table "archives", force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-07-07 18:15:48 +02:00
|
|
|
t.string "job_status", null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "key", null: false
|
2021-04-29 17:29:47 +02:00
|
|
|
t.date "month"
|
|
|
|
t.string "time_span_type", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["key", "time_span_type", "month"], name: "index_archives_on_key_and_time_span_type_and_month", unique: true
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "archives_groupe_instructeurs", force: :cascade do |t|
|
|
|
|
t.bigint "archive_id", null: false
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "groupe_instructeur_id", null: false
|
2021-04-29 17:29:47 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["archive_id"], name: "index_archives_groupe_instructeurs_on_archive_id"
|
|
|
|
t.index ["groupe_instructeur_id"], name: "index_archives_groupe_instructeurs_on_groupe_instructeur_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "assign_tos", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2020-02-18 17:18:25 +01:00
|
|
|
t.boolean "daily_email_notifications_enabled", default: false, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "groupe_instructeur_id"
|
2020-04-09 11:43:23 +02:00
|
|
|
t.boolean "instant_email_dossier_notifications_enabled", default: false, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "instant_email_message_notifications_enabled", default: false, null: false
|
2022-09-02 17:14:29 +02:00
|
|
|
t.boolean "instant_expert_avis_email_notifications_enabled", default: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "instructeur_id"
|
2022-07-21 13:44:21 +02:00
|
|
|
t.boolean "manager", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "weekly_email_notifications_enabled", default: true, null: false
|
2019-08-20 16:47:41 +02:00
|
|
|
t.index ["groupe_instructeur_id", "instructeur_id"], name: "unique_couple_groupe_instructeur_instructeur", unique: true
|
|
|
|
t.index ["groupe_instructeur_id"], name: "index_assign_tos_on_groupe_instructeur_id"
|
2019-08-05 16:09:39 +02:00
|
|
|
t.index ["instructeur_id"], name: "index_assign_tos_on_instructeur_id"
|
2022-09-02 17:14:29 +02:00
|
|
|
t.check_constraint "instant_expert_avis_email_notifications_enabled IS NOT NULL", name: "assign_tos_instant_expert_avis_email_notifications_enabled_null"
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "attestation_templates", id: :serial, force: :cascade do |t|
|
|
|
|
t.boolean "activated"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "footer"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.integer "procedure_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "title"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_attestation_templates_on_procedure_id", unique: true
|
2016-11-14 17:33:45 +01:00
|
|
|
end
|
2016-11-04 17:11:26 +01:00
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "attestations", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "dossier_id", null: false
|
|
|
|
t.string "title"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-04-05 12:13:25 +02:00
|
|
|
t.index ["dossier_id"], name: "index_attestations_on_dossier_id", unique: true
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "avis", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "answer"
|
|
|
|
t.integer "claimant_id", null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "claimant_type"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.boolean "confidentiel", default: false, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "dossier_id"
|
|
|
|
t.string "email"
|
2021-01-15 16:39:07 +01:00
|
|
|
t.bigint "experts_procedure_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "introduction"
|
2023-03-06 11:05:14 +01:00
|
|
|
t.boolean "question_answer"
|
|
|
|
t.string "question_label"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "reminded_at", precision: 6
|
|
|
|
t.datetime "revoked_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["claimant_id"], name: "index_avis_on_claimant_id"
|
|
|
|
t.index ["dossier_id"], name: "index_avis_on_dossier_id"
|
2021-01-15 16:39:07 +01:00
|
|
|
t.index ["experts_procedure_id"], name: "index_avis_on_experts_procedure_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
2022-11-18 15:26:31 +01:00
|
|
|
create_table "batch_operations", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "failed_dossier_ids", default: [], null: false, array: true
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "finished_at", precision: 6
|
2022-11-18 15:26:31 +01:00
|
|
|
t.bigint "instructeur_id", null: false
|
|
|
|
t.string "operation", null: false
|
|
|
|
t.jsonb "payload", default: {}, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "run_at", precision: 6
|
|
|
|
t.datetime "seen_at", precision: 6
|
2022-11-18 15:26:31 +01:00
|
|
|
t.bigint "success_dossier_ids", default: [], null: false, array: true
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2022-12-01 10:51:10 +01:00
|
|
|
create_table "batch_operations_groupe_instructeurs", force: :cascade do |t|
|
|
|
|
t.bigint "batch_operation_id", null: false
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "groupe_instructeur_id", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2019-06-17 11:01:41 +02:00
|
|
|
create_table "bill_signatures", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "digest"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-06-17 11:01:41 +02:00
|
|
|
end
|
|
|
|
|
2021-07-22 14:34:07 +02:00
|
|
|
create_table "bulk_messages", force: :cascade do |t|
|
|
|
|
t.text "body", null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2021-07-22 14:34:07 +02:00
|
|
|
t.integer "dossier_count"
|
|
|
|
t.string "dossier_state"
|
|
|
|
t.bigint "instructeur_id", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "sent_at", precision: 6, null: false
|
2021-07-22 14:34:07 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "bulk_messages_groupe_instructeurs", id: false, force: :cascade do |t|
|
|
|
|
t.bigint "bulk_message_id"
|
|
|
|
t.bigint "groupe_instructeur_id"
|
2021-07-27 19:36:05 +02:00
|
|
|
t.index ["bulk_message_id", "groupe_instructeur_id"], name: "index_bulk_msg_gi_on_bulk_msg_id_and_gi_id", unique: true
|
2021-07-22 14:34:07 +02:00
|
|
|
t.index ["bulk_message_id"], name: "index_bulk_messages_groupe_instructeurs_on_bulk_message_id"
|
|
|
|
t.index ["groupe_instructeur_id"], name: "index_bulk_messages_groupe_instructeurs_on_gi_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "champs", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2021-01-13 18:57:10 +01:00
|
|
|
t.jsonb "data"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.integer "dossier_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "etablissement_id"
|
2021-01-14 23:53:02 +01:00
|
|
|
t.string "external_id"
|
2021-02-04 19:23:40 +01:00
|
|
|
t.string "fetch_external_data_exceptions", array: true
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "parent_id"
|
2022-12-14 10:15:30 +01:00
|
|
|
t.boolean "prefilled"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "private", default: false, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "rebased_at", precision: 6
|
2022-12-16 12:39:51 +01:00
|
|
|
t.string "row_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "type"
|
2023-02-17 14:41:13 +01:00
|
|
|
t.integer "type_de_champ_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "value"
|
|
|
|
t.jsonb "value_json"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["dossier_id"], name: "index_champs_on_dossier_id"
|
2021-10-20 16:50:18 +02:00
|
|
|
t.index ["etablissement_id"], name: "index_champs_on_etablissement_id"
|
2018-12-18 11:17:52 +01:00
|
|
|
t.index ["parent_id"], name: "index_champs_on_parent_id"
|
2018-02-09 17:21:46 +01:00
|
|
|
t.index ["private"], name: "index_champs_on_private"
|
2022-12-16 12:39:51 +01:00
|
|
|
t.index ["row_id"], name: "index_champs_on_row_id"
|
2022-10-07 15:17:31 +02:00
|
|
|
t.index ["type"], name: "index_champs_on_type"
|
2022-12-16 15:07:26 +01:00
|
|
|
t.index ["type_de_champ_id", "dossier_id", "row_id"], name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row_id", unique: true
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "closed_mails", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.string "subject"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_closed_mails_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "commentaires", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.datetime "discarded_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.integer "dossier_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "email"
|
|
|
|
t.bigint "expert_id"
|
|
|
|
t.bigint "instructeur_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["dossier_id"], name: "index_commentaires_on_dossier_id"
|
2021-04-22 15:44:58 +02:00
|
|
|
t.index ["expert_id"], name: "index_commentaires_on_expert_id"
|
2019-08-05 16:09:39 +02:00
|
|
|
t.index ["instructeur_id"], name: "index_commentaires_on_instructeur_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
2023-04-04 18:28:21 +02:00
|
|
|
create_table "default_zones_administrateurs", id: false, force: :cascade do |t|
|
|
|
|
t.bigint "administrateur_id"
|
|
|
|
t.bigint "zone_id"
|
|
|
|
t.index ["administrateur_id"], name: "index_default_zones_administrateurs_on_administrateur_id"
|
|
|
|
t.index ["zone_id"], name: "index_default_zones_administrateurs_on_zone_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "delayed_jobs", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "attempts", default: 0, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "cron"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "failed_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.text "handler", null: false
|
|
|
|
t.text "last_error"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "locked_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "locked_by"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "priority", default: 0, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "queue"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "run_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["priority", "run_at"], name: "delayed_jobs_priority"
|
2017-09-26 10:43:50 +02:00
|
|
|
end
|
|
|
|
|
2018-05-30 11:36:48 +02:00
|
|
|
create_table "deleted_dossiers", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.datetime "deleted_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "dossier_id"
|
|
|
|
t.bigint "groupe_instructeur_id"
|
|
|
|
t.bigint "procedure_id"
|
|
|
|
t.string "reason"
|
|
|
|
t.bigint "revision_id"
|
2018-05-30 11:36:48 +02:00
|
|
|
t.string "state"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2020-11-12 10:38:10 +01:00
|
|
|
t.bigint "user_id"
|
2021-11-25 09:11:05 +01:00
|
|
|
t.index ["deleted_at"], name: "index_deleted_dossiers_on_deleted_at"
|
2021-07-22 17:56:16 +02:00
|
|
|
t.index ["dossier_id"], name: "index_deleted_dossiers_on_dossier_id", unique: true
|
2018-05-30 11:36:48 +02:00
|
|
|
t.index ["procedure_id"], name: "index_deleted_dossiers_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2023-06-30 11:26:23 +02:00
|
|
|
create_table "dossier_assignments", force: :cascade do |t|
|
|
|
|
t.datetime "assigned_at", precision: nil, null: false
|
|
|
|
t.string "assigned_by"
|
|
|
|
t.bigint "dossier_id", null: false
|
|
|
|
t.bigint "groupe_instructeur_id"
|
|
|
|
t.string "groupe_instructeur_label"
|
|
|
|
t.string "mode", null: false
|
|
|
|
t.bigint "previous_groupe_instructeur_id"
|
|
|
|
t.string "previous_groupe_instructeur_label"
|
|
|
|
t.index ["dossier_id"], name: "index_dossier_assignments_on_dossier_id"
|
|
|
|
end
|
|
|
|
|
2022-12-22 22:23:47 +01:00
|
|
|
create_table "dossier_batch_operations", force: :cascade do |t|
|
|
|
|
t.bigint "batch_operation_id", null: false
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "dossier_id", null: false
|
|
|
|
t.string "state", default: "pending", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["batch_operation_id"], name: "index_dossier_batch_operations_on_batch_operation_id"
|
|
|
|
t.index ["dossier_id"], name: "index_dossier_batch_operations_on_dossier_id"
|
|
|
|
end
|
|
|
|
|
2023-02-28 15:06:39 +01:00
|
|
|
create_table "dossier_corrections", force: :cascade do |t|
|
|
|
|
t.bigint "commentaire_id"
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "dossier_id", null: false
|
|
|
|
t.datetime "resolved_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2023-07-12 12:00:52 +02:00
|
|
|
t.string "reason", default: "incorrect", null: false
|
2023-02-28 15:06:39 +01:00
|
|
|
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))"
|
|
|
|
end
|
|
|
|
|
2018-11-23 21:02:18 +01:00
|
|
|
create_table "dossier_operation_logs", force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "automatic_operation", default: false, null: false
|
|
|
|
t.bigint "bill_signature_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2023-01-03 14:46:10 +01:00
|
|
|
t.jsonb "data"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "digest"
|
2018-11-23 21:02:18 +01:00
|
|
|
t.bigint "dossier_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "executed_at", precision: 6
|
|
|
|
t.datetime "keep_until", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "operation", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-06-17 11:01:41 +02:00
|
|
|
t.index ["bill_signature_id"], name: "index_dossier_operation_logs_on_bill_signature_id"
|
2018-11-23 21:02:18 +01:00
|
|
|
t.index ["dossier_id"], name: "index_dossier_operation_logs_on_dossier_id"
|
2019-05-02 16:18:10 +02:00
|
|
|
t.index ["keep_until"], name: "index_dossier_operation_logs_on_keep_until"
|
2018-11-23 21:02:18 +01:00
|
|
|
end
|
|
|
|
|
2022-02-04 14:40:16 +01:00
|
|
|
create_table "dossier_submitted_messages", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "message_on_submit_by_usager"
|
2022-02-04 14:40:16 +01:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2021-09-07 10:26:30 +02:00
|
|
|
create_table "dossier_transfer_logs", force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "dossier_id", null: false
|
2021-09-07 10:26:30 +02:00
|
|
|
t.string "from", null: false
|
|
|
|
t.string "to", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["dossier_id"], name: "index_dossier_transfer_logs_on_dossier_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "dossier_transfers", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "email", null: false
|
2021-09-07 10:26:30 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["email"], name: "index_dossier_transfers_on_email"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "dossiers", id: :serial, force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "api_entreprise_job_exceptions", array: true
|
|
|
|
t.boolean "archived", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "archived_at", precision: 6
|
2022-11-30 12:39:47 +01:00
|
|
|
t.string "archived_by"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.boolean "autorisation_donnees"
|
2022-11-18 15:26:31 +01:00
|
|
|
t.bigint "batch_operation_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "brouillon_close_to_expiration_notice_sent_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.interval "conservation_extension", default: "PT0S"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
|
|
|
t.datetime "declarative_triggered_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "deleted_user_email_never_send"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "depose_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "dossier_transfer_id"
|
2023-03-21 15:59:03 +01:00
|
|
|
t.bigint "editing_fork_origin_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "en_construction_at", precision: 6
|
|
|
|
t.datetime "en_construction_close_to_expiration_notice_sent_at", precision: 6
|
|
|
|
t.datetime "en_instruction_at", precision: 6
|
2022-04-27 16:28:22 +02:00
|
|
|
t.boolean "for_procedure_preview", default: false
|
2023-06-19 23:56:23 +02:00
|
|
|
t.boolean "forced_groupe_instructeur", default: false, null: false
|
2019-08-22 17:58:31 +02:00
|
|
|
t.bigint "groupe_instructeur_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "groupe_instructeur_updated_at", precision: 6
|
|
|
|
t.datetime "hidden_at", precision: 6
|
|
|
|
t.datetime "hidden_by_administration_at", precision: 6
|
2022-02-08 10:47:18 +01:00
|
|
|
t.string "hidden_by_reason"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "hidden_by_user_at", precision: 6
|
|
|
|
t.datetime "identity_updated_at", precision: 6
|
|
|
|
t.datetime "last_avis_updated_at", precision: 6
|
|
|
|
t.datetime "last_champ_private_updated_at", precision: 6
|
|
|
|
t.datetime "last_champ_updated_at", precision: 6
|
|
|
|
t.datetime "last_commentaire_updated_at", precision: 6
|
2023-01-11 11:17:34 +01:00
|
|
|
t.boolean "migrated_champ_routage"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "motivation"
|
2022-11-07 18:09:06 +01:00
|
|
|
t.bigint "parent_dossier_id"
|
2023-01-03 14:46:10 +01:00
|
|
|
t.string "prefill_token"
|
|
|
|
t.boolean "prefilled"
|
2022-11-07 18:09:06 +01:00
|
|
|
t.string "private_search_terms"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "processed_at", precision: 6
|
2023-11-08 14:40:55 +01:00
|
|
|
t.datetime "re_instructed_at"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "revision_id"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.string "search_terms"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "state"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "termine_close_to_expiration_notice_sent_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6
|
2023-06-01 10:05:55 +02:00
|
|
|
t.date "sva_svr_decision_on"
|
|
|
|
t.datetime "sva_svr_decision_triggered_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "user_id"
|
2019-09-20 15:47:01 +02:00
|
|
|
t.index ["archived"], name: "index_dossiers_on_archived"
|
2022-11-18 15:26:31 +01:00
|
|
|
t.index ["batch_operation_id"], name: "index_dossiers_on_batch_operation_id"
|
2021-09-07 10:26:30 +02:00
|
|
|
t.index ["dossier_transfer_id"], name: "index_dossiers_on_dossier_transfer_id"
|
2023-03-21 15:59:03 +01:00
|
|
|
t.index ["editing_fork_origin_id"], name: "index_dossiers_on_editing_fork_origin_id"
|
2019-08-22 17:58:31 +02:00
|
|
|
t.index ["groupe_instructeur_id"], name: "index_dossiers_on_groupe_instructeur_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["hidden_at"], name: "index_dossiers_on_hidden_at"
|
2023-06-23 18:14:10 +02:00
|
|
|
t.index ["parent_dossier_id"], name: "index_dossiers_on_parent_dossier_id"
|
2023-01-03 14:46:10 +01:00
|
|
|
t.index ["prefill_token"], name: "index_dossiers_on_prefill_token", unique: true
|
2020-07-21 10:39:57 +02:00
|
|
|
t.index ["revision_id"], name: "index_dossiers_on_revision_id"
|
2019-09-20 15:47:01 +02:00
|
|
|
t.index ["state"], name: "index_dossiers_on_state"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["user_id"], name: "index_dossiers_on_user_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2023-01-09 16:02:06 +01:00
|
|
|
create_table "email_events", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2023-02-03 15:40:16 +01:00
|
|
|
t.string "message_id"
|
2023-01-09 16:02:06 +01:00
|
|
|
t.string "method", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "processed_at", precision: 6
|
2023-01-09 16:02:06 +01:00
|
|
|
t.string "status", null: false
|
|
|
|
t.string "subject", null: false
|
|
|
|
t.string "to", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "etablissements", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "adresse"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.date "association_date_creation"
|
|
|
|
t.date "association_date_declaration"
|
|
|
|
t.date "association_date_publication"
|
|
|
|
t.text "association_objet"
|
|
|
|
t.string "association_rna"
|
|
|
|
t.string "association_titre"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "code_insee_localite"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "code_postal"
|
|
|
|
t.string "complement_adresse"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "diffusable_commercialement"
|
2016-11-04 17:11:26 +01:00
|
|
|
t.integer "dossier_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "enseigne"
|
|
|
|
t.jsonb "entreprise_bilans_bdf"
|
|
|
|
t.string "entreprise_bilans_bdf_monnaie"
|
2018-03-07 11:24:41 +01:00
|
|
|
t.bigint "entreprise_capital_social"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "entreprise_code_effectif_entreprise"
|
|
|
|
t.date "entreprise_date_creation"
|
|
|
|
t.string "entreprise_effectif_annee"
|
|
|
|
t.decimal "entreprise_effectif_annuel"
|
|
|
|
t.string "entreprise_effectif_annuel_annee"
|
|
|
|
t.decimal "entreprise_effectif_mensuel"
|
|
|
|
t.string "entreprise_effectif_mois"
|
2022-07-18 12:23:57 +02:00
|
|
|
t.string "entreprise_etat_administratif"
|
2018-02-21 16:26:49 +01:00
|
|
|
t.string "entreprise_forme_juridique"
|
|
|
|
t.string "entreprise_forme_juridique_code"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "entreprise_nom"
|
2018-02-21 16:26:49 +01:00
|
|
|
t.string "entreprise_nom_commercial"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "entreprise_numero_tva_intracommunautaire"
|
|
|
|
t.string "entreprise_prenom"
|
2018-02-21 16:26:49 +01:00
|
|
|
t.string "entreprise_raison_sociale"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "entreprise_siren"
|
2018-02-21 16:26:49 +01:00
|
|
|
t.string "entreprise_siret_siege_social"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "libelle_naf"
|
|
|
|
t.string "localite"
|
|
|
|
t.string "naf"
|
|
|
|
t.string "nom_voie"
|
|
|
|
t.string "numero_voie"
|
|
|
|
t.boolean "siege_social"
|
|
|
|
t.string "siret"
|
|
|
|
t.string "type_voie"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2021-07-22 17:57:14 +02:00
|
|
|
t.index ["dossier_id"], name: "index_etablissements_on_dossier_id", unique: true
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "exercices", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "ca"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
|
|
|
t.datetime "dateFinExercice", precision: 6
|
|
|
|
t.datetime "date_fin_exercice", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.integer "date_fin_exercice_timestamp"
|
|
|
|
t.integer "etablissement_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2021-04-16 18:11:55 +02:00
|
|
|
t.index ["etablissement_id"], name: "index_exercices_on_etablissement_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2021-01-07 15:45:02 +01:00
|
|
|
create_table "experts", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-03-22 16:53:38 +01:00
|
|
|
t.bigint "user_id", null: false
|
|
|
|
t.index ["user_id"], name: "index_experts_on_user_id"
|
2021-01-07 15:45:02 +01:00
|
|
|
end
|
|
|
|
|
2021-01-07 15:45:02 +01:00
|
|
|
create_table "experts_procedures", force: :cascade do |t|
|
|
|
|
t.boolean "allow_decision_access", default: false, null: false
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "expert_id", null: false
|
|
|
|
t.bigint "procedure_id", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "revoked_at", precision: 6
|
2021-01-21 14:57:57 +01:00
|
|
|
t.index ["expert_id", "procedure_id"], name: "index_experts_procedures_on_expert_id_and_procedure_id", unique: true
|
2021-01-07 15:45:02 +01:00
|
|
|
t.index ["expert_id"], name: "index_experts_procedures_on_expert_id"
|
|
|
|
t.index ["procedure_id"], name: "index_experts_procedures_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2019-12-03 18:36:50 +01:00
|
|
|
create_table "exports", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2023-10-09 09:15:54 +02:00
|
|
|
t.integer "dossiers_count"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "format", null: false
|
2023-10-09 09:15:54 +02:00
|
|
|
t.bigint "instructeur_id"
|
2022-07-26 17:53:24 +02:00
|
|
|
t.string "job_status", default: "pending", null: false
|
2021-04-02 18:42:24 +02:00
|
|
|
t.text "key", null: false
|
2022-04-05 15:53:15 +02:00
|
|
|
t.bigint "procedure_presentation_id"
|
2022-04-05 18:11:12 +02:00
|
|
|
t.jsonb "procedure_presentation_snapshot"
|
2022-04-05 15:53:15 +02:00
|
|
|
t.string "statut", default: "tous"
|
2021-06-16 11:46:25 +02:00
|
|
|
t.string "time_span_type", default: "everything", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2023-10-09 09:15:54 +02:00
|
|
|
t.index ["instructeur_id"], name: "index_exports_on_instructeur_id"
|
2023-09-28 10:43:46 +02:00
|
|
|
t.index ["key"], name: "index_exports_on_key"
|
2022-04-05 15:53:15 +02:00
|
|
|
t.index ["procedure_presentation_id"], name: "index_exports_on_procedure_presentation_id"
|
2019-12-03 18:36:50 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "exports_groupe_instructeurs", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2019-12-03 18:36:50 +01:00
|
|
|
t.bigint "export_id", null: false
|
|
|
|
t.bigint "groupe_instructeur_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-12-03 18:36:50 +01:00
|
|
|
end
|
|
|
|
|
2022-03-15 14:24:20 +01:00
|
|
|
create_table "flipper_features", id: false, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigserial "id", null: false
|
|
|
|
t.string "key", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-07-04 12:36:17 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "flipper_gates", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2019-07-04 12:36:17 +02:00
|
|
|
t.string "feature_key", null: false
|
|
|
|
t.string "key", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "value"
|
2019-07-04 12:36:17 +02:00
|
|
|
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "follows", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "annotations_privees_seen_at", precision: 6, null: false
|
|
|
|
t.datetime "avis_seen_at", precision: 6, null: false
|
|
|
|
t.datetime "created_at", precision: 6
|
|
|
|
t.datetime "demande_seen_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "dossier_id", null: false
|
|
|
|
t.integer "instructeur_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "messagerie_seen_at", precision: 6, null: false
|
|
|
|
t.datetime "unfollowed_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["dossier_id"], name: "index_follows_on_dossier_id"
|
2019-08-05 16:09:39 +02:00
|
|
|
t.index ["instructeur_id", "dossier_id", "unfollowed_at"], name: "uniqueness_index", unique: true
|
|
|
|
t.index ["instructeur_id"], name: "index_follows_on_instructeur_id"
|
2019-09-20 15:47:01 +02:00
|
|
|
t.index ["unfollowed_at"], name: "index_follows_on_unfollowed_at"
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "france_connect_informations", id: :serial, force: :cascade do |t|
|
|
|
|
t.date "birthdate"
|
|
|
|
t.string "birthplace"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2021-04-12 11:29:31 +02:00
|
|
|
t.jsonb "data"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "email_france_connect"
|
|
|
|
t.string "family_name"
|
|
|
|
t.string "france_connect_particulier_id"
|
|
|
|
t.string "gender"
|
|
|
|
t.string "given_name"
|
2021-10-11 12:32:33 +02:00
|
|
|
t.string "merge_token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "merge_token_created_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "user_id"
|
2021-10-11 12:32:33 +02:00
|
|
|
t.index ["merge_token"], name: "index_france_connect_informations_on_merge_token"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["user_id"], name: "index_france_connect_informations_on_user_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-10-16 13:00:52 +02:00
|
|
|
create_table "geo_areas", force: :cascade do |t|
|
|
|
|
t.bigint "champ_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "geo_reference_id"
|
|
|
|
t.jsonb "geometry"
|
|
|
|
t.jsonb "properties"
|
|
|
|
t.string "source"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2018-10-16 13:00:52 +02:00
|
|
|
t.index ["champ_id"], name: "index_geo_areas_on_champ_id"
|
|
|
|
t.index ["source"], name: "index_geo_areas_on_source"
|
|
|
|
end
|
|
|
|
|
2023-08-11 10:49:16 +02:00
|
|
|
create_table "contact_informations", force: :cascade do |t|
|
|
|
|
t.text "adresse", null: false
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.string "email", null: false
|
|
|
|
t.bigint "groupe_instructeur_id", null: false
|
|
|
|
t.text "horaires", null: false
|
|
|
|
t.string "nom", null: false
|
|
|
|
t.string "telephone", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["groupe_instructeur_id", "nom"], name: "index_contact_informations_on_gi_and_nom", unique: true
|
|
|
|
t.index ["groupe_instructeur_id"], name: "index_contact_informations_on_groupe_instructeur_id"
|
|
|
|
end
|
|
|
|
|
2023-09-04 12:07:04 +02:00
|
|
|
create_table "gestionnaires", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.bigint "user_id", null: false
|
|
|
|
t.index ["user_id"], name: "index_gestionnaires_on_user_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "gestionnaires_groupe_gestionnaires", id: false, force: :cascade do |t|
|
|
|
|
t.bigint "gestionnaire_id", null: false
|
|
|
|
t.bigint "groupe_gestionnaire_id", null: false
|
|
|
|
t.index ["gestionnaire_id", "groupe_gestionnaire_id"], name: "index_on_gestionnaire_and_groupe_gestionnaire"
|
|
|
|
t.index ["groupe_gestionnaire_id", "gestionnaire_id"], name: "index_on_groupe_gestionnaire_and_gestionnaire"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "groupe_gestionnaires", force: :cascade do |t|
|
2023-10-26 13:39:46 +02:00
|
|
|
t.string "ancestry", default: "/", null: false, collation: "C"
|
2023-09-04 12:07:04 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.bigint "groupe_gestionnaire_id"
|
|
|
|
t.string "name", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2023-10-26 13:39:46 +02:00
|
|
|
t.index ["ancestry"], name: "index_groupe_gestionnaires_on_ancestry"
|
2023-09-04 12:07:04 +02:00
|
|
|
t.index ["groupe_gestionnaire_id"], name: "index_groupe_gestionnaires_on_groupe_gestionnaire_id"
|
|
|
|
t.index ["name"], name: "index_groupe_gestionnaires_on_name"
|
|
|
|
end
|
|
|
|
|
2019-08-19 16:12:30 +02:00
|
|
|
create_table "groupe_instructeurs", force: :cascade do |t|
|
2022-06-20 16:14:27 +02:00
|
|
|
t.boolean "closed", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "label", null: false
|
|
|
|
t.bigint "procedure_id", null: false
|
2023-02-28 08:39:37 +01:00
|
|
|
t.jsonb "routing_rule"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-06-20 16:14:27 +02:00
|
|
|
t.index ["closed", "procedure_id"], name: "index_groupe_instructeurs_on_closed_and_procedure_id"
|
2019-08-19 16:12:30 +02:00
|
|
|
t.index ["procedure_id", "label"], name: "index_groupe_instructeurs_on_procedure_id_and_label", unique: true
|
|
|
|
t.index ["procedure_id"], name: "index_groupe_instructeurs_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "individuals", id: :serial, force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.date "birthdate"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2016-11-04 17:11:26 +01:00
|
|
|
t.integer "dossier_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "gender"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "nom"
|
|
|
|
t.string "prenom"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2021-04-27 13:55:39 +02:00
|
|
|
t.index ["dossier_id"], name: "index_individuals_on_dossier_id", unique: true
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "initiated_mails", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.string "subject"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_initiated_mails_on_procedure_id"
|
2017-03-07 10:25:28 +01:00
|
|
|
end
|
|
|
|
|
2019-08-05 16:09:39 +02:00
|
|
|
create_table "instructeurs", id: :serial, force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "agent_connect_id"
|
|
|
|
t.boolean "bypass_email_login_token", default: false, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2019-08-05 16:09:39 +02:00
|
|
|
t.text "encrypted_login_token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "login_token_created_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-22 16:53:38 +01:00
|
|
|
t.bigint "user_id", null: false
|
2021-11-19 15:24:54 +01:00
|
|
|
t.index ["agent_connect_id"], name: "index_instructeurs_on_agent_connect_id", unique: true
|
2022-03-22 16:53:38 +01:00
|
|
|
t.index ["user_id"], name: "index_instructeurs_on_user_id"
|
2019-08-05 16:09:39 +02:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "invites", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "dossier_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "email"
|
|
|
|
t.string "email_sender"
|
2019-07-29 11:40:51 +02:00
|
|
|
t.text "message"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "user_id"
|
2022-10-05 11:23:49 +02:00
|
|
|
t.index ["dossier_id"], name: "index_invites_on_dossier_id"
|
2021-04-27 13:55:39 +02:00
|
|
|
t.index ["email", "dossier_id"], name: "index_invites_on_email_and_dossier_id", unique: true
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2023-10-10 11:57:58 +02:00
|
|
|
create_table "maintenance_tasks_runs", force: :cascade do |t|
|
|
|
|
t.text "arguments"
|
|
|
|
t.text "backtrace"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.string "cursor"
|
|
|
|
t.datetime "ended_at", precision: nil
|
|
|
|
t.string "error_class"
|
|
|
|
t.string "error_message"
|
|
|
|
t.string "job_id"
|
|
|
|
t.integer "lock_version", default: 0, null: false
|
|
|
|
t.text "metadata"
|
|
|
|
t.datetime "started_at", precision: nil
|
|
|
|
t.string "status", default: "enqueued", null: false
|
|
|
|
t.string "task_name", null: false
|
|
|
|
t.bigint "tick_count", default: 0, null: false
|
|
|
|
t.bigint "tick_total"
|
|
|
|
t.float "time_running", default: 0.0, null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["task_name", "status", "created_at"], name: "index_maintenance_tasks_runs", order: { created_at: :desc }
|
|
|
|
end
|
|
|
|
|
2021-10-26 14:41:30 +02:00
|
|
|
create_table "merge_logs", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "from_user_email", null: false
|
|
|
|
t.bigint "from_user_id", null: false
|
2021-10-26 14:41:30 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "user_id", null: false
|
2021-10-26 14:41:30 +02:00
|
|
|
t.index ["user_id"], name: "index_merge_logs_on_user_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "module_api_cartos", id: :serial, force: :cascade do |t|
|
|
|
|
t.boolean "cadastre", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2018-10-31 11:17:03 +01:00
|
|
|
t.boolean "migrated"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.boolean "quartiers_prioritaires", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "use_api_carto", default: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_module_api_cartos_on_procedure_id", unique: true
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "procedure_presentations", id: :serial, force: :cascade do |t|
|
2017-10-02 17:03:30 +02:00
|
|
|
t.integer "assign_to_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2023-04-24 15:50:07 +02:00
|
|
|
t.jsonb "displayed_fields", default: [{ "label" => "Demandeur", "table" => "user", "column" => "email" }], null: false
|
|
|
|
t.jsonb "filters", default: { "tous" => [], "suivis" => [], "traites" => [], "a-suivre" => [], "archives" => [], "expirant" => [], "supprimes_recemment" => [] }, null: false
|
|
|
|
t.jsonb "sort", default: { "order" => "desc", "table" => "notifications", "column" => "notifications" }, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["assign_to_id"], name: "index_procedure_presentations_on_assign_to_id", unique: true
|
|
|
|
end
|
|
|
|
|
2020-07-21 10:39:57 +02:00
|
|
|
create_table "procedure_revision_types_de_champ", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "parent_id"
|
|
|
|
t.integer "position", null: false
|
2020-07-21 10:39:57 +02:00
|
|
|
t.bigint "revision_id", null: false
|
|
|
|
t.bigint "type_de_champ_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2021-12-06 21:03:26 +01:00
|
|
|
t.index ["parent_id"], name: "index_procedure_revision_types_de_champ_on_parent_id"
|
2020-07-21 10:39:57 +02:00
|
|
|
t.index ["revision_id"], name: "index_procedure_revision_types_de_champ_on_revision_id"
|
|
|
|
t.index ["type_de_champ_id"], name: "index_procedure_revision_types_de_champ_on_type_de_champ_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "procedure_revisions", force: :cascade do |t|
|
2022-02-02 16:10:29 +01:00
|
|
|
t.bigint "attestation_template_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-02-25 13:59:07 +01:00
|
|
|
t.bigint "dossier_submitted_message_id"
|
2023-01-11 11:17:34 +01:00
|
|
|
t.boolean "migrated_champ_routage"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "procedure_id", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "published_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-02-02 16:10:29 +01:00
|
|
|
t.index ["attestation_template_id"], name: "index_procedure_revisions_on_attestation_template_id"
|
2022-02-04 14:40:16 +01:00
|
|
|
t.index ["dossier_submitted_message_id"], name: "index_procedure_revisions_on_dossier_submitted_message_id"
|
2020-07-21 10:39:57 +02:00
|
|
|
t.index ["procedure_id"], name: "index_procedure_revisions_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "procedures", id: :serial, force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "aasm_state", default: "brouillon"
|
2023-03-23 17:13:57 +01:00
|
|
|
t.boolean "allow_expert_messaging", default: true, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "allow_expert_review", default: true, null: false
|
|
|
|
t.string "api_entreprise_token"
|
|
|
|
t.text "api_particulier_scopes", default: [], array: true
|
|
|
|
t.jsonb "api_particulier_sources", default: {}
|
|
|
|
t.boolean "ask_birthday", default: false, null: false
|
|
|
|
t.date "auto_archive_on"
|
|
|
|
t.string "cadre_juridique"
|
|
|
|
t.bigint "canonical_procedure_id"
|
|
|
|
t.boolean "cerfa_flag", default: false
|
2023-08-28 17:18:54 +02:00
|
|
|
t.jsonb "chorus", default: {}, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "cloned_from_library", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "closed_at", precision: 6
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "declarative_with_state"
|
2023-03-31 15:06:21 +02:00
|
|
|
t.bigint "defaut_groupe_instructeur_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "description"
|
2023-06-22 23:12:07 +02:00
|
|
|
t.string "description_pj"
|
2023-06-02 12:31:39 +02:00
|
|
|
t.string "description_target_audience"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "direction"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "dossiers_count_computed_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "draft_revision_id"
|
|
|
|
t.integer "duree_conservation_dossiers_dans_ds"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.boolean "duree_conservation_etendue_par_ds", default: false, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "durees_conservation_required", default: true
|
|
|
|
t.string "encrypted_api_particulier_token"
|
2023-01-06 17:47:28 +01:00
|
|
|
t.integer "estimated_dossiers_count"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.boolean "estimated_duration_visible", default: true, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.boolean "euro_flag", default: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "experts_require_administrateur_invitation", default: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.boolean "for_individual", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "hidden_at", precision: 6
|
2023-07-21 16:15:25 +02:00
|
|
|
t.datetime "hidden_at_as_template", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "instructeurs_self_management_enabled"
|
2018-06-01 10:46:59 +02:00
|
|
|
t.boolean "juridique_required", default: true
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "libelle"
|
|
|
|
t.string "lien_demarche"
|
2022-04-25 17:38:30 +02:00
|
|
|
t.string "lien_dpo"
|
2023-06-29 12:57:57 +02:00
|
|
|
t.text "lien_dpo_error"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "lien_notice"
|
2023-06-29 12:57:57 +02:00
|
|
|
t.text "lien_notice_error"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "lien_site_web"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.integer "max_duree_conservation_dossiers_dans_ds", default: 12, null: false
|
2023-01-11 11:17:34 +01:00
|
|
|
t.boolean "migrated_champ_routage"
|
2019-07-17 15:34:10 +02:00
|
|
|
t.text "monavis_embed"
|
2022-06-22 15:32:35 +02:00
|
|
|
t.boolean "opendata", default: true
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "organisation"
|
|
|
|
t.bigint "parent_procedure_id"
|
|
|
|
t.string "path", null: false
|
2022-11-07 18:08:38 +01:00
|
|
|
t.boolean "piece_justificative_multiple", default: true, null: false
|
2022-02-22 16:09:00 +01:00
|
|
|
t.boolean "procedure_expires_when_termine_enabled", default: true
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "published_at", precision: 6
|
2020-07-21 10:39:57 +02:00
|
|
|
t.bigint "published_revision_id"
|
2022-05-23 18:57:22 +02:00
|
|
|
t.bigint "replaced_by_procedure_id"
|
2021-09-18 11:22:35 +02:00
|
|
|
t.boolean "routing_enabled"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "service_id"
|
2023-05-25 19:06:43 +02:00
|
|
|
t.jsonb "sva_svr", default: {}, null: false
|
2022-10-06 11:21:14 +02:00
|
|
|
t.text "tags", default: [], array: true
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "test_started_at", precision: 6
|
|
|
|
t.datetime "unpublished_at", precision: 6
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "web_hook_url"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "whitelisted_at", precision: 6
|
2021-12-06 13:11:46 +01:00
|
|
|
t.bigint "zone_id"
|
2021-11-30 14:47:19 +01:00
|
|
|
t.index ["api_particulier_sources"], name: "index_procedures_on_api_particulier_sources", using: :gin
|
2019-05-23 14:28:14 +02:00
|
|
|
t.index ["declarative_with_state"], name: "index_procedures_on_declarative_with_state"
|
2023-03-31 15:06:21 +02:00
|
|
|
t.index ["defaut_groupe_instructeur_id"], name: "index_procedures_on_defaut_groupe_instructeur_id"
|
2020-07-21 10:39:57 +02:00
|
|
|
t.index ["draft_revision_id"], name: "index_procedures_on_draft_revision_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["hidden_at"], name: "index_procedures_on_hidden_at"
|
2022-11-22 13:59:03 +01:00
|
|
|
t.index ["libelle"], name: "index_procedures_on_libelle"
|
2018-04-24 15:23:07 +02:00
|
|
|
t.index ["parent_procedure_id"], name: "index_procedures_on_parent_procedure_id"
|
2021-04-27 13:55:39 +02:00
|
|
|
t.index ["path", "closed_at", "hidden_at", "unpublished_at"], name: "procedure_path_uniqueness", unique: true
|
2019-12-18 13:28:29 +01:00
|
|
|
t.index ["path", "closed_at", "hidden_at"], name: "index_procedures_on_path_and_closed_at_and_hidden_at", unique: true
|
2021-11-30 14:47:19 +01:00
|
|
|
t.index ["procedure_expires_when_termine_enabled"], name: "index_procedures_on_procedure_expires_when_termine_enabled"
|
2020-07-21 10:39:57 +02:00
|
|
|
t.index ["published_revision_id"], name: "index_procedures_on_published_revision_id"
|
2018-04-17 16:11:49 +02:00
|
|
|
t.index ["service_id"], name: "index_procedures_on_service_id"
|
2022-10-06 11:21:14 +02:00
|
|
|
t.index ["tags"], name: "index_procedures_on_tags", using: :gin
|
2021-12-01 21:05:15 +01:00
|
|
|
t.index ["zone_id"], name: "index_procedures_on_zone_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2022-08-24 12:39:07 +02:00
|
|
|
create_table "procedures_zones", id: false, force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.bigint "procedure_id"
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.bigint "zone_id"
|
|
|
|
t.index ["procedure_id"], name: "index_procedures_zones_on_procedure_id"
|
|
|
|
t.index ["zone_id"], name: "index_procedures_zones_on_zone_id"
|
|
|
|
end
|
|
|
|
|
2023-11-08 14:40:55 +01:00
|
|
|
create_table "re_instructed_mails", force: :cascade do |t|
|
|
|
|
t.text "body"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.integer "procedure_id", null: false
|
|
|
|
t.string "subject"
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["procedure_id"], name: "index_re_instructed_mails_on_procedure_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "received_mails", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-11-08 14:40:55 +01:00
|
|
|
t.datetime "created_at", precision: nil, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.string "subject"
|
2023-11-08 14:40:55 +01:00
|
|
|
t.datetime "updated_at", precision: nil, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_received_mails_on_procedure_id"
|
2017-03-06 11:51:34 +01:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "refused_mails", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.string "subject"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_refused_mails_on_procedure_id"
|
2017-03-06 11:51:34 +01:00
|
|
|
end
|
|
|
|
|
2023-10-03 16:14:09 +02:00
|
|
|
create_table "release_notes", force: :cascade do |t|
|
|
|
|
t.string "categories", default: [], array: true
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.boolean "published", default: false, null: false
|
|
|
|
t.date "released_on"
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["categories"], name: "index_release_notes_on_categories", using: :gin
|
|
|
|
t.index ["published"], name: "index_release_notes_on_published"
|
2023-10-03 16:20:13 +02:00
|
|
|
t.index ["released_on"], name: "index_release_notes_on_released_on"
|
2023-10-03 16:14:09 +02:00
|
|
|
end
|
|
|
|
|
2023-01-11 10:59:58 +01:00
|
|
|
create_table "safe_mailers", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.string "forced_delivery_method"
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2018-04-17 16:11:49 +02:00
|
|
|
create_table "services", force: :cascade do |t|
|
|
|
|
t.bigint "administrateur_id"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.text "adresse"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2023-10-25 18:41:03 +02:00
|
|
|
t.string "departement"
|
2018-05-10 11:38:11 +02:00
|
|
|
t.string "email"
|
2022-07-25 16:25:15 +02:00
|
|
|
t.jsonb "etablissement_infos", default: {}
|
|
|
|
t.decimal "etablissement_lat", precision: 10, scale: 6
|
|
|
|
t.decimal "etablissement_lng", precision: 10, scale: 6
|
2018-05-10 11:38:11 +02:00
|
|
|
t.text "horaires"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "nom", null: false
|
|
|
|
t.string "organisme"
|
2022-07-19 12:19:22 +02:00
|
|
|
t.string "siret"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "telephone"
|
|
|
|
t.string "type_organisme", null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-04-17 16:11:49 +02:00
|
|
|
t.index ["administrateur_id", "nom"], name: "index_services_on_administrateur_id_and_nom", unique: true
|
|
|
|
t.index ["administrateur_id"], name: "index_services_on_administrateur_id"
|
2023-10-25 18:41:03 +02:00
|
|
|
t.index ["departement"], name: "index_services_on_departement"
|
2018-04-17 16:11:49 +02:00
|
|
|
end
|
|
|
|
|
2020-10-02 16:29:34 +02:00
|
|
|
create_table "stats", force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "administrations_partenaires", default: 0
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2020-10-02 16:29:34 +02:00
|
|
|
t.bigint "dossiers_brouillon", default: 0
|
2022-03-15 14:24:20 +01:00
|
|
|
t.jsonb "dossiers_cumulative", default: "{}", null: false
|
2020-10-02 16:29:34 +02:00
|
|
|
t.bigint "dossiers_depose_avant_30_jours", default: 0
|
|
|
|
t.bigint "dossiers_deposes_entre_60_et_30_jours", default: 0
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "dossiers_en_construction", default: 0
|
|
|
|
t.bigint "dossiers_en_instruction", default: 0
|
2020-10-02 16:29:34 +02:00
|
|
|
t.jsonb "dossiers_in_the_last_4_months", default: "{}", null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "dossiers_not_brouillon", default: 0
|
|
|
|
t.bigint "dossiers_termines", default: 0
|
2020-10-02 16:29:34 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
end
|
|
|
|
|
2020-11-05 15:09:11 +01:00
|
|
|
create_table "super_admins", id: :serial, force: :cascade do |t|
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "consumed_timestep"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
|
|
|
t.datetime "current_sign_in_at", precision: 6
|
2020-11-05 15:09:11 +01:00
|
|
|
t.string "current_sign_in_ip"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "email", default: "", null: false
|
2020-11-05 15:09:11 +01:00
|
|
|
t.string "encrypted_otp_secret"
|
|
|
|
t.string "encrypted_otp_secret_iv"
|
|
|
|
t.string "encrypted_otp_secret_salt"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "encrypted_password", default: "", null: false
|
|
|
|
t.integer "failed_attempts", default: 0, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "last_sign_in_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "last_sign_in_ip"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "locked_at", precision: 6
|
2020-11-05 15:09:11 +01:00
|
|
|
t.boolean "otp_required_for_login"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "remember_created_at", precision: 6
|
|
|
|
t.datetime "reset_password_sent_at", precision: 6
|
2023-05-02 18:18:11 +02:00
|
|
|
t.string "otp_secret"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "reset_password_token"
|
|
|
|
t.integer "sign_in_count", default: 0, null: false
|
|
|
|
t.string "unlock_token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2020-11-05 15:09:11 +01:00
|
|
|
t.index ["email"], name: "index_super_admins_on_email", unique: true
|
|
|
|
t.index ["reset_password_token"], name: "index_super_admins_on_reset_password_token", unique: true
|
|
|
|
t.index ["unlock_token"], name: "index_super_admins_on_unlock_token", unique: true
|
|
|
|
end
|
|
|
|
|
2023-04-24 15:50:07 +02:00
|
|
|
create_table "targeted_user_links", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
|
2022-05-23 15:09:22 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.string "target_context", null: false
|
|
|
|
t.bigint "target_model_id", null: false
|
|
|
|
t.string "target_model_type", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-06-13 16:00:41 +02:00
|
|
|
t.bigint "user_id"
|
|
|
|
t.index ["target_model_id"], name: "index_targeted_user_links_on_target_model_id"
|
2022-05-23 15:09:22 +02:00
|
|
|
t.index ["user_id"], name: "index_targeted_user_links_on_user_id"
|
|
|
|
end
|
|
|
|
|
2018-07-18 15:45:23 +02:00
|
|
|
create_table "task_records", id: false, force: :cascade do |t|
|
|
|
|
t.string "version", null: false
|
|
|
|
end
|
|
|
|
|
2020-07-02 11:02:50 +02:00
|
|
|
create_table "traitements", force: :cascade do |t|
|
2023-10-17 12:00:16 +02:00
|
|
|
t.string "browser_name"
|
|
|
|
t.boolean "browser_supported"
|
|
|
|
t.integer "browser_version"
|
2020-07-02 11:02:50 +02:00
|
|
|
t.bigint "dossier_id"
|
2020-07-07 10:43:07 +02:00
|
|
|
t.string "instructeur_email"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "motivation"
|
2021-08-18 11:19:19 +02:00
|
|
|
t.boolean "process_expired"
|
2021-11-30 14:47:19 +01:00
|
|
|
t.boolean "process_expired_migrated", default: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "processed_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "state"
|
2020-07-02 11:02:50 +02:00
|
|
|
t.index ["dossier_id"], name: "index_traitements_on_dossier_id"
|
2021-08-18 11:19:19 +02:00
|
|
|
t.index ["process_expired"], name: "index_traitements_on_process_expired"
|
2020-07-02 11:02:50 +02:00
|
|
|
end
|
|
|
|
|
2019-02-01 18:11:55 +01:00
|
|
|
create_table "trusted_device_tokens", force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "instructeur_id"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.string "token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2019-08-05 16:09:39 +02:00
|
|
|
t.index ["instructeur_id"], name: "index_trusted_device_tokens_on_instructeur_id"
|
2019-02-01 18:11:55 +01:00
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "types_de_champ", id: :serial, force: :cascade do |t|
|
2022-05-31 12:04:23 +02:00
|
|
|
t.jsonb "condition"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.text "description"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "libelle"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.boolean "mandatory", default: false
|
2018-10-16 13:00:52 +02:00
|
|
|
t.jsonb "options"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.boolean "private", default: false, null: false
|
|
|
|
t.bigint "stable_id"
|
|
|
|
t.string "type_champ"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2018-02-09 17:21:46 +01:00
|
|
|
t.index ["private"], name: "index_types_de_champ_on_private"
|
2018-11-23 19:22:33 +01:00
|
|
|
t.index ["stable_id"], name: "index_types_de_champ_on_stable_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "users", id: :serial, force: :cascade do |t|
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "confirmation_sent_at", precision: 6
|
2023-07-18 13:46:27 +02:00
|
|
|
t.datetime "blocked_at", precision: 6
|
2023-10-18 13:57:33 +02:00
|
|
|
t.datetime "announces_seen_at", precision: 6
|
2023-07-18 13:46:27 +02:00
|
|
|
t.text "blocked_reason"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "confirmation_token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "confirmed_at", precision: 6
|
|
|
|
t.datetime "created_at", precision: 6
|
|
|
|
t.datetime "current_sign_in_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "current_sign_in_ip"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "email", default: "", null: false
|
|
|
|
t.string "encrypted_password", default: "", null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "failed_attempts", default: 0, null: false
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "last_sign_in_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "last_sign_in_ip"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "locale"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "locked_at", precision: 6
|
2018-02-08 17:38:01 +01:00
|
|
|
t.string "loged_in_with_france_connect", default: "false"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "remember_created_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "requested_merge_into_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "reset_password_sent_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "reset_password_token"
|
|
|
|
t.integer "sign_in_count", default: 0, null: false
|
|
|
|
t.string "siret"
|
2023-04-24 15:50:07 +02:00
|
|
|
t.boolean "team_account", default: false
|
2019-09-10 16:53:11 +02:00
|
|
|
t.text "unconfirmed_email"
|
2019-07-29 16:30:04 +02:00
|
|
|
t.string "unlock_token"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6
|
2018-05-14 14:21:03 +02:00
|
|
|
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["email"], name: "index_users_on_email", unique: true
|
2021-10-26 12:54:50 +02:00
|
|
|
t.index ["requested_merge_into_id"], name: "index_users_on_requested_merge_into_id"
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
2019-07-29 16:30:04 +02:00
|
|
|
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|
|
|
|
|
2018-05-11 14:59:20 +02:00
|
|
|
create_table "virus_scans", force: :cascade do |t|
|
|
|
|
t.string "blob_key"
|
2022-03-15 14:24:20 +01:00
|
|
|
t.bigint "champ_id"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
|
|
|
t.datetime "scanned_at", precision: 6
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "status"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-05-11 14:59:20 +02:00
|
|
|
t.index ["champ_id"], name: "index_virus_scans_on_champ_id"
|
|
|
|
end
|
|
|
|
|
2018-02-08 17:38:01 +01:00
|
|
|
create_table "without_continuation_mails", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "body"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.integer "procedure_id"
|
|
|
|
t.string "subject"
|
2023-04-24 15:41:54 +02:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2018-02-08 17:38:01 +01:00
|
|
|
t.index ["procedure_id"], name: "index_without_continuation_mails_on_procedure_id"
|
2017-03-06 11:51:34 +01:00
|
|
|
end
|
|
|
|
|
2022-08-11 19:04:54 +02:00
|
|
|
create_table "zone_labels", force: :cascade do |t|
|
2022-10-14 09:45:58 +02:00
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-08-11 19:04:54 +02:00
|
|
|
t.date "designated_on", null: false
|
|
|
|
t.string "name", null: false
|
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
2022-10-14 09:45:58 +02:00
|
|
|
t.bigint "zone_id", null: false
|
2022-08-11 19:04:54 +02:00
|
|
|
t.index ["zone_id"], name: "index_zone_labels_on_zone_id"
|
|
|
|
end
|
|
|
|
|
2021-12-06 13:11:46 +01:00
|
|
|
create_table "zones", force: :cascade do |t|
|
|
|
|
t.string "acronym", null: false
|
|
|
|
t.datetime "created_at", precision: 6, null: false
|
2022-03-15 14:24:20 +01:00
|
|
|
t.string "label"
|
2023-03-27 15:34:01 +02:00
|
|
|
t.string "tchap_hs", default: [], array: true
|
2021-12-06 13:11:46 +01:00
|
|
|
t.datetime "updated_at", precision: 6, null: false
|
|
|
|
t.index ["acronym"], name: "index_zones_on_acronym", unique: true
|
|
|
|
end
|
|
|
|
|
2022-10-11 11:52:59 +02:00
|
|
|
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
2021-03-09 12:05:02 +01:00
|
|
|
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
2023-09-04 12:07:04 +02:00
|
|
|
add_foreign_key "administrateurs", "groupe_gestionnaires"
|
2022-03-22 16:53:38 +01:00
|
|
|
add_foreign_key "administrateurs", "users"
|
2022-03-02 11:27:18 +01:00
|
|
|
add_foreign_key "administrateurs_instructeurs", "administrateurs"
|
|
|
|
add_foreign_key "administrateurs_instructeurs", "instructeurs"
|
2022-03-02 14:09:43 +01:00
|
|
|
add_foreign_key "administrateurs_procedures", "administrateurs"
|
2022-03-08 09:21:22 +01:00
|
|
|
add_foreign_key "administrateurs_procedures", "procedures"
|
2022-12-01 10:46:42 +01:00
|
|
|
add_foreign_key "api_tokens", "administrateurs"
|
2021-04-29 17:29:47 +02:00
|
|
|
add_foreign_key "archives_groupe_instructeurs", "archives"
|
|
|
|
add_foreign_key "archives_groupe_instructeurs", "groupe_instructeurs"
|
2019-08-20 16:47:41 +02:00
|
|
|
add_foreign_key "assign_tos", "groupe_instructeurs"
|
2017-06-08 14:16:48 +02:00
|
|
|
add_foreign_key "attestation_templates", "procedures"
|
2017-06-02 14:30:26 +02:00
|
|
|
add_foreign_key "attestations", "dossiers"
|
2021-10-07 15:43:25 +02:00
|
|
|
add_foreign_key "avis", "dossiers"
|
2021-01-15 16:39:07 +01:00
|
|
|
add_foreign_key "avis", "experts_procedures"
|
2022-11-18 15:26:31 +01:00
|
|
|
add_foreign_key "batch_operations", "instructeurs"
|
2021-07-22 14:34:07 +02:00
|
|
|
add_foreign_key "bulk_messages_groupe_instructeurs", "bulk_messages"
|
|
|
|
add_foreign_key "bulk_messages_groupe_instructeurs", "groupe_instructeurs"
|
2018-12-18 11:17:52 +01:00
|
|
|
add_foreign_key "champs", "champs", column: "parent_id"
|
2022-10-11 11:52:59 +02:00
|
|
|
add_foreign_key "champs", "dossiers"
|
|
|
|
add_foreign_key "champs", "etablissements"
|
|
|
|
add_foreign_key "champs", "types_de_champ"
|
2017-03-06 11:51:34 +01:00
|
|
|
add_foreign_key "closed_mails", "procedures"
|
2016-11-04 17:11:26 +01:00
|
|
|
add_foreign_key "commentaires", "dossiers"
|
2021-04-22 15:44:58 +02:00
|
|
|
add_foreign_key "commentaires", "experts"
|
2022-10-20 11:45:02 +02:00
|
|
|
add_foreign_key "commentaires", "instructeurs"
|
2023-08-11 10:49:16 +02:00
|
|
|
add_foreign_key "contact_informations", "groupe_instructeurs"
|
2023-06-30 11:26:23 +02:00
|
|
|
add_foreign_key "dossier_assignments", "dossiers"
|
2023-04-24 15:44:05 +02:00
|
|
|
add_foreign_key "dossier_batch_operations", "batch_operations"
|
|
|
|
add_foreign_key "dossier_batch_operations", "dossiers"
|
2023-02-28 15:06:39 +01:00
|
|
|
add_foreign_key "dossier_corrections", "commentaires"
|
|
|
|
add_foreign_key "dossier_corrections", "dossiers"
|
2019-06-17 11:01:41 +02:00
|
|
|
add_foreign_key "dossier_operation_logs", "bill_signatures"
|
2021-09-07 10:26:30 +02:00
|
|
|
add_foreign_key "dossier_transfer_logs", "dossiers"
|
2022-11-18 15:26:31 +01:00
|
|
|
add_foreign_key "dossiers", "batch_operations"
|
2021-09-07 10:26:30 +02:00
|
|
|
add_foreign_key "dossiers", "dossier_transfers"
|
2022-11-10 10:58:59 +01:00
|
|
|
add_foreign_key "dossiers", "dossiers", column: "parent_dossier_id"
|
2019-08-22 17:58:31 +02:00
|
|
|
add_foreign_key "dossiers", "groupe_instructeurs"
|
2020-07-21 10:39:57 +02:00
|
|
|
add_foreign_key "dossiers", "procedure_revisions", column: "revision_id"
|
2016-11-04 17:11:26 +01:00
|
|
|
add_foreign_key "dossiers", "users"
|
2022-10-11 11:52:59 +02:00
|
|
|
add_foreign_key "etablissements", "dossiers"
|
2022-03-22 16:53:38 +01:00
|
|
|
add_foreign_key "experts", "users"
|
2021-01-07 15:45:02 +01:00
|
|
|
add_foreign_key "experts_procedures", "experts"
|
|
|
|
add_foreign_key "experts_procedures", "procedures"
|
2023-10-09 09:15:54 +02:00
|
|
|
add_foreign_key "exports", "instructeurs"
|
2021-04-12 15:05:05 +02:00
|
|
|
add_foreign_key "france_connect_informations", "users"
|
2018-10-16 13:00:52 +02:00
|
|
|
add_foreign_key "geo_areas", "champs"
|
2019-08-19 16:12:30 +02:00
|
|
|
add_foreign_key "groupe_instructeurs", "procedures"
|
2017-03-07 10:25:28 +01:00
|
|
|
add_foreign_key "initiated_mails", "procedures"
|
2022-03-22 16:53:38 +01:00
|
|
|
add_foreign_key "instructeurs", "users"
|
2021-10-26 14:41:30 +02:00
|
|
|
add_foreign_key "merge_logs", "users"
|
2017-10-02 17:03:30 +02:00
|
|
|
add_foreign_key "procedure_presentations", "assign_tos"
|
2021-12-06 21:03:26 +01:00
|
|
|
add_foreign_key "procedure_revision_types_de_champ", "procedure_revision_types_de_champ", column: "parent_id"
|
2020-07-21 10:39:57 +02:00
|
|
|
add_foreign_key "procedure_revision_types_de_champ", "procedure_revisions", column: "revision_id"
|
|
|
|
add_foreign_key "procedure_revision_types_de_champ", "types_de_champ"
|
2022-02-02 16:10:29 +01:00
|
|
|
add_foreign_key "procedure_revisions", "attestation_templates"
|
2022-02-04 14:40:16 +01:00
|
|
|
add_foreign_key "procedure_revisions", "dossier_submitted_messages"
|
2020-07-21 10:39:57 +02:00
|
|
|
add_foreign_key "procedure_revisions", "procedures"
|
2023-03-31 15:06:21 +02:00
|
|
|
add_foreign_key "procedures", "groupe_instructeurs", column: "defaut_groupe_instructeur_id"
|
2020-07-21 10:39:57 +02:00
|
|
|
add_foreign_key "procedures", "procedure_revisions", column: "draft_revision_id"
|
|
|
|
add_foreign_key "procedures", "procedure_revisions", column: "published_revision_id"
|
2018-04-17 16:11:49 +02:00
|
|
|
add_foreign_key "procedures", "services"
|
2021-12-01 21:05:15 +01:00
|
|
|
add_foreign_key "procedures", "zones"
|
2017-03-06 11:51:34 +01:00
|
|
|
add_foreign_key "received_mails", "procedures"
|
|
|
|
add_foreign_key "refused_mails", "procedures"
|
2018-04-17 16:11:49 +02:00
|
|
|
add_foreign_key "services", "administrateurs"
|
2022-05-23 15:09:22 +02:00
|
|
|
add_foreign_key "targeted_user_links", "users"
|
2020-07-02 11:02:50 +02:00
|
|
|
add_foreign_key "traitements", "dossiers"
|
2019-08-05 16:09:39 +02:00
|
|
|
add_foreign_key "trusted_device_tokens", "instructeurs"
|
2021-10-26 12:54:50 +02:00
|
|
|
add_foreign_key "users", "users", column: "requested_merge_into_id"
|
2017-03-06 11:51:34 +01:00
|
|
|
add_foreign_key "without_continuation_mails", "procedures"
|
2022-08-11 19:04:54 +02:00
|
|
|
add_foreign_key "zone_labels", "zones"
|
2016-11-04 17:11:26 +01:00
|
|
|
end
|