mirror of
https://github.com/Infisical/infisical.git
synced 2025-08-03 20:23:35 +00:00
22 lines
641 B
TypeScript
22 lines
641 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasCol = await knex.schema.hasColumn(TableName.Project, "hasDeleteProtection");
|
|
if (!hasCol) {
|
|
await knex.schema.alterTable(TableName.Project, (t) => {
|
|
t.boolean("hasDeleteProtection").defaultTo(false);
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
const hasCol = await knex.schema.hasColumn(TableName.Project, "hasDeleteProtection");
|
|
if (hasCol) {
|
|
await knex.schema.alterTable(TableName.Project, (t) => {
|
|
t.dropColumn("hasDeleteProtection");
|
|
});
|
|
}
|
|
}
|