Graphql-engine: Generate a default down.sql for functions OR ignore missing down migrations while squashing

Created on 25 May 2020  路  2Comments  路  Source: hasura/graphql-engine

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

cli bug

Most helpful comment

@IljaDaderko A comment like you mentioned is being added in https://github.com/hasura/graphql-engine/pull/4790

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anisjonischkeit picture anisjonischkeit  路  3Comments

stereobooster picture stereobooster  路  3Comments

jjangga0214 picture jjangga0214  路  3Comments

sachaarbonel picture sachaarbonel  路  3Comments

hooopo picture hooopo  路  3Comments