-
I would like to know how to add a new field (column) programmatically. I have a requirement where when a user creates a table from the Hasura admin console, column 'TENANT_ID' should be added automatically or by default .please help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If I understand correctly, this might be a good candidate for the new "schema sharing" feature that's landing in Hasura. https://hasura.io/events/hasura-con-2021/talks/hasura-schema-sharing/ This would allow you to define a default set of columns that would be used as the starter for new tables. Otherwise, an event trigger that calls a remote service that uses the Hasura CLI to add a column to your table is probably what you are looking for.
|
Beta Was this translation helpful? Give feedback.
If I understand correctly, this might be a good candidate for the new "schema sharing" feature that's landing in Hasura.
https://hasura.io/events/hasura-con-2021/talks/hasura-schema-sharing/
This would allow you to define a default set of columns that would be used as the starter for new tables. Otherwise, an event trigger that calls a remote service that uses the Hasura CLI to add a column to your table is probably what you are looking for.
New Table -> event trigger -> service -> update "New Table" with "Default Columns"