xataio / pgroll

PostgreSQL zero-downtime migrations made easy
https://www.xata.io
Apache License 2.0
3.56k stars 67 forks source link

Relax backfill requirements so it works with unique columns #288

Closed exekias closed 8 months ago

exekias commented 8 months ago

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.