|
|
@ -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 }; |
|
|
|