diff --git a/app/models/champ.rb b/app/models/champ.rb index f3f29dbf2..0570ea92f 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/address_champ.rb b/app/models/champs/address_champ.rb index 8a7a0a2e3..2733a6c80 100644 --- a/app/models/champs/address_champ.rb +++ b/app/models/champs/address_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/carte_champ.rb b/app/models/champs/carte_champ.rb index 702c0eab7..e491846d0 100644 --- a/app/models/champs/carte_champ.rb +++ b/app/models/champs/carte_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index ac2c4937b..df61e54b8 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/civilite_champ.rb b/app/models/champs/civilite_champ.rb index 85697e049..09126ce83 100644 --- a/app/models/champs/civilite_champ.rb +++ b/app/models/champs/civilite_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/commune_champ.rb b/app/models/champs/commune_champ.rb index 1b8c82c19..202fc11e6 100644 --- a/app/models/champs/commune_champ.rb +++ b/app/models/champs/commune_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/date_champ.rb b/app/models/champs/date_champ.rb index f13b174c6..c05be547c 100644 --- a/app/models/champs/date_champ.rb +++ b/app/models/champs/date_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/datetime_champ.rb b/app/models/champs/datetime_champ.rb index ab3f58249..b321b4663 100644 --- a/app/models/champs/datetime_champ.rb +++ b/app/models/champs/datetime_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/decimal_number_champ.rb b/app/models/champs/decimal_number_champ.rb index 6041c6b7e..315cbdf07 100644 --- a/app/models/champs/decimal_number_champ.rb +++ b/app/models/champs/decimal_number_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/departement_champ.rb b/app/models/champs/departement_champ.rb index ed4035b9a..a0277da11 100644 --- a/app/models/champs/departement_champ.rb +++ b/app/models/champs/departement_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/dossier_link_champ.rb b/app/models/champs/dossier_link_champ.rb index ba8e30cfa..492c1b5f5 100644 --- a/app/models/champs/dossier_link_champ.rb +++ b/app/models/champs/dossier_link_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 2456699e9..3ad1f28ee 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/email_champ.rb b/app/models/champs/email_champ.rb index d33910cbc..434460ea1 100644 --- a/app/models/champs/email_champ.rb +++ b/app/models/champs/email_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/engagement_champ.rb b/app/models/champs/engagement_champ.rb index 94bab2c81..61f8635de 100644 --- a/app/models/champs/engagement_champ.rb +++ b/app/models/champs/engagement_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/explication_champ.rb b/app/models/champs/explication_champ.rb index 86da7d5e9..cf9770b32 100644 --- a/app/models/champs/explication_champ.rb +++ b/app/models/champs/explication_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index 642f3bc8e..f6952e9e6 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index dcb6cd5db..941c1ff7f 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/integer_number_champ.rb b/app/models/champs/integer_number_champ.rb index 798983ef8..d21b3877c 100644 --- a/app/models/champs/integer_number_champ.rb +++ b/app/models/champs/integer_number_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index b325d83a8..7310cbaff 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 25225a3ff..11b0d5a40 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/number_champ.rb b/app/models/champs/number_champ.rb index b24d73257..01bf34146 100644 --- a/app/models/champs/number_champ.rb +++ b/app/models/champs/number_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index d158aa6a9..a1c6e6a45 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/phone_champ.rb b/app/models/champs/phone_champ.rb index bbcc7691f..6503eb1b3 100644 --- a/app/models/champs/phone_champ.rb +++ b/app/models/champs/phone_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 59886ef43..5437a78a8 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/region_champ.rb b/app/models/champs/region_champ.rb index 3127ee762..08c1cd9b2 100644 --- a/app/models/champs/region_champ.rb +++ b/app/models/champs/region_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/repetition_champ.rb b/app/models/champs/repetition_champ.rb index 3d53a48ad..6861ffa67 100644 --- a/app/models/champs/repetition_champ.rb +++ b/app/models/champs/repetition_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/siret_champ.rb b/app/models/champs/siret_champ.rb index 1b0e93734..5e6624feb 100644 --- a/app/models/champs/siret_champ.rb +++ b/app/models/champs/siret_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/text_champ.rb b/app/models/champs/text_champ.rb index ab1a9c12a..e8fd31aa2 100644 --- a/app/models/champs/text_champ.rb +++ b/app/models/champs/text_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/textarea_champ.rb b/app/models/champs/textarea_champ.rb index 238852da6..c789bc07d 100644 --- a/app/models/champs/textarea_champ.rb +++ b/app/models/champs/textarea_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/titre_identite_champ.rb b/app/models/champs/titre_identite_champ.rb index 4f29e0186..c7b3e312e 100644 --- a/app/models/champs/titre_identite_champ.rb +++ b/app/models/champs/titre_identite_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/app/models/champs/yes_no_champ.rb b/app/models/champs/yes_no_champ.rb index 74a963d7f..54596dba9 100644 --- a/app/models/champs/yes_no_champ.rb +++ b/app/models/champs/yes_no_champ.rb @@ -3,6 +3,7 @@ # Table name: champs # # id :integer not null, primary key +# data :jsonb # private :boolean default(FALSE), not null # row :integer # type :string diff --git a/db/migrate/20210113150013_add_data_to_champs.rb b/db/migrate/20210113150013_add_data_to_champs.rb new file mode 100644 index 000000000..784cb8cc0 --- /dev/null +++ b/db/migrate/20210113150013_add_data_to_champs.rb @@ -0,0 +1,5 @@ +class AddDataToChamps < ActiveRecord::Migration[6.0] + def change + add_column :champs, :data, :jsonb + end +end diff --git a/db/schema.rb b/db/schema.rb index 398f529b7..947177bbb 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: 2020_11_17_122923) do +ActiveRecord::Schema.define(version: 2021_01_13_150013) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -143,6 +143,7 @@ ActiveRecord::Schema.define(version: 2020_11_17_122923) do t.integer "etablissement_id" t.bigint "parent_id" t.integer "row" + t.jsonb "data" 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"