From d00567bf28e9d60d9bc8a73ba28f4c680a19c990 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Tue, 19 Sep 2023 13:42:25 +0100 Subject: [PATCH] Remove status from application form This removes the field (and related fields) from the application form model as they've been replaced by others and are no longer being used anywhere. --- app/models/application_form.rb | 14 ------ config/analytics.yml | 13 ----- ...55_remove_status_from_application_forms.rb | 49 +++++++++++++++++++ db/schema.rb | 16 +----- spec/factories/application_forms.rb | 14 ------ spec/models/application_form_spec.rb | 14 ------ 6 files changed, 50 insertions(+), 70 deletions(-) create mode 100644 db/migrate/20230919123755_remove_status_from_application_forms.rb diff --git a/app/models/application_form.rb b/app/models/application_form.rb index 5861b216f2..367332ce18 100644 --- a/app/models/application_form.rb +++ b/app/models/application_form.rb @@ -28,32 +28,19 @@ # needs_registration_number :boolean not null # needs_work_history :boolean not null # needs_written_statement :boolean not null -# overdue_further_information :boolean default(FALSE), not null -# overdue_professional_standing :boolean default(FALSE), not null -# overdue_qualification :boolean default(FALSE), not null -# overdue_reference :boolean default(FALSE), not null # personal_information_status :string default("not_started"), not null # qualifications_status :string default("not_started"), not null -# received_further_information :boolean default(FALSE), not null -# received_professional_standing :boolean default(FALSE), not null -# received_qualification :boolean default(FALSE), not null -# received_reference :boolean default(FALSE), not null # reduced_evidence_accepted :boolean default(FALSE), not null # reference :string(31) not null # registration_number :text # registration_number_status :string default("not_started"), not null # requires_preliminary_check :boolean default(FALSE), not null # stage :string default("draft"), not null -# status :string default("draft"), not null # statuses :string default(["\"draft\""]), not null, is an Array # subjects :text default([]), not null, is an Array # subjects_status :string default("not_started"), not null # submitted_at :datetime # teaching_authority_provides_written_statement :boolean default(FALSE), not null -# waiting_on_further_information :boolean default(FALSE), not null -# waiting_on_professional_standing :boolean default(FALSE), not null -# waiting_on_qualification :boolean default(FALSE), not null -# waiting_on_reference :boolean default(FALSE), not null # withdrawn_at :datetime # work_history_status :string default("not_started"), not null # working_days_since_submission :integer @@ -79,7 +66,6 @@ # index_application_forms_on_region_id (region_id) # index_application_forms_on_reviewer_id (reviewer_id) # index_application_forms_on_stage (stage) -# index_application_forms_on_status (status) # index_application_forms_on_teacher_id (teacher_id) # # Foreign Keys diff --git a/config/analytics.yml b/config/analytics.yml index 07e9a844e8..cc45f42b49 100644 --- a/config/analytics.yml +++ b/config/analytics.yml @@ -51,16 +51,8 @@ - needs_registration_number - needs_work_history - needs_written_statement - - overdue_further_information - - overdue_professional_standing - - overdue_qualification - - overdue_reference - personal_information_status - qualifications_status - - received_further_information - - received_professional_standing - - received_qualification - - received_reference - reduced_evidence_accepted - reference - region_id @@ -69,7 +61,6 @@ - requires_preliminary_check - reviewer_id - stage - - status - statuses - subjects - subjects_status @@ -77,10 +68,6 @@ - teacher_id - teaching_authority_provides_written_statement - updated_at - - waiting_on_further_information - - waiting_on_professional_standing - - waiting_on_qualification - - waiting_on_reference - withdrawn_at - work_history_status - working_days_since_submission diff --git a/db/migrate/20230919123755_remove_status_from_application_forms.rb b/db/migrate/20230919123755_remove_status_from_application_forms.rb new file mode 100644 index 0000000000..96f59e20c6 --- /dev/null +++ b/db/migrate/20230919123755_remove_status_from_application_forms.rb @@ -0,0 +1,49 @@ +class RemoveStatusFromApplicationForms < ActiveRecord::Migration[7.0] + def change + change_table :application_forms, bulk: true do |t| + t.remove :status, type: :string, null: false, default: "draft" + t.remove :overdue_further_information, + type: :boolean, + default: false, + null: false + t.remove :overdue_professional_standing, + type: :boolean, + default: false, + null: false + t.remove :overdue_qualification, + type: :boolean, + default: false, + null: false + t.remove :overdue_reference, type: :boolean, default: false, null: false + t.remove :received_further_information, + type: :boolean, + default: false, + null: false + t.remove :received_professional_standing, + type: :boolean, + default: false, + null: false + t.remove :received_qualification, + type: :boolean, + default: false, + null: false + t.remove :received_reference, type: :boolean, default: false, null: false + t.remove :waiting_on_further_information, + type: :boolean, + default: false, + null: false + t.remove :waiting_on_professional_standing, + type: :boolean, + default: false, + null: false + t.remove :waiting_on_qualification, + type: :boolean, + default: false, + null: false + t.remove :waiting_on_reference, + type: :boolean, + default: false, + null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1fe8ddfc16..9ce83a0efe 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_14_104107) do +ActiveRecord::Schema[7.0].define(version: 2023_09_19_123755) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -62,7 +62,6 @@ t.text "subjects", default: [], null: false, array: true t.bigint "assessor_id" t.bigint "reviewer_id" - t.string "status", default: "draft", null: false t.datetime "submitted_at" t.boolean "needs_work_history", null: false t.boolean "needs_written_statement", null: false @@ -89,20 +88,8 @@ t.boolean "written_statement_confirmation", default: false, null: false t.boolean "english_language_provider_other", default: false, null: false t.datetime "declined_at" - t.boolean "waiting_on_professional_standing", default: false, null: false - t.boolean "received_professional_standing", default: false, null: false - t.boolean "waiting_on_further_information", default: false, null: false - t.boolean "received_further_information", default: false, null: false - t.boolean "waiting_on_reference", default: false, null: false - t.boolean "received_reference", default: false, null: false - t.boolean "waiting_on_qualification", default: false, null: false - t.boolean "received_qualification", default: false, null: false t.boolean "written_statement_optional", default: false, null: false t.boolean "requires_preliminary_check", default: false, null: false - t.boolean "overdue_further_information", default: false, null: false - t.boolean "overdue_professional_standing", default: false, null: false - t.boolean "overdue_qualification", default: false, null: false - t.boolean "overdue_reference", default: false, null: false t.jsonb "dqt_match", default: {} t.datetime "withdrawn_at" t.string "action_required_by", default: "none", null: false @@ -117,7 +104,6 @@ t.index ["region_id"], name: "index_application_forms_on_region_id" t.index ["reviewer_id"], name: "index_application_forms_on_reviewer_id" t.index ["stage"], name: "index_application_forms_on_stage" - t.index ["status"], name: "index_application_forms_on_status" t.index ["teacher_id"], name: "index_application_forms_on_teacher_id" end diff --git a/spec/factories/application_forms.rb b/spec/factories/application_forms.rb index 952e851dc5..0bd19760b9 100644 --- a/spec/factories/application_forms.rb +++ b/spec/factories/application_forms.rb @@ -28,32 +28,19 @@ # needs_registration_number :boolean not null # needs_work_history :boolean not null # needs_written_statement :boolean not null -# overdue_further_information :boolean default(FALSE), not null -# overdue_professional_standing :boolean default(FALSE), not null -# overdue_qualification :boolean default(FALSE), not null -# overdue_reference :boolean default(FALSE), not null # personal_information_status :string default("not_started"), not null # qualifications_status :string default("not_started"), not null -# received_further_information :boolean default(FALSE), not null -# received_professional_standing :boolean default(FALSE), not null -# received_qualification :boolean default(FALSE), not null -# received_reference :boolean default(FALSE), not null # reduced_evidence_accepted :boolean default(FALSE), not null # reference :string(31) not null # registration_number :text # registration_number_status :string default("not_started"), not null # requires_preliminary_check :boolean default(FALSE), not null # stage :string default("draft"), not null -# status :string default("draft"), not null # statuses :string default(["\"draft\""]), not null, is an Array # subjects :text default([]), not null, is an Array # subjects_status :string default("not_started"), not null # submitted_at :datetime # teaching_authority_provides_written_statement :boolean default(FALSE), not null -# waiting_on_further_information :boolean default(FALSE), not null -# waiting_on_professional_standing :boolean default(FALSE), not null -# waiting_on_qualification :boolean default(FALSE), not null -# waiting_on_reference :boolean default(FALSE), not null # withdrawn_at :datetime # work_history_status :string default("not_started"), not null # working_days_since_submission :integer @@ -79,7 +66,6 @@ # index_application_forms_on_region_id (region_id) # index_application_forms_on_reviewer_id (reviewer_id) # index_application_forms_on_stage (stage) -# index_application_forms_on_status (status) # index_application_forms_on_teacher_id (teacher_id) # # Foreign Keys diff --git a/spec/models/application_form_spec.rb b/spec/models/application_form_spec.rb index 8fd6e06bed..b5485ea948 100644 --- a/spec/models/application_form_spec.rb +++ b/spec/models/application_form_spec.rb @@ -28,32 +28,19 @@ # needs_registration_number :boolean not null # needs_work_history :boolean not null # needs_written_statement :boolean not null -# overdue_further_information :boolean default(FALSE), not null -# overdue_professional_standing :boolean default(FALSE), not null -# overdue_qualification :boolean default(FALSE), not null -# overdue_reference :boolean default(FALSE), not null # personal_information_status :string default("not_started"), not null # qualifications_status :string default("not_started"), not null -# received_further_information :boolean default(FALSE), not null -# received_professional_standing :boolean default(FALSE), not null -# received_qualification :boolean default(FALSE), not null -# received_reference :boolean default(FALSE), not null # reduced_evidence_accepted :boolean default(FALSE), not null # reference :string(31) not null # registration_number :text # registration_number_status :string default("not_started"), not null # requires_preliminary_check :boolean default(FALSE), not null # stage :string default("draft"), not null -# status :string default("draft"), not null # statuses :string default(["\"draft\""]), not null, is an Array # subjects :text default([]), not null, is an Array # subjects_status :string default("not_started"), not null # submitted_at :datetime # teaching_authority_provides_written_statement :boolean default(FALSE), not null -# waiting_on_further_information :boolean default(FALSE), not null -# waiting_on_professional_standing :boolean default(FALSE), not null -# waiting_on_qualification :boolean default(FALSE), not null -# waiting_on_reference :boolean default(FALSE), not null # withdrawn_at :datetime # work_history_status :string default("not_started"), not null # working_days_since_submission :integer @@ -79,7 +66,6 @@ # index_application_forms_on_region_id (region_id) # index_application_forms_on_reviewer_id (reviewer_id) # index_application_forms_on_stage (stage) -# index_application_forms_on_status (status) # index_application_forms_on_teacher_id (teacher_id) # # Foreign Keys