feat: patched up migration to support pg14

This commit is contained in:
=
2025-10-21 00:38:50 +05:30
parent 45a7b4925b
commit af5e22f562
2 changed files with 7 additions and 5 deletions
@@ -14,14 +14,10 @@ export async function up(knex: Knex): Promise<void> {
t.foreign("rootOrgId").references("id").inTable(TableName.Organization).onDelete("CASCADE");
t.dropUnique(["slug"]);
t.unique(["rootOrgId", "parentOrgId", "slug"]);
});
// had to switch to raw for null not distinct
await knex.raw(`
ALTER TABLE "organization"
ADD CONSTRAINT "organization_root_parent_slug_unique"
UNIQUE ("rootOrgId", "parentOrgId", "slug") NULLS NOT DISTINCT;
`);
}
const hasIdentityOrgCol = await knex.schema.hasColumn(TableName.Identity, "orgId");