mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 06:34:57 +00:00
22 lines
680 B
TypeScript
22 lines
680 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasColumn = await knex.schema.hasColumn(TableName.SecretApprovalRequest, "bypassReason");
|
|
if (!hasColumn) {
|
|
await knex.schema.table(TableName.SecretApprovalRequest, (table) => {
|
|
table.string("bypassReason").nullable();
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
const hasColumn = await knex.schema.hasColumn(TableName.SecretApprovalRequest, "bypassReason");
|
|
if (hasColumn) {
|
|
await knex.schema.table(TableName.SecretApprovalRequest, (table) => {
|
|
table.dropColumn("bypassReason");
|
|
});
|
|
}
|
|
}
|