fix: correct order of drop sequence

This commit is contained in:
Scott Wilson
2024-10-02 16:57:24 -07:00
parent cf5c886b6f
commit 7cd85cf84a

View File

@@ -30,15 +30,15 @@ export async function down(knex: Knex): Promise<void> {
// remove projectId for CMEK functionality
await knex.schema.alterTable(TableName.KmsKey, (table) => {
if (hasName) {
table.renameColumn("name", "slug");
}
if (hasOrgId) {
table.dropUnique(["orgId", "projectId", "slug"]);
table.unique(["orgId", "slug"]);
}
table.dropColumn("projectId");
if (hasName) {
table.renameColumn("name", "slug");
}
});
}
}