graphql-engine/server/src-rsr/migrations/32_to_31.sql
nizar-m 0e666a9203
Fix catalog version for v1.1.1 (close #4354) (#4355)
* Fix catalog version for v1.1.1

* Remove entries of removed tables from hdb_catalog

While downgrading catalog version from 32 -> 31, not removing entries
in hdb_table and hdb_relationship for the tables that are removed in
the downgrade, results in incosistent schema, when the server with
downgraded version is started. This should probably be handled in
a better fashion.

With the change in this commit, the server is able to successfully
start with downgraded catalog version 31.

* Test downgrade command along with upgrade tests
2020-04-09 19:57:59 -05:00

8 lines
557 B
SQL

DROP VIEW hdb_catalog.hdb_role;
DROP TABLE hdb_catalog.hdb_action_permission;
DROP TABLE hdb_catalog.hdb_action;
DROP TABLE hdb_catalog.hdb_custom_types;
DROP TABLE hdb_catalog.hdb_action_log;
DELETE FROM hdb_catalog.hdb_relationship where table_schema = 'hdb_catalog' and table_name in ('hdb_action', 'hdb_action_permission', 'hdb_action_log', 'hdb_custom_types', 'hdb_role');
DELETE FROM hdb_catalog.hdb_table where table_schema = 'hdb_catalog' and table_name in ('hdb_action', 'hdb_action_permission', 'hdb_action_log', 'hdb_custom_types', 'hdb_role');