mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 01:38:05 +00:00
24 lines
697 B
TypeScript
24 lines
697 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasFipsModeColumn = await knex.schema.hasColumn(TableName.SuperAdmin, "fipsEnabled");
|
|
|
|
if (!hasFipsModeColumn) {
|
|
await knex.schema.alterTable(TableName.SuperAdmin, (table) => {
|
|
table.boolean("fipsEnabled").notNullable().defaultTo(false);
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
const hasFipsModeColumn = await knex.schema.hasColumn(TableName.SuperAdmin, "fipsEnabled");
|
|
|
|
if (hasFipsModeColumn) {
|
|
await knex.schema.alterTable(TableName.SuperAdmin, (table) => {
|
|
table.dropColumn("fipsEnabled");
|
|
});
|
|
}
|
|
}
|