xataio / pgroll

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

Validate a migration file #370

Open divyenduz opened 1 month ago

divyenduz commented 1 month ago

Frontend uses the JSON schema to validate pgroll JSON migrations, however, columns like default should be an SQL expression can only be represented as String in the JSON schema. This makes validating them hard. Maybe pgroll can provide a validate command/API that can be used to see if a JSON migration is correct or not? Frontend can use this to validate before starting the migration and pgroll CLI users too can benefit from it.

As a CLI command, this can be something like: pgroll validate <migrationfile>

divyenduz commented 1 month ago

Related https://github.com/xataio/pgroll/issues/169