From 83855cf23fdddae66e1f383e376788204140c9bd Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Mon, 4 Sep 2023 18:10:26 +0100 Subject: [PATCH] Remove teaching authority fields from countries We're going to keep them only on regions to simplify the support console. --- app/models/country.rb | 28 +++++++----------- config/analytics.yml | 6 ---- ...emove_teaching_authority_from_countries.rb | 29 +++++++++++++++++++ db/schema.rb | 8 +---- spec/factories/countries.rb | 28 +++++++----------- spec/models/country_spec.rb | 28 +++++++----------- 6 files changed, 63 insertions(+), 64 deletions(-) create mode 100644 db/migrate/20230904170502_remove_teaching_authority_from_countries.rb diff --git a/app/models/country.rb b/app/models/country.rb index be02aace6f..deb3533b57 100644 --- a/app/models/country.rb +++ b/app/models/country.rb @@ -2,23 +2,17 @@ # # Table name: countries # -# id :bigint not null, primary key -# code :string not null -# eligibility_enabled :boolean default(TRUE), not null -# eligibility_skip_questions :boolean default(FALSE), not null -# other_information :text default(""), not null -# qualifications_information :text default(""), not null -# requires_preliminary_check :boolean default(FALSE), not null -# sanction_information :string default(""), not null -# status_information :string default(""), not null -# teaching_authority_address :text default(""), not null -# teaching_authority_certificate :text default(""), not null -# teaching_authority_emails :text default([]), not null, is an Array -# teaching_authority_name :text default(""), not null -# teaching_authority_online_checker_url :string default(""), not null -# teaching_authority_websites :text default([]), not null, is an Array -# created_at :datetime not null -# updated_at :datetime not null +# id :bigint not null, primary key +# code :string not null +# eligibility_enabled :boolean default(TRUE), not null +# eligibility_skip_questions :boolean default(FALSE), not null +# other_information :text default(""), not null +# qualifications_information :text default(""), not null +# requires_preliminary_check :boolean default(FALSE), not null +# sanction_information :string default(""), not null +# status_information :string default(""), not null +# created_at :datetime not null +# updated_at :datetime not null # # Indexes # diff --git a/config/analytics.yml b/config/analytics.yml index 46ce591407..5a4913366a 100644 --- a/config/analytics.yml +++ b/config/analytics.yml @@ -126,12 +126,6 @@ - requires_preliminary_check - sanction_information - status_information - - teaching_authority_address - - teaching_authority_certificate - - teaching_authority_emails - - teaching_authority_name - - teaching_authority_online_checker_url - - teaching_authority_websites - updated_at :documents: - available diff --git a/db/migrate/20230904170502_remove_teaching_authority_from_countries.rb b/db/migrate/20230904170502_remove_teaching_authority_from_countries.rb new file mode 100644 index 0000000000..9f71e6e27a --- /dev/null +++ b/db/migrate/20230904170502_remove_teaching_authority_from_countries.rb @@ -0,0 +1,29 @@ +class RemoveTeachingAuthorityFromCountries < ActiveRecord::Migration[7.0] + def change + change_table :countries, bulk: true do |t| + t.remove :teaching_authority_address, + type: :text, + default: "", + null: false + t.remove :teaching_authority_certificate, + type: :text, + default: "", + null: false + t.remove :teaching_authority_emails, + type: :text, + default: [], + null: false, + array: true + t.remove :teaching_authority_name, type: :text, default: "", null: false + t.remove :teaching_authority_online_checker_url, + type: :string, + default: "", + null: false + t.remove :teaching_authority_websites, + type: :text, + default: [], + null: false, + array: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 52a8993280..c497d62a7f 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[7.0].define(version: 2023_09_04_131351) do +ActiveRecord::Schema[7.0].define(version: 2023_09_04_170502) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -156,13 +156,7 @@ t.string "code", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.text "teaching_authority_address", default: "", null: false - t.text "teaching_authority_emails", default: [], null: false, array: true - t.text "teaching_authority_websites", default: [], null: false, array: true - t.text "teaching_authority_certificate", default: "", null: false t.text "other_information", default: "", null: false - t.text "teaching_authority_name", default: "", null: false - t.string "teaching_authority_online_checker_url", default: "", null: false t.string "status_information", default: "", null: false t.string "sanction_information", default: "", null: false t.boolean "eligibility_enabled", default: true, null: false diff --git a/spec/factories/countries.rb b/spec/factories/countries.rb index 6ac635f2d3..3eb49d5b65 100644 --- a/spec/factories/countries.rb +++ b/spec/factories/countries.rb @@ -2,23 +2,17 @@ # # Table name: countries # -# id :bigint not null, primary key -# code :string not null -# eligibility_enabled :boolean default(TRUE), not null -# eligibility_skip_questions :boolean default(FALSE), not null -# other_information :text default(""), not null -# qualifications_information :text default(""), not null -# requires_preliminary_check :boolean default(FALSE), not null -# sanction_information :string default(""), not null -# status_information :string default(""), not null -# teaching_authority_address :text default(""), not null -# teaching_authority_certificate :text default(""), not null -# teaching_authority_emails :text default([]), not null, is an Array -# teaching_authority_name :text default(""), not null -# teaching_authority_online_checker_url :string default(""), not null -# teaching_authority_websites :text default([]), not null, is an Array -# created_at :datetime not null -# updated_at :datetime not null +# id :bigint not null, primary key +# code :string not null +# eligibility_enabled :boolean default(TRUE), not null +# eligibility_skip_questions :boolean default(FALSE), not null +# other_information :text default(""), not null +# qualifications_information :text default(""), not null +# requires_preliminary_check :boolean default(FALSE), not null +# sanction_information :string default(""), not null +# status_information :string default(""), not null +# created_at :datetime not null +# updated_at :datetime not null # # Indexes # diff --git a/spec/models/country_spec.rb b/spec/models/country_spec.rb index 0090534a6a..f6495f32cc 100644 --- a/spec/models/country_spec.rb +++ b/spec/models/country_spec.rb @@ -2,23 +2,17 @@ # # Table name: countries # -# id :bigint not null, primary key -# code :string not null -# eligibility_enabled :boolean default(TRUE), not null -# eligibility_skip_questions :boolean default(FALSE), not null -# other_information :text default(""), not null -# qualifications_information :text default(""), not null -# requires_preliminary_check :boolean default(FALSE), not null -# sanction_information :string default(""), not null -# status_information :string default(""), not null -# teaching_authority_address :text default(""), not null -# teaching_authority_certificate :text default(""), not null -# teaching_authority_emails :text default([]), not null, is an Array -# teaching_authority_name :text default(""), not null -# teaching_authority_online_checker_url :string default(""), not null -# teaching_authority_websites :text default([]), not null, is an Array -# created_at :datetime not null -# updated_at :datetime not null +# id :bigint not null, primary key +# code :string not null +# eligibility_enabled :boolean default(TRUE), not null +# eligibility_skip_questions :boolean default(FALSE), not null +# other_information :text default(""), not null +# qualifications_information :text default(""), not null +# requires_preliminary_check :boolean default(FALSE), not null +# sanction_information :string default(""), not null +# status_information :string default(""), not null +# created_at :datetime not null +# updated_at :datetime not null # # Indexes #