alerting for gateways and relays

This commit is contained in:
x032205
2025-10-08 23:46:47 -04:00
parent 12b59fc2c0
commit c6696d4fde
12 changed files with 365 additions and 18 deletions
@@ -0,0 +1,29 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
if (!(await knex.schema.hasColumn(TableName.Relay, "healthAlertedAt"))) {
await knex.schema.alterTable(TableName.Relay, (t) => {
t.datetime("healthAlertedAt");
});
}
if (!(await knex.schema.hasColumn(TableName.GatewayV2, "healthAlertedAt"))) {
await knex.schema.alterTable(TableName.GatewayV2, (t) => {
t.datetime("healthAlertedAt");
});
}
}
export async function down(knex: Knex): Promise<void> {
if (await knex.schema.hasColumn(TableName.GatewayV2, "healthAlertedAt")) {
await knex.schema.alterTable(TableName.GatewayV2, (t) => {
t.dropColumn("healthAlertedAt");
});
}
if (await knex.schema.hasColumn(TableName.Relay, "healthAlertedAt")) {
await knex.schema.alterTable(TableName.Relay, (t) => {
t.dropColumn("healthAlertedAt");
});
}
}