Added new option to enable/disable option to share secrets with anyone

This commit is contained in:
carlosmonastyrski
2025-03-11 12:58:09 -03:00
parent 716cd090c4
commit acb22cdf36
24 changed files with 486 additions and 102 deletions
@@ -0,0 +1,26 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
if (await knex.schema.hasTable(TableName.Organization)) {
const hasSecretShareToAnyoneCol = await knex.schema.hasColumn(TableName.Organization, "secretShareToAnyone");
if (!hasSecretShareToAnyoneCol) {
await knex.schema.alterTable(TableName.Organization, (t) => {
t.boolean("secretShareSendToAnyone").defaultTo(true);
});
}
}
}
export async function down(knex: Knex): Promise<void> {
if (await knex.schema.hasTable(TableName.Organization)) {
const hasSecretShareToAnyoneCol = await knex.schema.hasColumn(TableName.Organization, "secretShareToAnyone");
if (hasSecretShareToAnyoneCol) {
await knex.schema.alterTable(TableName.Organization, (t) => {
t.dropColumn("secretShareSendToAnyone");
});
}
}
}