-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testcase to ensure new columns can't be used as the the identity …
…column in a backfill. (#298) Add a test to ensure that new columns can't be used as the identity for a backfill, even if they satisfy the conditions for an identity column. A newly added `NOT NULL` and `UNIQUE` column could in theory be used as the identity column for a backfill. However, it shouldn't be used as the identity column fora backfill because it's a newly added column whose temporary column will be full of NULLs for any existing rows in the table. Currently the column won't be selected as an identity for backfills because the nullability and uniqueness for new column are not populated when adding it to the virtual schema in the add_column operation: https://github.com/xataio/pgroll/blob/c08ef7065cdbce965110e64f58e66eddf605eaee/pkg/migrations/op_add_column.go#L61-L63 Following on from the discussion here: #289 (comment)
- Loading branch information
1 parent
52fb532
commit 431b951
Showing
1 changed file
with
121 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters