mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 05:51:44 +00:00
30 lines
936 B
TypeScript
30 lines
936 B
TypeScript
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");
|
|
});
|
|
}
|
|
}
|