hasura/graphql-engine

Add a `migration_mode` flag to the `console` CLI options

開放

#2,290 建立於 2019年5月28日

 (12 則留言) (1 個反應) (1 位負責人)TypeScript (2,787 個分叉)batch import
c/cligood first issuek/enhancementp/mediums/wip

倉庫指標

星標
 (31,371 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

When using the cli console to modify your metadata, you can turn off migration_mode with a little toggle switch. This is great for when you are managing your own schema and don't want hasura to touch anything except its own metadata.

The trouble is that this little toggle is stateful, so if you're running out of docker, you have to remember to flip that switch each time you spin up a container.

It'd be great to just have a flag you can pass:

hasura console --migration-mode false

or

hasura console --no-migrations

The work around at the moment is to either:

  • use curl (or similar) to mimic the API call that does this:
curl -H 'Content-Type: application/json' -X PUT -d '{"name": "migration_mode", "value": "false"}' http://0.0.0.0:9693/apis/migrate/settings
  • execute some SQL when you spin up your postgres container:
CREATE TABLE IF NOT EXISTS hdb_catalog.migration_settings (setting text not null primary key, value text not null);

INSERT INTO hdb_catalog.migration_settings (setting, value) VALUES ('migration_mode', 'false') ON CONFLICT ON CONSTRAINT migration_settings_pkey 

DO NOTHING;

(Thank you to the awesome support team, and especially @shahidhk for the required SQL.)

貢獻者指南