Browse Source

feat: integrations follow-up migration

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/9455/head
mertmit 3 months ago
parent
commit
9b21a12ca9
  1. 8
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  2. 16
      packages/nocodb/src/meta/migrations/v2/nc_061_integration_is_default.ts
  3. 31
      packages/nocodb/src/meta/migrations/v2/nc_062_integration_store.ts
  4. 1
      packages/nocodb/src/utils/globals.ts

8
packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts

@ -47,6 +47,8 @@ import * as nc_057_file_references from '~/meta/migrations/v2/nc_057_file_refere
import * as nc_058_button_colum from '~/meta/migrations/v2/nc_058_button_colum';
import * as nc_059_invited_by from '~/meta/migrations/v2/nc_059_invited_by';
import * as nc_060_descriptions from '~/meta/migrations/v2/nc_060_descriptions';
import * as nc_061_integration_is_default from '~/meta/migrations/v2/nc_061_integration_is_default';
import * as nc_062_integration_store from '~/meta/migrations/v2/nc_062_integration_store';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -105,6 +107,8 @@ export default class XcMigrationSourcev2 {
'nc_058_button_colum',
'nc_059_invited_by',
'nc_060_descriptions',
'nc_061_integration_is_default',
'nc_062_integration_store',
]);
}
@ -212,6 +216,10 @@ export default class XcMigrationSourcev2 {
return nc_059_invited_by;
case 'nc_060_descriptions':
return nc_060_descriptions;
case 'nc_061_integration_is_default':
return nc_061_integration_is_default;
case 'nc_062_integration_store':
return nc_062_integration_store;
}
}
}

16
packages/nocodb/src/meta/migrations/v2/nc_061_integration_is_default.ts

@ -0,0 +1,16 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.INTEGRATIONS, (table) => {
table.boolean('is_default').defaultTo(false);
});
};
const down = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.INTEGRATIONS, (table) => {
table.dropColumn('is_default');
});
};
export { up, down };

31
packages/nocodb/src/meta/migrations/v2/nc_062_integration_store.ts

@ -0,0 +1,31 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
await knex.schema.createTable(MetaTable.INTEGRATIONS_STORE, (table) => {
table.string('id', 20).primary();
table.string('fk_integration_id', 20).index();
table.string('type', 20);
table.string('sub_type', 20);
table.string('fk_workspace_id', 20);
table.string('fk_user_id', 20);
table.timestamps(true, true);
table.text('slot_0');
table.text('slot_1');
table.text('slot_2');
table.text('slot_3');
table.text('slot_4');
table.integer('slot_5');
table.integer('slot_6');
table.integer('slot_7');
table.integer('slot_8');
table.integer('slot_9');
});
};
const down = async (knex: Knex) => {
await knex.schema.dropTable(MetaTable.INTEGRATIONS_STORE);
};
export { up, down };

1
packages/nocodb/src/utils/globals.ts

@ -53,6 +53,7 @@ export enum MetaTable {
COMMENTS_REACTIONS = 'nc_comment_reactions',
JOBS = 'nc_jobs',
INTEGRATIONS = 'nc_integrations_v2',
INTEGRATIONS_STORE = 'nc_integrations_store_v2',
FILE_REFERENCES = 'nc_file_references',
COL_BUTTON = 'nc_col_button_v2',
}

Loading…
Cancel
Save