Merge pull request #7637 from tchak/chore-add-missing-foreign-keys
fix(db): add missing foreign keys
This commit is contained in:
commit
b21ee46dc2
43 changed files with 123 additions and 75 deletions
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champ < ApplicationRecord
|
||||
belongs_to :dossier, inverse_of: false, touch: true, optional: false
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::AddressChamp < Champs::TextChamp
|
||||
def full_address?
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::AnnuaireEducationChamp < Champs::TextChamp
|
||||
def fetch_external_data?
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::CarteChamp < Champ
|
||||
# Default map location. Center of the World, ahm, France...
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::CheckboxChamp < Champs::YesNoChamp
|
||||
def true?
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::CiviliteChamp < Champ
|
||||
def html_label?
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::CnafChamp < Champs::TextChamp
|
||||
# see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/cnaf-input-validation.middleware.ts
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::CommuneChamp < Champs::TextChamp
|
||||
store_accessor :value_json, :departement, :code_departement
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DateChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DatetimeChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DecimalNumberChamp < Champ
|
||||
validates :value, numericality: {
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DepartementChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DgfipChamp < Champs::TextChamp
|
||||
# see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/dgfip-input-validation.middleware.ts
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DossierLinkChamp < Champ
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::DropDownListChamp < Champ
|
||||
THRESHOLD_NB_OPTIONS_AS_RADIO = 5
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::EmailChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::EngagementChamp < Champs::CheckboxChamp
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::ExplicationChamp < Champs::TextChamp
|
||||
def search_terms
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::HeaderSectionChamp < Champ
|
||||
def search_terms
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::IbanChamp < Champ
|
||||
validates_with IbanValidator
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::IntegerNumberChamp < Champ
|
||||
validates :value, numericality: {
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::LinkedDropDownListChamp < Champ
|
||||
delegate :primary_options, :secondary_options, to: 'type_de_champ.dynamic_type'
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::MesriChamp < Champs::TextChamp
|
||||
# see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/mesri-input-validation.middleware.ts
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::MultipleDropDownListChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::NumberChamp < Champ
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::PaysChamp < Champs::TextChamp
|
||||
def localized_value
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::PhoneChamp < Champs::TextChamp
|
||||
# We want to allow:
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::PieceJustificativeChamp < Champ
|
||||
FILE_MAX_SIZE = 200.megabytes
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::PoleEmploiChamp < Champs::TextChamp
|
||||
# see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/pole-emploi-input-validation.middleware.ts
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::RegionChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::RepetitionChamp < Champ
|
||||
accepts_nested_attributes_for :champs, allow_destroy: true
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::SiretChamp < Champ
|
||||
def search_terms
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::TextChamp < Champ
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::TextareaChamp < Champs::TextChamp
|
||||
def for_export
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::TitreIdentiteChamp < Champ
|
||||
FILE_MAX_SIZE = 20.megabytes
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# value_json :jsonb
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# dossier_id :integer not null
|
||||
# etablissement_id :integer
|
||||
# external_id :string
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
# type_de_champ_id :integer not null
|
||||
#
|
||||
class Champs::YesNoChamp < Champ
|
||||
def search_terms
|
||||
|
|
11
db/migrate/20220727084308_add_missing_foreign_keys.rb
Normal file
11
db/migrate/20220727084308_add_missing_foreign_keys.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class AddMissingForeignKeys < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_foreign_key :champs, :dossiers, validate: false
|
||||
add_foreign_key :champs, :types_de_champ, validate: false
|
||||
add_foreign_key :champs, :etablissements, validate: false
|
||||
add_foreign_key :etablissements, :dossiers, validate: false
|
||||
|
||||
add_check_constraint :champs, "dossier_id IS NOT NULL", name: "champs_dossier_id_null", validate: false
|
||||
add_check_constraint :champs, "type_de_champ_id IS NOT NULL", name: "champs_type_de_champ_id_null", validate: false
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class ValidateMissingForeignKeys < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
validate_foreign_key :champs, :dossiers
|
||||
validate_foreign_key :champs, :types_de_champ
|
||||
validate_foreign_key :champs, :etablissements
|
||||
validate_foreign_key :etablissements, :dossiers
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
class ValidateNotNullChampsTypeDeChampId < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
validate_check_constraint :champs, name: "champs_type_de_champ_id_null"
|
||||
change_column_null :champs, :type_de_champ_id, false
|
||||
remove_check_constraint :champs, name: "champs_type_de_champ_id_null"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
class ValidateNotNullChampsDossierId < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
validate_check_constraint :champs, name: "champs_dossier_id_null"
|
||||
change_column_null :champs, :dossier_id, false
|
||||
remove_check_constraint :champs, name: "champs_dossier_id_null"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForeignKeyToAttachmentsBlobId < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id, validate: false
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class ValidateForeignKeyOnAttachmentsBlobId < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
validate_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
|
||||
end
|
||||
end
|
11
db/schema.rb
11
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
||||
ActiveRecord::Schema.define(version: 2022_09_04_151920) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
|
@ -185,7 +185,7 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
|||
create_table "champs", id: :serial, force: :cascade do |t|
|
||||
t.datetime "created_at"
|
||||
t.jsonb "data"
|
||||
t.integer "dossier_id"
|
||||
t.integer "dossier_id", null: false
|
||||
t.integer "etablissement_id"
|
||||
t.string "external_id"
|
||||
t.string "fetch_external_data_exceptions", array: true
|
||||
|
@ -194,7 +194,7 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
|||
t.datetime "rebased_at"
|
||||
t.integer "row"
|
||||
t.string "type"
|
||||
t.integer "type_de_champ_id"
|
||||
t.integer "type_de_champ_id", null: false
|
||||
t.datetime "updated_at"
|
||||
t.string "value"
|
||||
t.jsonb "value_json"
|
||||
|
@ -869,6 +869,7 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
|||
t.index ["acronym"], name: "index_zones_on_acronym", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "administrateurs", "users"
|
||||
add_foreign_key "administrateurs_instructeurs", "administrateurs"
|
||||
|
@ -885,6 +886,9 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
|||
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"
|
||||
|
@ -894,6 +898,7 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do
|
|||
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"
|
||||
|
|
Loading…
Reference in a new issue