mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 02:25:07 +00:00
22 lines
700 B
TypeScript
22 lines
700 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasSecretSharingColumn = await knex.schema.hasColumn(TableName.Project, "secretSharing");
|
|
if (!hasSecretSharingColumn) {
|
|
await knex.schema.table(TableName.Project, (table) => {
|
|
table.boolean("secretSharing").notNullable().defaultTo(true);
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
const hasSecretSharingColumn = await knex.schema.hasColumn(TableName.Project, "secretSharing");
|
|
if (hasSecretSharingColumn) {
|
|
await knex.schema.table(TableName.Project, (table) => {
|
|
table.dropColumn("secretSharing");
|
|
});
|
|
}
|
|
}
|