Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat: isolate API tokens by auth type

Pranav C93ac657c79af
diff --git a/packages/nocodb/src/meta/migrations/v2/nc_088_add_sso_client_to_api_tokens.ts b/packages/nocodb/src/meta/migrations/v2/nc_088_add_sso_client_to_api_tokens.ts
new file mode 100644
index 0000000000..348ef7af2e
--- /dev/null
+++ b/packages/nocodb/src/meta/migrations/v2/nc_088_add_sso_client_to_api_tokens.ts
@@ -0,0 +1,18 @@
+import type { Knex } from 'knex';
+import { MetaTable } from '~/utils/globals';
+
+const up = async (knex: Knex) => {
+ await knex.schema.alterTable(MetaTable.API_TOKENS, (table) => {
+ table.string('fk_sso_client_id', 20)
+ table.index('fk_sso_client_id');
+ });
+};
+
+const down = async (knex: Knex) => {
+ await knex.schema.alterTable(MetaTable.API_TOKENS, (table) => {
+ table.dropIndex('fk_sso_client_id');
+ table.dropColumn('fk_sso_client_id');
+ });
+};
+
+export { up, down };