diff --git a/db/migrate/20241015121145_add_not_null_reference.rb b/db/migrate/20241015121145_add_not_null_reference.rb new file mode 100644 index 0000000000..a68d8dea47 --- /dev/null +++ b/db/migrate/20241015121145_add_not_null_reference.rb @@ -0,0 +1,5 @@ +class AddNotNullReference < ActiveRecord::Migration[7.0] + def change + change_column_null :claims, :reference, false + end +end diff --git a/db/schema.rb b/db/schema.rb index 55d67f3a31..cc19519bba 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: 2024_10_15_093740) do +ActiveRecord::Schema[7.0].define(version: 2024_10_15_121145) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_trgm" @@ -56,7 +56,7 @@ t.string "bank_sort_code", limit: 6 t.string "bank_account_number", limit: 8 t.datetime "submitted_at", precision: nil - t.string "reference", limit: 8 + t.string "reference", limit: 8, null: false t.boolean "has_student_loan" t.integer "student_loan_country" t.integer "student_loan_courses" diff --git a/spec/factories/claims.rb b/spec/factories/claims.rb index f83470ca17..33189200c4 100644 --- a/spec/factories/claims.rb +++ b/spec/factories/claims.rb @@ -5,6 +5,7 @@ factory :claim do started_at { Time.zone.now } + reference { Reference.new.to_s } transient do policy { Policies::StudentLoans } diff --git a/spec/forms/journeys/additional_payments_for_teaching/nqt_in_academic_year_after_itt_form_spec.rb b/spec/forms/journeys/additional_payments_for_teaching/nqt_in_academic_year_after_itt_form_spec.rb index f85c899f95..bc7f8b57bc 100644 --- a/spec/forms/journeys/additional_payments_for_teaching/nqt_in_academic_year_after_itt_form_spec.rb +++ b/spec/forms/journeys/additional_payments_for_teaching/nqt_in_academic_year_after_itt_form_spec.rb @@ -133,7 +133,7 @@ logged_in_with_tid: true }.merge( attributes_for(:claim, :with_dqt_teacher_status) - .except(:started_at) + .except(:started_at, :reference) ) end