Fix rebase issue with deleted files

This commit is contained in:
carlosmonastyrski
2025-03-14 08:54:14 -03:00
parent c0de4ae3ee
commit 4f4764dfcd
11 changed files with 40 additions and 19 deletions
@@ -4,11 +4,14 @@ 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, "secretShareSendToAnyone");
const hasSecretShareToAnyoneCol = await knex.schema.hasColumn(
TableName.Organization,
"allowSecretSharingOutsideOrganization"
);
if (!hasSecretShareToAnyoneCol) {
await knex.schema.alterTable(TableName.Organization, (t) => {
t.boolean("secretShareSendToAnyone").defaultTo(true);
t.boolean("allowSecretSharingOutsideOrganization").defaultTo(true);
});
}
}
@@ -16,10 +19,13 @@ export async function up(knex: Knex): Promise<void> {
export async function down(knex: Knex): Promise<void> {
if (await knex.schema.hasTable(TableName.Organization)) {
const hasSecretShareToAnyoneCol = await knex.schema.hasColumn(TableName.Organization, "secretShareSendToAnyone");
const hasSecretShareToAnyoneCol = await knex.schema.hasColumn(
TableName.Organization,
"allowSecretSharingOutsideOrganization"
);
if (hasSecretShareToAnyoneCol) {
await knex.schema.alterTable(TableName.Organization, (t) => {
t.dropColumn("secretShareSendToAnyone");
t.dropColumn("allowSecretSharingOutsideOrganization");
});
}
}