diff --git a/app/models/champ.rb b/app/models/champ.rb index 539c5af8b..61930b3ab 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/address_champ.rb b/app/models/champs/address_champ.rb index 72da63012..3e7870b50 100644 --- a/app/models/champs/address_champ.rb +++ b/app/models/champs/address_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/annuaire_education_champ.rb b/app/models/champs/annuaire_education_champ.rb index d5a895224..22141ca17 100644 --- a/app/models/champs/annuaire_education_champ.rb +++ b/app/models/champs/annuaire_education_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/carte_champ.rb b/app/models/champs/carte_champ.rb index f8b67c82c..1e91e529e 100644 --- a/app/models/champs/carte_champ.rb +++ b/app/models/champs/carte_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index 40b38af23..82f009577 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/civilite_champ.rb b/app/models/champs/civilite_champ.rb index 8f04758cb..ace32a968 100644 --- a/app/models/champs/civilite_champ.rb +++ b/app/models/champs/civilite_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/commune_champ.rb b/app/models/champs/commune_champ.rb index 34569584f..349221cf1 100644 --- a/app/models/champs/commune_champ.rb +++ b/app/models/champs/commune_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/date_champ.rb b/app/models/champs/date_champ.rb index 1eca35bf8..2e09bd29d 100644 --- a/app/models/champs/date_champ.rb +++ b/app/models/champs/date_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/datetime_champ.rb b/app/models/champs/datetime_champ.rb index cf2d6c7e1..f7f5bd496 100644 --- a/app/models/champs/datetime_champ.rb +++ b/app/models/champs/datetime_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/decimal_number_champ.rb b/app/models/champs/decimal_number_champ.rb index b907c1c50..f574c07ca 100644 --- a/app/models/champs/decimal_number_champ.rb +++ b/app/models/champs/decimal_number_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/departement_champ.rb b/app/models/champs/departement_champ.rb index d4eaa8501..ac5c89633 100644 --- a/app/models/champs/departement_champ.rb +++ b/app/models/champs/departement_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/dossier_link_champ.rb b/app/models/champs/dossier_link_champ.rb index 39ba322f8..866f70197 100644 --- a/app/models/champs/dossier_link_champ.rb +++ b/app/models/champs/dossier_link_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 29b9be33a..92f52e3f1 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/email_champ.rb b/app/models/champs/email_champ.rb index 67bdd1ca4..c8a1949b0 100644 --- a/app/models/champs/email_champ.rb +++ b/app/models/champs/email_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/engagement_champ.rb b/app/models/champs/engagement_champ.rb index b6992749e..986623136 100644 --- a/app/models/champs/engagement_champ.rb +++ b/app/models/champs/engagement_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/explication_champ.rb b/app/models/champs/explication_champ.rb index 022149978..d20108393 100644 --- a/app/models/champs/explication_champ.rb +++ b/app/models/champs/explication_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index 983e60b04..0ff9c7659 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index feb3429dd..71ba23281 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/integer_number_champ.rb b/app/models/champs/integer_number_champ.rb index 68bf2e173..8272800e1 100644 --- a/app/models/champs/integer_number_champ.rb +++ b/app/models/champs/integer_number_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index 157f4af89..f7022d727 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 5a239151c..87429b0ee 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/number_champ.rb b/app/models/champs/number_champ.rb index e0186615c..fa2ec9b47 100644 --- a/app/models/champs/number_champ.rb +++ b/app/models/champs/number_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index bddc575ef..634391a31 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/phone_champ.rb b/app/models/champs/phone_champ.rb index da1166e6b..15002fe60 100644 --- a/app/models/champs/phone_champ.rb +++ b/app/models/champs/phone_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 862c57b67..245750c01 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/region_champ.rb b/app/models/champs/region_champ.rb index cf5e89075..255e4abb2 100644 --- a/app/models/champs/region_champ.rb +++ b/app/models/champs/region_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/repetition_champ.rb b/app/models/champs/repetition_champ.rb index 7e9ac54aa..b07fd0958 100644 --- a/app/models/champs/repetition_champ.rb +++ b/app/models/champs/repetition_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/siret_champ.rb b/app/models/champs/siret_champ.rb index 2e21f1ff3..b9b5b27b5 100644 --- a/app/models/champs/siret_champ.rb +++ b/app/models/champs/siret_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/text_champ.rb b/app/models/champs/text_champ.rb index 11fcb3939..1376cce48 100644 --- a/app/models/champs/text_champ.rb +++ b/app/models/champs/text_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/textarea_champ.rb b/app/models/champs/textarea_champ.rb index 89177feb2..028950a5f 100644 --- a/app/models/champs/textarea_champ.rb +++ b/app/models/champs/textarea_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/titre_identite_champ.rb b/app/models/champs/titre_identite_champ.rb index 289546476..982ae7ae7 100644 --- a/app/models/champs/titre_identite_champ.rb +++ b/app/models/champs/titre_identite_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/app/models/champs/yes_no_champ.rb b/app/models/champs/yes_no_champ.rb index ccbd46186..fc8346cfb 100644 --- a/app/models/champs/yes_no_champ.rb +++ b/app/models/champs/yes_no_champ.rb @@ -9,6 +9,7 @@ # row :integer # type :string # value :string +# value_json :jsonb # created_at :datetime # updated_at :datetime # dossier_id :integer diff --git a/db/migrate/20211005133027_add_value_json_column_to_champ.rb b/db/migrate/20211005133027_add_value_json_column_to_champ.rb new file mode 100644 index 000000000..92b9d7a6e --- /dev/null +++ b/db/migrate/20211005133027_add_value_json_column_to_champ.rb @@ -0,0 +1,5 @@ +class AddValueJSONColumnToChamp < ActiveRecord::Migration[6.1] + def change + add_column :champs, :value_json, :jsonb + end +end diff --git a/db/schema.rb b/db/schema.rb index 2d29640fd..cd272f562 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -189,6 +189,7 @@ ActiveRecord::Schema.define(version: 2021_10_06_164955) do t.jsonb "data" t.string "external_id" t.string "fetch_external_data_exceptions", array: true + t.jsonb "value_json" t.index ["dossier_id"], name: "index_champs_on_dossier_id" t.index ["parent_id"], name: "index_champs_on_parent_id" t.index ["private"], name: "index_champs_on_private"