From 16f3548ab963ff71481050aaf4f4759e11842b31 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Mon, 28 Oct 2024 11:08:40 +0000 Subject: [PATCH] Back fill verified_at on verified claims --- db/migrate/20241028110426_back_fill_claims_verified_at.rb | 8 ++++++++ db/schema.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20241028110426_back_fill_claims_verified_at.rb diff --git a/db/migrate/20241028110426_back_fill_claims_verified_at.rb b/db/migrate/20241028110426_back_fill_claims_verified_at.rb new file mode 100644 index 0000000000..14449ebad2 --- /dev/null +++ b/db/migrate/20241028110426_back_fill_claims_verified_at.rb @@ -0,0 +1,8 @@ +class BackFillClaimsVerifiedAt < ActiveRecord::Migration[7.0] + def change + Policies::FurtherEducationPayments::Eligibility + .includes(:claim).where.not(verification: {}).find_each do |eligibility| + eligibility.claim.update!(verified_at: eligibility.verification["created_at"]) + end + end +end diff --git a/db/schema.rb b/db/schema.rb index c04e0342a3..cc306daf4d 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_28_095040) do +ActiveRecord::Schema[7.0].define(version: 2024_10_28_110426) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_trgm"