While squashing the CLI throws an error for missing down.sql migrations:
hasura cli is up to date version=1.2.1
WARN This command is currently experimental and hence in preview, correctness of squashed migration is not guaranteed!
FATA[0001] unable to squash migrations: 1590357112407 down migration not found
Could we ignore this? Maybe just put in a placeholder like:
-- squashed/down.sql
...
-- This is a placeholder for 1590357112407
-- This is a placeholder for 1590357112406
DROP TABLE ...
OR it might be a good idea to add comments to the squashed migration files by default:
-- 1590357112407_add_function
CREATE OR REPLACE FUNCTION ...
-- 1590357112408
CREATE OR REPLACE FUNCTION ...
I think most people who care about this will edit/clean the files anyway before committing/creating a PR
I think in general down migrations should be ignored or populated with a comment of some sort, if there is no actual down migration. This is also an issue at the moment for enum table workflows (we need to manually add data to enum tables and track that as a migration, no down migration is created). Since there are no down migrations, hasura migrations squash command fails.
@IljaDaderko A comment like you mentioned is being added in https://github.com/hasura/graphql-engine/pull/4790
Most helpful comment
@IljaDaderko A comment like you mentioned is being added in https://github.com/hasura/graphql-engine/pull/4790