Browse Source

fix: drop base_id fk restriction for audit table

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/3573/head
mertmit 2 years ago
parent
commit
7835b7a4fd
  1. 10
      packages/nocodb/src/lib/migrations/v2/nc_023_multiple_source.ts

10
packages/nocodb/src/lib/migrations/v2/nc_023_multiple_source.ts

@ -1,4 +1,4 @@
import Knex from 'knex'; import { Knex } from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
@ -11,6 +11,10 @@ const up = async (knex: Knex) => {
table.boolean('enabled').defaultTo(true); table.boolean('enabled').defaultTo(true);
table.float('order'); table.float('order');
}); });
await knex.schema.alterTable(MetaTable.AUDIT, (table) => {
table.dropForeign('base_id');
});
}; };
const down = async (knex) => { const down = async (knex) => {
@ -22,6 +26,10 @@ const down = async (knex) => {
table.dropColumn('enabled'); table.dropColumn('enabled');
table.dropColumn('order'); table.dropColumn('order');
}); });
await knex.schema.alterTable(MetaTable.AUDIT, (table) => {
table.foreign('base_id').references(`${MetaTable.BASES}.id`);
});
}; };
export { up, down }; export { up, down };

Loading…
Cancel
Save