Browse Source

Merge pull request #2498 from nocodb/fix/mssql-noco-migration-error

fix(migration): foreign key length correction
pull/2515/head
Pranav C 2 years ago committed by GitHub
parent
commit
035698e93e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nocodb/src/lib/migrations/v2/nc_013_sync_source.ts
  2. 9
      packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts

2
packages/nocodb/src/lib/migrations/v2/nc_013_sync_source.ts

@ -17,7 +17,7 @@ const up = async (knex: Knex) => {
table.string('project_id', 128);
table.foreign('project_id').references(`${MetaTable.PROJECT}.id`);
table.string('fk_user_id', 128);
table.string('fk_user_id', 20);
table.foreign('fk_user_id').references(`${MetaTable.USERS}.id`);
table.timestamps(true, true);

9
packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts

@ -2,7 +2,14 @@ import Knex from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') {
if (knex.client.config.client === 'mssql') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.dropColumn('payload');
});
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.text('payload');
});
} else if (knex.client.config.client !== 'sqlite3') {
await knex.schema.alterTable(MetaTable.HOOK_LOGS, table => {
table.text('payload').alter();
});

Loading…
Cancel
Save