Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset column information for Claim on a migration #3369

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

kenfodder
Copy link
Contributor

A previous migration removing teacher_reference_number causes issues for this migration.

Without this I get this when running db:migrate from an blank db.

== 20241028110426 BackFillClaimsVerifiedAt: migrating =========================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)

PG::UndefinedColumn: ERROR:  column claims.teacher_reference_number does not exist
LINE 1: ...ode" AS t1_r7, "claims"."date_of_birth" AS t1_r8, "claims"."...
                                                             ^
/Users/ken/code/dfe/claim-additional-payments-for-teaching/db/migrate/20241028110426_back_fill_claims_verified_at.rb:4:in `change'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
-e:1:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column claims.teacher_reference_number does not exist (ActiveRecord::StatementInvalid)
LINE 1: ...ode" AS t1_r7, "claims"."date_of_birth" AS t1_r8, "claims"."...
                                                             ^
/Users/ken/code/dfe/claim-additional-payments-for-teaching/db/migrate/20241028110426_back_fill_claims_verified_at.rb:4:in `change'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
-e:1:in `<main>'

Caused by:
PG::UndefinedColumn: ERROR:  column claims.teacher_reference_number does not exist (PG::UndefinedColumn)
LINE 1: ...ode" AS t1_r7, "claims"."date_of_birth" AS t1_r8, "claims"."...
                                                             ^
/Users/ken/code/dfe/claim-additional-payments-for-teaching/db/migrate/20241028110426_back_fill_claims_verified_at.rb:4:in `change'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
<internal:/Users/ken/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
-e:1:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

@kenfodder kenfodder marked this pull request as ready for review November 5, 2024 15:53
A previous migration removing teacher_reference_number causes issues for this migration.
@kenfodder kenfodder force-pushed the fix-migration-column-reset branch from 824a23f to ebcb5a0 Compare November 7, 2024 16:07
@kenfodder kenfodder merged commit 1e82f1e into master Nov 7, 2024
14 checks passed
@kenfodder kenfodder deleted the fix-migration-column-reset branch November 7, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants