diff --git a/app/models/champ.rb b/app/models/champ.rb index 5688be2d6..41fd80a34 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champ < ApplicationRecord belongs_to :dossier, inverse_of: false, touch: true, optional: false diff --git a/app/models/champs/address_champ.rb b/app/models/champs/address_champ.rb index ea506dd24..c6298b99a 100644 --- a/app/models/champs/address_champ.rb +++ b/app/models/champs/address_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::AddressChamp < Champs::TextChamp def full_address? diff --git a/app/models/champs/annuaire_education_champ.rb b/app/models/champs/annuaire_education_champ.rb index fa884d526..727a5a4bf 100644 --- a/app/models/champs/annuaire_education_champ.rb +++ b/app/models/champs/annuaire_education_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::AnnuaireEducationChamp < Champs::TextChamp def fetch_external_data? diff --git a/app/models/champs/carte_champ.rb b/app/models/champs/carte_champ.rb index 363974f07..4f351ba0e 100644 --- a/app/models/champs/carte_champ.rb +++ b/app/models/champs/carte_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::CarteChamp < Champ # Default map location. Center of the World, ahm, France... diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index 559c44e31..a500abb59 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::CheckboxChamp < Champs::YesNoChamp def true? diff --git a/app/models/champs/civilite_champ.rb b/app/models/champs/civilite_champ.rb index d9505aee3..cf5316ea0 100644 --- a/app/models/champs/civilite_champ.rb +++ b/app/models/champs/civilite_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::CiviliteChamp < Champ def html_label? diff --git a/app/models/champs/cnaf_champ.rb b/app/models/champs/cnaf_champ.rb index 8e752047e..e8d2d38d6 100644 --- a/app/models/champs/cnaf_champ.rb +++ b/app/models/champs/cnaf_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::CnafChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/cnaf-input-validation.middleware.ts diff --git a/app/models/champs/commune_champ.rb b/app/models/champs/commune_champ.rb index 679920781..ce2a67cc5 100644 --- a/app/models/champs/commune_champ.rb +++ b/app/models/champs/commune_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::CommuneChamp < Champs::TextChamp store_accessor :value_json, :departement, :code_departement diff --git a/app/models/champs/date_champ.rb b/app/models/champs/date_champ.rb index efabab5c1..db0644ed7 100644 --- a/app/models/champs/date_champ.rb +++ b/app/models/champs/date_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DateChamp < Champ before_save :format_before_save diff --git a/app/models/champs/datetime_champ.rb b/app/models/champs/datetime_champ.rb index cd5617bad..8899811b1 100644 --- a/app/models/champs/datetime_champ.rb +++ b/app/models/champs/datetime_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DatetimeChamp < Champ before_save :format_before_save diff --git a/app/models/champs/decimal_number_champ.rb b/app/models/champs/decimal_number_champ.rb index 548e21e1f..1bc48db23 100644 --- a/app/models/champs/decimal_number_champ.rb +++ b/app/models/champs/decimal_number_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DecimalNumberChamp < Champ validates :value, numericality: { diff --git a/app/models/champs/departement_champ.rb b/app/models/champs/departement_champ.rb index 544fbe5ad..b9b68db43 100644 --- a/app/models/champs/departement_champ.rb +++ b/app/models/champs/departement_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DepartementChamp < Champs::TextChamp end diff --git a/app/models/champs/dgfip_champ.rb b/app/models/champs/dgfip_champ.rb index ad47ad1c0..c72b338c8 100644 --- a/app/models/champs/dgfip_champ.rb +++ b/app/models/champs/dgfip_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DgfipChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/dgfip-input-validation.middleware.ts diff --git a/app/models/champs/dossier_link_champ.rb b/app/models/champs/dossier_link_champ.rb index f1423b014..55c8763e9 100644 --- a/app/models/champs/dossier_link_champ.rb +++ b/app/models/champs/dossier_link_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DossierLinkChamp < Champ end diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index af44735b2..baad4c3b0 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::DropDownListChamp < Champ THRESHOLD_NB_OPTIONS_AS_RADIO = 5 diff --git a/app/models/champs/email_champ.rb b/app/models/champs/email_champ.rb index 3b4379521..acdd6568c 100644 --- a/app/models/champs/email_champ.rb +++ b/app/models/champs/email_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::EmailChamp < Champs::TextChamp end diff --git a/app/models/champs/engagement_champ.rb b/app/models/champs/engagement_champ.rb index 36196a259..bdd6ff0a6 100644 --- a/app/models/champs/engagement_champ.rb +++ b/app/models/champs/engagement_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::EngagementChamp < Champs::CheckboxChamp end diff --git a/app/models/champs/explication_champ.rb b/app/models/champs/explication_champ.rb index 5cee68733..bac3d0aff 100644 --- a/app/models/champs/explication_champ.rb +++ b/app/models/champs/explication_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::ExplicationChamp < Champs::TextChamp def search_terms diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index e00cc3643..2cc24c888 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::HeaderSectionChamp < Champ def search_terms diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index a4590ac2b..df94eac66 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::IbanChamp < Champ validates_with IbanValidator diff --git a/app/models/champs/integer_number_champ.rb b/app/models/champs/integer_number_champ.rb index 220d8d2de..5187db3d9 100644 --- a/app/models/champs/integer_number_champ.rb +++ b/app/models/champs/integer_number_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::IntegerNumberChamp < Champ validates :value, numericality: { diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index 239119bcd..351ce893a 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::LinkedDropDownListChamp < Champ delegate :primary_options, :secondary_options, to: 'type_de_champ.dynamic_type' diff --git a/app/models/champs/mesri_champ.rb b/app/models/champs/mesri_champ.rb index e7f0b59fd..b61cb0f60 100644 --- a/app/models/champs/mesri_champ.rb +++ b/app/models/champs/mesri_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::MesriChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/mesri-input-validation.middleware.ts diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 0601c5b19..899dd0159 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::MultipleDropDownListChamp < Champ before_save :format_before_save diff --git a/app/models/champs/number_champ.rb b/app/models/champs/number_champ.rb index 7e07ec1a2..d43a6d3df 100644 --- a/app/models/champs/number_champ.rb +++ b/app/models/champs/number_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::NumberChamp < Champ end diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index 6da4c169f..2eb3eee76 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::PaysChamp < Champs::TextChamp def localized_value diff --git a/app/models/champs/phone_champ.rb b/app/models/champs/phone_champ.rb index 84d2073d7..ac2c51449 100644 --- a/app/models/champs/phone_champ.rb +++ b/app/models/champs/phone_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::PhoneChamp < Champs::TextChamp # We want to allow: diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 8375ef83a..96923f3c2 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::PieceJustificativeChamp < Champ FILE_MAX_SIZE = 200.megabytes diff --git a/app/models/champs/pole_emploi_champ.rb b/app/models/champs/pole_emploi_champ.rb index 924e8331a..4bc4124f0 100644 --- a/app/models/champs/pole_emploi_champ.rb +++ b/app/models/champs/pole_emploi_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::PoleEmploiChamp < Champs::TextChamp # see https://github.com/betagouv/api-particulier/blob/master/src/presentation/middlewares/pole-emploi-input-validation.middleware.ts diff --git a/app/models/champs/region_champ.rb b/app/models/champs/region_champ.rb index 8615562b0..5fcbe8934 100644 --- a/app/models/champs/region_champ.rb +++ b/app/models/champs/region_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::RegionChamp < Champs::TextChamp end diff --git a/app/models/champs/repetition_champ.rb b/app/models/champs/repetition_champ.rb index efd835575..83d691ffc 100644 --- a/app/models/champs/repetition_champ.rb +++ b/app/models/champs/repetition_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::RepetitionChamp < Champ accepts_nested_attributes_for :champs, allow_destroy: true diff --git a/app/models/champs/siret_champ.rb b/app/models/champs/siret_champ.rb index 3af4bc211..d9c9d9852 100644 --- a/app/models/champs/siret_champ.rb +++ b/app/models/champs/siret_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::SiretChamp < Champ def search_terms diff --git a/app/models/champs/text_champ.rb b/app/models/champs/text_champ.rb index 182f7cfa5..9c48ba036 100644 --- a/app/models/champs/text_champ.rb +++ b/app/models/champs/text_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::TextChamp < Champ end diff --git a/app/models/champs/textarea_champ.rb b/app/models/champs/textarea_champ.rb index a11f6f055..39570d81a 100644 --- a/app/models/champs/textarea_champ.rb +++ b/app/models/champs/textarea_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::TextareaChamp < Champs::TextChamp def for_export diff --git a/app/models/champs/titre_identite_champ.rb b/app/models/champs/titre_identite_champ.rb index 940d6ded5..a89486112 100644 --- a/app/models/champs/titre_identite_champ.rb +++ b/app/models/champs/titre_identite_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::TitreIdentiteChamp < Champ FILE_MAX_SIZE = 20.megabytes diff --git a/app/models/champs/yes_no_champ.rb b/app/models/champs/yes_no_champ.rb index f527cad9a..293beaba2 100644 --- a/app/models/champs/yes_no_champ.rb +++ b/app/models/champs/yes_no_champ.rb @@ -13,11 +13,11 @@ # value_json :jsonb # created_at :datetime # updated_at :datetime -# dossier_id :integer not null +# dossier_id :integer # etablissement_id :integer # external_id :string # parent_id :bigint -# type_de_champ_id :integer not null +# type_de_champ_id :integer # class Champs::YesNoChamp < Champ def search_terms diff --git a/db/migrate/20220727084308_add_missing_foreign_keys.rb b/db/migrate/20220727084308_add_missing_foreign_keys.rb deleted file mode 100644 index 011bff654..000000000 --- a/db/migrate/20220727084308_add_missing_foreign_keys.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/db/migrate/20220727085155_validate_missing_foreign_keys.rb b/db/migrate/20220727085155_validate_missing_foreign_keys.rb deleted file mode 100644 index 2a9ac7767..000000000 --- a/db/migrate/20220727085155_validate_missing_foreign_keys.rb +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/db/migrate/20220727132450_validate_not_null_champs_type_de_champ_id.rb b/db/migrate/20220727132450_validate_not_null_champs_type_de_champ_id.rb deleted file mode 100644 index dad6f2d28..000000000 --- a/db/migrate/20220727132450_validate_not_null_champs_type_de_champ_id.rb +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/db/migrate/20220727132456_validate_not_null_champs_dossier_id.rb b/db/migrate/20220727132456_validate_not_null_champs_dossier_id.rb deleted file mode 100644 index 6c84dd8ec..000000000 --- a/db/migrate/20220727132456_validate_not_null_champs_dossier_id.rb +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/db/migrate/20220728082905_add_foreign_key_to_attachments_blob_id.rb b/db/migrate/20220728082905_add_foreign_key_to_attachments_blob_id.rb deleted file mode 100644 index d43b39125..000000000 --- a/db/migrate/20220728082905_add_foreign_key_to_attachments_blob_id.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddForeignKeyToAttachmentsBlobId < ActiveRecord::Migration[6.1] - def change - add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id, validate: false - end -end diff --git a/db/migrate/20220728082914_validate_foreign_key_on_attachments_blob_id.rb b/db/migrate/20220728082914_validate_foreign_key_on_attachments_blob_id.rb deleted file mode 100644 index 680ddd963..000000000 --- a/db/migrate/20220728082914_validate_foreign_key_on_attachments_blob_id.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ValidateForeignKeyOnAttachmentsBlobId < ActiveRecord::Migration[6.1] - def change - validate_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id - end -end diff --git a/db/schema.rb b/db/schema.rb index c9faba4a2..33115f0cd 100644 --- a/db/schema.rb +++ b/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_04_151920) do +ActiveRecord::Schema.define(version: 2022_09_02_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_04_151920) do create_table "champs", id: :serial, force: :cascade do |t| t.datetime "created_at" t.jsonb "data" - t.integer "dossier_id", null: false + t.integer "dossier_id" 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_04_151920) do t.datetime "rebased_at" t.integer "row" t.string "type" - t.integer "type_de_champ_id", null: false + t.integer "type_de_champ_id" t.datetime "updated_at" t.string "value" t.jsonb "value_json" @@ -869,7 +869,6 @@ ActiveRecord::Schema.define(version: 2022_09_04_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" @@ -886,9 +885,6 @@ ActiveRecord::Schema.define(version: 2022_09_04_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" @@ -898,7 +894,6 @@ ActiveRecord::Schema.define(version: 2022_09_04_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"