Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -3,9 +3,10 @@ import { resolve } from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { readBaselineLegacyMigration } from "./baseline-legacy-migration.test-helper";
|
||||
|
||||
const repoRoot = resolve(__dirname, "../../..");
|
||||
const schemaPath = resolve(repoRoot, "prisma/schema/permissions.prisma");
|
||||
const migrationPath = resolve(repoRoot, "prisma/migrations/20260528153000_user_role_assignment_uniqueness/migration.sql");
|
||||
|
||||
async function readUserRoleModel() {
|
||||
const schema = await readFile(schemaPath, "utf8");
|
||||
@@ -33,7 +34,7 @@ describe("UserRole schema contract", () => {
|
||||
});
|
||||
|
||||
it("adds partial unique indexes for tenant and admin assignments with duplicate preflight checks", async () => {
|
||||
const migrationSql = await readFile(migrationPath, "utf8");
|
||||
const migrationSql = readBaselineLegacyMigration("20260528153000_user_role_assignment_uniqueness");
|
||||
|
||||
expect(migrationSql, "migration rejects existing tenant-scope duplicates before indexing").toMatch(
|
||||
/WHERE\s+"tenantId"\s+IS\s+NOT\s+NULL[\s\S]*GROUP\s+BY\s+"userId",\s*"roleId",\s*"tenantId"[\s\S]*HAVING\s+COUNT\(\*\)\s*>\s*1/i,
|
||||
|
||||
Reference in new issue
Block a user