Browse Source

fix: add skipped migrations for sqlite3 as they're supported now

pull/7610/head
mertmit 9 months ago
parent
commit
aa46429408
  1. 4
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  2. 88
      packages/nocodb/src/meta/migrations/v2/nc_039_sqlite_alter_column_types.ts

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

@ -25,6 +25,7 @@ import * as nc_035_add_username_to_users from '~/meta/migrations/v2/nc_035_add_u
import * as nc_036_base_deleted from '~/meta/migrations/v2/nc_036_base_deleted';
import * as nc_037_rename_project_and_base from '~/meta/migrations/v2/nc_037_rename_project_and_base';
import * as nc_038_formula_parsed_tree_column from '~/meta/migrations/v2/nc_038_formula_parsed_tree_column';
import * as nc_039_sqlite_alter_column_types from '~/meta/migrations/v2/nc_039_sqlite_alter_column_types';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -61,6 +62,7 @@ export default class XcMigrationSourcev2 {
'nc_036_base_deleted',
'nc_037_rename_project_and_base',
'nc_038_formula_parsed_tree_column',
'nc_039_sqlite_alter_column_types',
]);
}
@ -124,6 +126,8 @@ export default class XcMigrationSourcev2 {
return nc_037_rename_project_and_base;
case 'nc_038_formula_parsed_tree_column':
return nc_038_formula_parsed_tree_column;
case 'nc_039_sqlite_alter_column_types':
return nc_039_sqlite_alter_column_types;
}
}
}

88
packages/nocodb/src/meta/migrations/v2/nc_039_sqlite_alter_column_types.ts

@ -0,0 +1,88 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
if (knex.client.config.client === 'sqlite3') {
//nc_012_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('cdf').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('dtxp').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('cc').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.text('ct').alter();
});
//nc_014_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('success_msg').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('redirect_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('banner_image_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('logo_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('description').alter();
});
//nc_016_alter_hooklog_payload_types.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.text('payload').alter();
});
//nc_029_webhook.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.text('response').alter();
});
}
};
const down = async (knex) => {
if (knex.client.config.client === 'sqlite3') {
//nc_012_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('cdf').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('dtxp').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('cc').alter();
});
await knex.schema.alterTable(MetaTable.COLUMNS, (table) => {
table.string('ct').alter();
});
//nc_014_alter_colum_data_types.ts
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('success_msg').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('redirect_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('banner_image_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.string('logo_url').alter();
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.string('description').alter();
});
//nc_016_alter_hooklog_payload_types.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.boolean('payload').alter();
});
//nc_029_webhook.ts
await knex.schema.alterTable(MetaTable.HOOK_LOGS, (table) => {
table.boolean('response').alter();
});
}
};
export { up, down };
Loading…
Cancel
Save