mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 01:12:59 +00:00
26 lines
812 B
TypeScript
26 lines
812 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { TableName } from "../schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
if (await knex.schema.hasTable(TableName.SecretSharing)) {
|
|
const doesPasswordExist = await knex.schema.hasColumn(TableName.SecretSharing, "password");
|
|
if (!doesPasswordExist) {
|
|
await knex.schema.alterTable(TableName.SecretSharing, (t) => {
|
|
t.string("password").nullable();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
if (await knex.schema.hasTable(TableName.SecretSharing)) {
|
|
const doesPasswordExist = await knex.schema.hasColumn(TableName.SecretSharing, "password");
|
|
if (doesPasswordExist) {
|
|
await knex.schema.alterTable(TableName.SecretSharing, (t) => {
|
|
t.dropColumn("password");
|
|
});
|
|
}
|
|
}
|
|
}
|