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

Relax backfill requirements so it works with unique columns #288

Merged
merged 8 commits into from
Feb 27, 2024

Conversation

exekias
Copy link
Member

@exekias exekias commented Feb 27, 2024

UNIQUE NOT NULL columns should also work in order to perform backfills. This change relaxes the check on backfill requirements to use those columns if a primary key is not available.

Validation will still error out if no suitable column is found

Note: this also fixes the unique retrieval from schema, where we were failing to understand composed unique indices, resulting in columns flagged as unique where they weren't really unique.

UNIQUE NOT NULL columns should also work in order to perform backfills.
This change relaxes the check on backfill requirements to use those
columns if a primary key is not available.

Validation will still error out if no suitable column is found
pkg/migrations/errors.go Outdated Show resolved Hide resolved
pkg/migrations/errors.go Outdated Show resolved Hide resolved
pkg/migrations/backfill.go Outdated Show resolved Hide resolved
pkg/migrations/backfill.go Outdated Show resolved Hide resolved
pkg/migrations/op_add_column_test.go Outdated Show resolved Hide resolved
@exekias exekias enabled auto-merge (squash) February 27, 2024 12:53
@exekias exekias merged commit 937f65c into main Feb 27, 2024
42 checks passed
@exekias exekias deleted the relax-backfill branch February 27, 2024 15:16
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