Skip to content

Commit

Permalink
feat: changed order
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Feb 21, 2025
1 parent 4bcc790 commit 9d311e9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backend/src/db/migrations/20250212191958_create-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ export async function up(knex: Knex): Promise<void> {
}

export async function down(knex: Knex): Promise<void> {
if (await knex.schema.hasTable(TableName.DynamicSecret)) {
const doesGatewayColExist = await knex.schema.hasColumn(TableName.DynamicSecret, "gatewayId");
await knex.schema.alterTable(TableName.DynamicSecret, (t) => {
if (doesGatewayColExist) t.dropColumn("gatewayId");
});
}

await knex.schema.dropTableIfExists(TableName.ProjectGateway);
await dropOnUpdateTrigger(knex, TableName.ProjectGateway);

Expand All @@ -105,11 +112,4 @@ export async function down(knex: Knex): Promise<void> {

await knex.schema.dropTableIfExists(TableName.OrgGatewayConfig);
await dropOnUpdateTrigger(knex, TableName.OrgGatewayConfig);

if (await knex.schema.hasTable(TableName.DynamicSecret)) {
const doesGatewayColExist = await knex.schema.hasColumn(TableName.DynamicSecret, "gatewayId");
await knex.schema.alterTable(TableName.DynamicSecret, (t) => {
if (doesGatewayColExist) t.dropColumn("gatewayId");
});
}
}

0 comments on commit 9d311e9

Please sign in to comment.