mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 14:33:52 +00:00
24 lines
678 B
TypeScript
24 lines
678 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "@app/db/schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description");
|
|
|
|
if (!hasProjectDescription) {
|
|
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
|
|
t.string("description");
|
|
});
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description");
|
|
|
|
if (hasProjectDescription) {
|
|
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
|
|
t.dropColumn("description");
|
|
});
|
|
}
|
|
}
|