hasura / hasura/graphql-engine
hasura migrate create --from-server loses manual SQL migrations which breaks enum tables
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
If you use that approach to squash migrations, you lose any manual `INSERT INTO` SQL migrations that you've run.
The main problem with this is that if you have any enum tables, they new migrations will break since enum tables must have at least one row.
At a minimum, this should be noted in the docs (happy to put in some copy if you want) but ideally the `--from-server` option should have an option to include manual SQL insertion migrations or a big flashing warning when you try to run it on a DB with enum tables.
This is on GQL Engine 1.1 but has been an issue since enum tables were released.
Contributor guide
Research direction
Start with the `hasura migrate create --from-server` entry point and review how server-generated migrations relate to manual `INSERT INTO` migrations. Confirm the enum-table failure case described in the issue, then determine whether the documented result should be a warning or whether the command needs an option to include manual SQL migrations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres
- Domain
- cli, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100