mirror of
https://github.com/rajnandan1/kener.git
synced 2026-06-23 04:10:22 +00:00
17 lines
492 B
TypeScript
17 lines
492 B
TypeScript
import type { Knex } from "knex";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasCol = await knex.schema.hasColumn("incidents", "incident_source");
|
|
if (!hasCol) {
|
|
await knex.schema.alterTable("incidents", function (table) {
|
|
table.text("incident_source").defaultTo("DASHBOARD");
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
await knex.schema.alterTable("incidents", function (table) {
|
|
table.dropColumn("incident_source");
|
|
});
|
|
}
|