mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
a66fb42ce2
* Separate DB and metadata migrations * Refactor Migrate.hs to generate list of migrations at compile-time * Replace ginger with shakespeare to improve performance * Improve migration log messages
29 lines
986 B
SQL
29 lines
986 B
SQL
ALTER TABLE hdb_catalog.event_triggers
|
|
DROP CONSTRAINT event_triggers_pkey;
|
|
|
|
ALTER TABLE hdb_catalog.event_triggers
|
|
DROP CONSTRAINT event_triggers_name_key;
|
|
|
|
ALTER TABLE hdb_catalog.event_triggers
|
|
ADD PRIMARY KEY (name);
|
|
|
|
ALTER TABLE hdb_catalog.event_triggers
|
|
DROP COLUMN id;
|
|
|
|
ALTER TABLE hdb_catalog.event_log
|
|
DROP COLUMN trigger_id;
|
|
|
|
CREATE INDEX ON hdb_catalog.event_log (trigger_name);
|
|
|
|
UPDATE hdb_catalog.hdb_relationship
|
|
SET rel_def = '{"manual_configuration":{"remote_table":{"schema":"hdb_catalog","name":"event_log"},"column_mapping":{"name":"trigger_name"}}}'
|
|
WHERE table_schema = 'hdb_catalog'
|
|
AND table_name = 'event_triggers'
|
|
AND rel_name = 'events';
|
|
|
|
UPDATE hdb_catalog.hdb_relationship
|
|
SET rel_def = '{"manual_configuration":{"remote_table":{"schema":"hdb_catalog","name":"event_triggers"},"column_mapping":{"trigger_name":"name"}}}'
|
|
WHERE table_schema = 'hdb_catalog'
|
|
AND table_name = 'event_log'
|
|
AND rel_name = 'trigger';
|