Open mnlbox opened 5 years ago
I love this! I know it can be done with SQL, but if Hasura could migrate it, it could update relationships and the meta tables (hdb_*
) automatically.
@mnlbox @Mrcampbell
You can run the ALTER TABLE ..
query in the Run SQL
section of the console and move the table from one schema to another schema. The server will take care of migrating relationship/permission definition in the metadata tables (hdb_*
) :slightly_smiling_face:
Example:-
-- move table "foo" from public to test schema
alter table foo set schema test;
However, altering multiple tables' schema (in the same query) may result in an error if tables have relationships defined on each other. See https://github.com/hasura/graphql-engine/issues/3059
The console should support moving tables across schemas under the Modify
section in UI.
@rakeshkky Any plan for this in roadmap?
@mnlbox We'll add support to console in upcoming weeks. Till then you can try manually moving a table from one schema to another using ALTER ..
statement in SQL
section of console UI (DATA
-> SQL
)
@rakeshkky Any update on this feature?
@rakeshkky This feature would be very helpful.
Hi guys, I created some table in public schema and now I want to move that table to a new schema. I think this is a very useful feature that we can move table from one schema to another in console.
Please vote up this if you agree with this. :wink: