diff --git a/app/models/further_information_request.rb b/app/models/further_information_request.rb index 5314294dc4..28ddce1446 100644 --- a/app/models/further_information_request.rb +++ b/app/models/further_information_request.rb @@ -9,7 +9,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # working_days_assessment_started_to_creation :integer # working_days_received_to_recommendation :integer # working_days_since_received :integer diff --git a/app/models/professional_standing_request.rb b/app/models/professional_standing_request.rb index cb9cb36574..459d64b5ca 100644 --- a/app/models/professional_standing_request.rb +++ b/app/models/professional_standing_request.rb @@ -13,7 +13,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/app/models/qualification_request.rb b/app/models/qualification_request.rb index 93fa62f6f8..e88088215e 100644 --- a/app/models/qualification_request.rb +++ b/app/models/qualification_request.rb @@ -12,7 +12,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/app/models/reference_request.rb b/app/models/reference_request.rb index 6360d57e6b..086c99aaac 100644 --- a/app/models/reference_request.rb +++ b/app/models/reference_request.rb @@ -31,7 +31,7 @@ # satisfied_comment :text default(""), not null # satisfied_response :boolean # slug :string not null -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/db/migrate/20230926142509_change_requestables_state_default.rb b/db/migrate/20230926142509_change_requestables_state_default.rb new file mode 100644 index 0000000000..debbae41b8 --- /dev/null +++ b/db/migrate/20230926142509_change_requestables_state_default.rb @@ -0,0 +1,20 @@ +class ChangeRequestablesStateDefault < ActiveRecord::Migration[7.0] + def change + change_column_default :further_information_requests, + :state, + from: nil, + to: "requested" + change_column_default :professional_standing_requests, + :state, + from: nil, + to: "requested" + change_column_default :qualification_requests, + :state, + from: nil, + to: "requested" + change_column_default :reference_requests, + :state, + from: nil, + to: "requested" + end +end diff --git a/db/schema.rb b/db/schema.rb index 3f90cc5be1..1570281ca5 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_26_101325) do +ActiveRecord::Schema[7.0].define(version: 2023_09_26_142509) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -246,7 +246,7 @@ create_table "further_information_requests", force: :cascade do |t| t.bigint "assessment_id", null: false - t.string "state", null: false + t.string "state", default: "requested", null: false t.datetime "received_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -273,7 +273,7 @@ create_table "professional_standing_requests", force: :cascade do |t| t.bigint "assessment_id", null: false - t.string "state", null: false + t.string "state", default: "requested", null: false t.datetime "received_at" t.text "location_note", default: "", null: false t.datetime "created_at", null: false @@ -290,7 +290,7 @@ create_table "qualification_requests", force: :cascade do |t| t.bigint "assessment_id", null: false t.bigint "qualification_id", null: false - t.string "state", null: false + t.string "state", default: "requested", null: false t.datetime "received_at" t.text "location_note", default: "", null: false t.datetime "created_at", null: false @@ -322,7 +322,7 @@ t.string "slug", null: false t.bigint "assessment_id", null: false t.bigint "work_history_id", null: false - t.string "state", null: false + t.string "state", default: "requested", null: false t.datetime "received_at" t.boolean "dates_response" t.boolean "hours_response" diff --git a/spec/factories/further_information_requests.rb b/spec/factories/further_information_requests.rb index 4fe84ea880..dbe706f02a 100644 --- a/spec/factories/further_information_requests.rb +++ b/spec/factories/further_information_requests.rb @@ -11,7 +11,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # working_days_assessment_started_to_creation :integer # working_days_received_to_recommendation :integer # working_days_since_received :integer diff --git a/spec/factories/professional_standing_requests.rb b/spec/factories/professional_standing_requests.rb index 16acf1a0a0..654cd39d31 100644 --- a/spec/factories/professional_standing_requests.rb +++ b/spec/factories/professional_standing_requests.rb @@ -13,7 +13,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/spec/factories/qualification_requests.rb b/spec/factories/qualification_requests.rb index 609a799af8..cd3f552fff 100644 --- a/spec/factories/qualification_requests.rb +++ b/spec/factories/qualification_requests.rb @@ -12,7 +12,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/spec/factories/reference_requests.rb b/spec/factories/reference_requests.rb index 45577e3b2a..c2ccb6d5d0 100644 --- a/spec/factories/reference_requests.rb +++ b/spec/factories/reference_requests.rb @@ -31,7 +31,7 @@ # satisfied_comment :text default(""), not null # satisfied_response :boolean # slug :string not null -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/spec/models/further_information_request_spec.rb b/spec/models/further_information_request_spec.rb index 24d9e42aba..df05a4062e 100644 --- a/spec/models/further_information_request_spec.rb +++ b/spec/models/further_information_request_spec.rb @@ -11,7 +11,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # working_days_assessment_started_to_creation :integer # working_days_received_to_recommendation :integer # working_days_since_received :integer diff --git a/spec/models/professional_standing_request_spec.rb b/spec/models/professional_standing_request_spec.rb index e2555aaeef..566a321820 100644 --- a/spec/models/professional_standing_request_spec.rb +++ b/spec/models/professional_standing_request_spec.rb @@ -13,7 +13,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/spec/models/qualification_request_spec.rb b/spec/models/qualification_request_spec.rb index 63ab0fc5a6..ee9de4621f 100644 --- a/spec/models/qualification_request_spec.rb +++ b/spec/models/qualification_request_spec.rb @@ -12,7 +12,7 @@ # received_at :datetime # requested_at :datetime # reviewed_at :datetime -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null diff --git a/spec/models/reference_request_spec.rb b/spec/models/reference_request_spec.rb index aefa2db4a9..5d2c602817 100644 --- a/spec/models/reference_request_spec.rb +++ b/spec/models/reference_request_spec.rb @@ -31,7 +31,7 @@ # satisfied_comment :text default(""), not null # satisfied_response :boolean # slug :string not null -# state :string not null +# state :string default("requested"), not null # created_at :datetime not null # updated_at :datetime not null # assessment_id :bigint not null