mirror of
https://github.com/rajnandan1/kener.git
synced 2026-06-23 04:10:22 +00:00
24 lines
740 B
TypeScript
24 lines
740 B
TypeScript
import type { Knex } from "knex";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
if (!(await knex.schema.hasColumn("monitors", "external_url"))) {
|
|
await knex.schema.alterTable("monitors", (table) => {
|
|
table.text("external_url").nullable();
|
|
});
|
|
}
|
|
if (!(await knex.schema.hasColumn("monitoring_data", "error_message"))) {
|
|
await knex.schema.alterTable("monitoring_data", (table) => {
|
|
table.text("error_message").nullable();
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
await knex.schema.alterTable("monitors", (table) => {
|
|
table.dropColumn("external_url");
|
|
});
|
|
await knex.schema.alterTable("monitoring_data", (table) => {
|
|
table.dropColumn("error_message");
|
|
});
|
|
}
|