@prisma-next/target-postgres 0.15.0-dev.1 → 0.15.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/{control-policy-1Tcf7Tyu.mjs → control-policy-DaLdbcYE.mjs} +41 -72
  2. package/dist/control-policy-DaLdbcYE.mjs.map +1 -0
  3. package/dist/control.mjs +3 -3
  4. package/dist/{diff-database-schema-Bfgshz4v.mjs → diff-database-schema-oY3brcLj.mjs} +85 -22
  5. package/dist/diff-database-schema-oY3brcLj.mjs.map +1 -0
  6. package/dist/diff-database-schema.d.mts +3 -12
  7. package/dist/diff-database-schema.d.mts.map +1 -1
  8. package/dist/diff-database-schema.mjs +1 -1
  9. package/dist/issue-planner.d.mts +1 -1
  10. package/dist/issue-planner.d.mts.map +1 -1
  11. package/dist/issue-planner.mjs +1 -1
  12. package/dist/migration.d.mts +2 -2
  13. package/dist/migration.mjs +2 -2
  14. package/dist/{op-factory-call-Bn9zDx4_.d.mts → op-factory-call-CvH0JeBW.d.mts} +7 -4
  15. package/dist/op-factory-call-CvH0JeBW.d.mts.map +1 -0
  16. package/dist/{op-factory-call-C38NzvQD.mjs → op-factory-call-tBcLo_B8.mjs} +33 -12
  17. package/dist/op-factory-call-tBcLo_B8.mjs.map +1 -0
  18. package/dist/op-factory-call.d.mts +2 -2
  19. package/dist/op-factory-call.mjs +2 -2
  20. package/dist/{planner-BvUu6b9C.mjs → planner-ootbxGty.mjs} +11 -11
  21. package/dist/planner-ootbxGty.mjs.map +1 -0
  22. package/dist/{planner-produced-postgres-migration-D7y-PEHK.mjs → planner-produced-postgres-migration-DVsaobdV.mjs} +2 -2
  23. package/dist/{planner-produced-postgres-migration-D7y-PEHK.mjs.map → planner-produced-postgres-migration-DVsaobdV.mjs.map} +1 -1
  24. package/dist/{planner-produced-postgres-migration-BEY1T0Xm.d.mts → planner-produced-postgres-migration-k33bb9Sm.d.mts} +2 -2
  25. package/dist/{planner-produced-postgres-migration-BEY1T0Xm.d.mts.map → planner-produced-postgres-migration-k33bb9Sm.d.mts.map} +1 -1
  26. package/dist/planner-produced-postgres-migration.d.mts +1 -1
  27. package/dist/planner-produced-postgres-migration.mjs +1 -1
  28. package/dist/planner.d.mts +2 -2
  29. package/dist/planner.d.mts.map +1 -1
  30. package/dist/planner.mjs +2 -2
  31. package/dist/{postgres-database-schema-node-CJv5bfbs.d.mts → postgres-database-schema-node-DJOTywwQ.d.mts} +11 -2
  32. package/dist/postgres-database-schema-node-DJOTywwQ.d.mts.map +1 -0
  33. package/dist/{postgres-migration-arMSWU9b.mjs → postgres-migration-Bt3sXoID.mjs} +18 -2
  34. package/dist/postgres-migration-Bt3sXoID.mjs.map +1 -0
  35. package/dist/{postgres-migration-DbckK1su.d.mts → postgres-migration-ulfqRGA1.d.mts} +27 -2
  36. package/dist/postgres-migration-ulfqRGA1.d.mts.map +1 -0
  37. package/dist/{postgres-role-schema-node-Cm-j0ZGM.mjs → postgres-role-schema-node-bg32e7I-.mjs} +3 -2
  38. package/dist/postgres-role-schema-node-bg32e7I-.mjs.map +1 -0
  39. package/dist/schema-node-kinds-CrYzCR1i.d.mts +30 -0
  40. package/dist/schema-node-kinds-CrYzCR1i.d.mts.map +1 -0
  41. package/dist/types.d.mts +3 -2
  42. package/dist/types.mjs +3 -3
  43. package/package.json +20 -20
  44. package/src/core/migrations/contract-to-postgres-database-schema-node.ts +99 -19
  45. package/src/core/migrations/control-policy.ts +4 -3
  46. package/src/core/migrations/diff-database-schema.ts +3 -3
  47. package/src/core/migrations/issue-planner.ts +41 -80
  48. package/src/core/migrations/op-factory-call.ts +38 -14
  49. package/src/core/migrations/planner-strategies.ts +5 -4
  50. package/src/core/migrations/planner.ts +5 -4
  51. package/src/core/migrations/postgres-migration.ts +60 -0
  52. package/src/core/migrations/verify-postgres-namespaces.ts +0 -1
  53. package/src/core/schema-ir/postgres-policy-schema-node.ts +12 -2
  54. package/src/exports/op-factory-call.ts +5 -0
  55. package/src/exports/types.ts +1 -0
  56. package/dist/control-policy-1Tcf7Tyu.mjs.map +0 -1
  57. package/dist/diff-database-schema-Bfgshz4v.mjs.map +0 -1
  58. package/dist/op-factory-call-Bn9zDx4_.d.mts.map +0 -1
  59. package/dist/op-factory-call-C38NzvQD.mjs.map +0 -1
  60. package/dist/planner-BvUu6b9C.mjs.map +0 -1
  61. package/dist/postgres-database-schema-node-CJv5bfbs.d.mts.map +0 -1
  62. package/dist/postgres-migration-DbckK1su.d.mts.map +0 -1
  63. package/dist/postgres-migration-arMSWU9b.mjs.map +0 -1
  64. package/dist/postgres-role-schema-node-Cm-j0ZGM.mjs.map +0 -1
@@ -1,16 +1,54 @@
1
1
  import { r as isPostgresSchema } from "./postgres-schema-Cm4DtiGA.mjs";
2
- import { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, t as PostgresTableSchemaNode } from "./postgres-table-schema-node-D6LvInCe.mjs";
3
- import { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from "./postgres-role-schema-node-Cm-j0ZGM.mjs";
2
+ import { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from "./postgres-table-schema-node-D6LvInCe.mjs";
3
+ import { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from "./postgres-role-schema-node-bg32e7I-.mjs";
4
4
  import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-XyBaaenM.mjs";
5
- import { i as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-1Tcf7Tyu.mjs";
5
+ import { i as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-DaLdbcYE.mjs";
6
6
  import { UNBOUND_NAMESPACE_ID } from "@prisma-next/framework-components/ir";
7
7
  import { blindCast } from "@prisma-next/utils/casts";
8
8
  import { buildNativeTypeExpander, contractNamespaceToSchemaIR } from "@prisma-next/family-sql/control";
9
9
  import { ifDefined } from "@prisma-next/utils/defined";
10
- import { SqlForeignKeyIR } from "@prisma-next/sql-schema-ir/types";
10
+ import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma-next/sql-schema-ir/types";
11
11
  import { classifyDiffSubjectGranularity } from "@prisma-next/family-sql/diff";
12
- import { diffSchemas } from "@prisma-next/framework-components/control";
12
+ import { diffSchemas, issueOutcome } from "@prisma-next/framework-components/control";
13
13
  //#region src/core/migrations/contract-to-postgres-database-schema-node.ts
14
+ /** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
15
+ function databaseStep() {
16
+ return {
17
+ nodeKind: PostgresSchemaNodeKind.database,
18
+ id: "database"
19
+ };
20
+ }
21
+ function tableDependsOn(namespaceId, tableName) {
22
+ return [
23
+ databaseStep(),
24
+ {
25
+ nodeKind: PostgresSchemaNodeKind.namespace,
26
+ id: namespaceId
27
+ },
28
+ {
29
+ nodeKind: PostgresSchemaNodeKind.table,
30
+ id: tableName
31
+ }
32
+ ];
33
+ }
34
+ function roleDependsOn(role) {
35
+ return [databaseStep(), {
36
+ nodeKind: PostgresSchemaNodeKind.role,
37
+ id: role
38
+ }];
39
+ }
40
+ /**
41
+ * The chains from a table-child object (foreign key, index, unique, primary
42
+ * key) to each of the own columns it is built on, in the Postgres tree.
43
+ * Dropping a covered column auto-drops the object, so the object's drop must
44
+ * precede the column's; the graph derives that direction from these edges.
45
+ */
46
+ function columnDependsOn(namespaceId, tableName, columns) {
47
+ return columns.map((column) => [...tableDependsOn(namespaceId, tableName), {
48
+ nodeKind: RelationalSchemaNodeKind.column,
49
+ id: `column:${column}`
50
+ }]);
51
+ }
14
52
  function toPolicyNode(policy, namespaceId) {
15
53
  return new PostgresPolicySchemaNode({
16
54
  name: policy.name,
@@ -21,7 +59,8 @@ function toPolicyNode(policy, namespaceId) {
21
59
  roles: [...policy.roles],
22
60
  ...ifDefined("using", policy.using),
23
61
  ...ifDefined("withCheck", policy.withCheck),
24
- permissive: policy.permissive
62
+ permissive: policy.permissive,
63
+ dependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]
25
64
  });
26
65
  }
27
66
  /**
@@ -76,24 +115,48 @@ function contractToPostgresDatabaseSchemaNode(contract, options) {
76
115
  for (const tableName of Object.keys(ns.table)) {
77
116
  const sqlTable = sqlTables[tableName];
78
117
  if (sqlTable === void 0) continue;
79
- const foreignKeys = sqlTable.foreignKeys.map((fk) => new SqlForeignKeyIR({
80
- columns: fk.columns,
81
- referencedTable: fk.referencedTable,
82
- referencedColumns: fk.referencedColumns,
83
- referencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,
84
- ...ifDefined("name", fk.name),
85
- ...ifDefined("onDelete", fk.onDelete),
86
- ...ifDefined("onUpdate", fk.onUpdate),
87
- ...ifDefined("annotations", fk.annotations),
88
- resolvedReferencedNamespace: resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID)
118
+ const foreignKeys = sqlTable.foreignKeys.map((fk) => {
119
+ const resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);
120
+ return new SqlForeignKeyIR({
121
+ columns: fk.columns,
122
+ referencedTable: fk.referencedTable,
123
+ referencedColumns: fk.referencedColumns,
124
+ referencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,
125
+ ...ifDefined("name", fk.name),
126
+ ...ifDefined("onDelete", fk.onDelete),
127
+ ...ifDefined("onUpdate", fk.onUpdate),
128
+ ...ifDefined("annotations", fk.annotations),
129
+ resolvedReferencedNamespace,
130
+ dependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]
131
+ });
132
+ });
133
+ const uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({
134
+ columns: u.columns,
135
+ ...ifDefined("name", u.name),
136
+ ...ifDefined("annotations", u.annotations),
137
+ dependsOn: columnDependsOn(ddlSchema, tableName, u.columns)
138
+ }));
139
+ const indexes = sqlTable.indexes.map((i) => new SqlIndexIR({
140
+ columns: i.columns,
141
+ unique: i.unique,
142
+ ...ifDefined("name", i.name),
143
+ ...ifDefined("type", i.type),
144
+ ...ifDefined("options", i.options),
145
+ ...ifDefined("annotations", i.annotations),
146
+ dependsOn: columnDependsOn(ddlSchema, tableName, i.columns)
89
147
  }));
148
+ const primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({
149
+ columns: sqlTable.primaryKey.columns,
150
+ ...ifDefined("name", sqlTable.primaryKey.name),
151
+ dependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)
152
+ }) : void 0;
90
153
  tables[tableName] = new PostgresTableSchemaNode({
91
154
  name: sqlTable.name,
92
155
  columns: sqlTable.columns,
93
156
  foreignKeys,
94
- uniques: sqlTable.uniques,
95
- indexes: sqlTable.indexes,
96
- ...ifDefined("primaryKey", sqlTable.primaryKey),
157
+ uniques,
158
+ indexes,
159
+ ...ifDefined("primaryKey", primaryKey),
97
160
  ...ifDefined("annotations", sqlTable.annotations),
98
161
  ...ifDefined("checks", sqlTable.checks),
99
162
  policies: policiesByTable.get(tableName) ?? [],
@@ -221,7 +284,7 @@ function diffPostgresSchema(input) {
221
284
  const structuralOwned = ownedSchemaNames(fullExpected);
222
285
  return {
223
286
  issues: diffSchemas(expected, actual).filter((issue) => {
224
- if (issue.reason !== "not-expected") return true;
287
+ if (issueOutcome(issue) !== "not-expected") return true;
225
288
  if (isClusterScopedIssue(issue)) return true;
226
289
  const granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);
227
290
  const namespaceSegment = issue.path[1];
@@ -290,7 +353,7 @@ function buildPostgresPlanDiff(input) {
290
353
  expected,
291
354
  actual: paddedActual,
292
355
  issues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {
293
- if (issue.reason !== "not-expected") return true;
356
+ if (issueOutcome(issue) !== "not-expected") return true;
294
357
  if (isClusterScopedIssue(issue)) return true;
295
358
  const granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);
296
359
  const namespaceSegment = issue.path[1];
@@ -302,4 +365,4 @@ function buildPostgresPlanDiff(input) {
302
365
  //#endregion
303
366
  export { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };
304
367
 
305
- //# sourceMappingURL=diff-database-schema-Bfgshz4v.mjs.map
368
+ //# sourceMappingURL=diff-database-schema-oY3brcLj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-database-schema-oY3brcLj.mjs","names":[],"sources":["../src/core/migrations/contract-to-postgres-database-schema-node.ts","../src/core/migrations/diff-database-schema.ts"],"sourcesContent":["import type { ContractToSchemaIROptions } from '@prisma-next/family-sql/control';\nimport { contractNamespaceToSchemaIR } from '@prisma-next/family-sql/control';\nimport type { SchemaNodeRef } from '@prisma-next/framework-components/control';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport {\n PrimaryKey,\n RelationalSchemaNodeKind,\n SqlForeignKeyIR,\n SqlIndexIR,\n SqlUniqueIR,\n} from '@prisma-next/sql-schema-ir/types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport type { PostgresRlsPolicy } from '../postgres-rls-policy';\nimport type { PostgresContract } from '../postgres-schema';\nimport { isPostgresSchema } from '../postgres-schema';\nimport { PostgresDatabaseSchemaNode } from '../schema-ir/postgres-database-schema-node';\nimport { PostgresNamespaceSchemaNode } from '../schema-ir/postgres-namespace-schema-node';\nimport { PostgresNativeEnumSchemaNode } from '../schema-ir/postgres-native-enum-schema-node';\nimport { PostgresPolicySchemaNode } from '../schema-ir/postgres-policy-schema-node';\nimport { PostgresRoleSchemaNode } from '../schema-ir/postgres-role-schema-node';\nimport { PostgresTableSchemaNode } from '../schema-ir/postgres-table-schema-node';\nimport { PostgresSchemaNodeKind } from '../schema-ir/schema-node-kinds';\nimport { resolveDdlSchemaForNamespaceStorage } from './resolve-ddl-schema';\n\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep(): { readonly nodeKind: string; readonly id: string } {\n return { nodeKind: PostgresSchemaNodeKind.database, id: 'database' };\n}\n\nfunction tableDependsOn(namespaceId: string, tableName: string): SchemaNodeRef {\n return [\n databaseStep(),\n { nodeKind: PostgresSchemaNodeKind.namespace, id: namespaceId },\n { nodeKind: PostgresSchemaNodeKind.table, id: tableName },\n ];\n}\n\nfunction roleDependsOn(role: string): SchemaNodeRef {\n return [databaseStep(), { nodeKind: PostgresSchemaNodeKind.role, id: role }];\n}\n\n/**\n * The chains from a table-child object (foreign key, index, unique, primary\n * key) to each of the own columns it is built on, in the Postgres tree.\n * Dropping a covered column auto-drops the object, so the object's drop must\n * precede the column's; the graph derives that direction from these edges.\n */\nfunction columnDependsOn(\n namespaceId: string,\n tableName: string,\n columns: readonly string[],\n): readonly SchemaNodeRef[] {\n return columns.map((column) => [\n ...tableDependsOn(namespaceId, tableName),\n { nodeKind: RelationalSchemaNodeKind.column, id: `column:${column}` },\n ]);\n}\n\nfunction toPolicyNode(policy: PostgresRlsPolicy, namespaceId: string): PostgresPolicySchemaNode {\n return new PostgresPolicySchemaNode({\n name: policy.name,\n prefix: policy.prefix,\n tableName: policy.tableName,\n namespaceId,\n operation: policy.operation,\n roles: [...policy.roles],\n ...ifDefined('using', policy.using),\n ...ifDefined('withCheck', policy.withCheck),\n permissive: policy.permissive,\n dependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)],\n });\n}\n\n/**\n * Projects a Postgres contract into the expected schema-diff tree: a\n * `PostgresDatabaseSchemaNode` root holding one `PostgresNamespaceSchemaNode`\n * per Postgres namespace, each holding its `PostgresTableSchemaNode`s with\n * their `PostgresPolicySchemaNode`s, plus the database roles on the root.\n *\n * Not a duplicate of the family's `contractToSchemaIR`: that builds a flat,\n * single `{ tables }` map (and throws on cross-namespace name collisions, with\n * no RLS/role concept) for SQLite's single-schema world. This is the\n * Postgres-specific *tree* shape — multi-schema, RLS-policy-aware, role-aware.\n * It reuses the family's per-namespace table conversion (`contractNamespaceToSchemaIR`)\n * for column/FK/index building and only adds the Postgres tree/policy/role shape.\n *\n * Tables are grouped by their owning namespace (resolved DDL schema name) so\n * the tree mirrors Postgres's object hierarchy. The DDL schema name is\n * resolved once per namespace.\n *\n * A policy that references a table absent from its namespace is a malformed\n * contract — the loop throws rather than fabricating a stub table.\n */\nexport function contractToPostgresDatabaseSchemaNode(\n contract: PostgresContract | null,\n options: ContractToSchemaIROptions,\n): PostgresDatabaseSchemaNode {\n if (contract === null) {\n return new PostgresDatabaseSchemaNode({\n namespaces: {},\n roles: [],\n existingSchemas: [],\n pgVersion: '',\n });\n }\n\n const namespaces: Record<string, PostgresNamespaceSchemaNode> = {};\n const roles: PostgresRoleSchemaNode[] = [];\n const ownedSchemas: string[] = [];\n\n for (const ns of Object.values(contract.storage.namespaces)) {\n if (!isPostgresSchema(ns)) continue;\n\n // Role entries are root-level diff subjects: they hoist to the database\n // root from every slot and never count toward whether a namespace\n // materializes a schema node.\n for (const role of Object.values(ns.role)) {\n roles.push(new PostgresRoleSchemaNode({ name: role.name, namespaceId: role.namespaceId }));\n }\n\n // The unbound slot resolves its DDL schema to 'public', so it\n // materializes a schema node exactly when it has non-role content — a\n // late-binding contract keeps today's behavior (the slot carries the\n // tables), while a roles-only unbound slot alongside named namespaces\n // contributes only root roles and no node (which would otherwise be a\n // spurious empty 'public' node, clobbering a real bound 'public'\n // namespace's node keyed by the same resolved schema name).\n if (ns.id === UNBOUND_NAMESPACE_ID) {\n const hasNonRoleContent = Object.entries(ns.entries).some(\n ([entriesKey, slot]) => entriesKey !== 'role' && Object.keys(slot).length > 0,\n );\n if (!hasNonRoleContent) continue;\n }\n\n const ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n ownedSchemas.push(ddlSchema);\n\n // Convert only THIS namespace's tables (passing the full storage for\n // type/value-set/enum resolution that spans namespaces), so the same table\n // name can exist in two schemas without colliding in a bare-keyed record.\n const sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\n const policiesByTable = new Map<string, PostgresPolicySchemaNode[]>();\n for (const policy of Object.values(ns.policy)) {\n const list = policiesByTable.get(policy.tableName) ?? [];\n list.push(toPolicyNode(policy, ddlSchema));\n policiesByTable.set(policy.tableName, list);\n }\n\n const tables: Record<string, PostgresTableSchemaNode> = {};\n for (const tableName of Object.keys(ns.table)) {\n const sqlTable = sqlTables[tableName];\n if (sqlTable === undefined) continue;\n // The family conversion stamps `referencedSchema` only for bound FK\n // targets; an absent value means the FK targets the unbound namespace.\n // Postgres restores its own coordinate for that slot (the unbound\n // singleton's id) so the raw coordinate keeps qualifying REFERENCES\n // clauses, and resolves the real live DDL schema — introspected FKs\n // already carry the live schema, so this is what lets an expected FK\n // pair (by diff-node id) with its introspected counterpart.\n const foreignKeys = sqlTable.foreignKeys.map((fk) => {\n const resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(\n contract.storage,\n fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n );\n return new SqlForeignKeyIR({\n columns: fk.columns,\n referencedTable: fk.referencedTable,\n referencedColumns: fk.referencedColumns,\n referencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n ...ifDefined('name', fk.name),\n ...ifDefined('onDelete', fk.onDelete),\n ...ifDefined('onUpdate', fk.onUpdate),\n ...ifDefined('annotations', fk.annotations),\n resolvedReferencedNamespace,\n dependsOn: [\n tableDependsOn(resolvedReferencedNamespace, fk.referencedTable),\n ...columnDependsOn(ddlSchema, tableName, fk.columns),\n ],\n });\n });\n // The family stamped these children's own-column `dependsOn` with the\n // flat (single-schema) chain; the Postgres tree nests them under a\n // namespace, so re-stamp with the multi-schema chain that matches this\n // tree's paths. Every other field is carried through unchanged.\n const uniques = sqlTable.uniques.map(\n (u) =>\n new SqlUniqueIR({\n columns: u.columns,\n ...ifDefined('name', u.name),\n ...ifDefined('annotations', u.annotations),\n dependsOn: columnDependsOn(ddlSchema, tableName, u.columns),\n }),\n );\n const indexes = sqlTable.indexes.map(\n (i) =>\n new SqlIndexIR({\n columns: i.columns,\n unique: i.unique,\n ...ifDefined('name', i.name),\n ...ifDefined('type', i.type),\n ...ifDefined('options', i.options),\n ...ifDefined('annotations', i.annotations),\n dependsOn: columnDependsOn(ddlSchema, tableName, i.columns),\n }),\n );\n const primaryKey =\n sqlTable.primaryKey !== undefined\n ? new PrimaryKey({\n columns: sqlTable.primaryKey.columns,\n ...ifDefined('name', sqlTable.primaryKey.name),\n dependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns),\n })\n : undefined;\n tables[tableName] = new PostgresTableSchemaNode({\n name: sqlTable.name,\n columns: sqlTable.columns,\n foreignKeys,\n uniques,\n indexes,\n ...ifDefined('primaryKey', primaryKey),\n ...ifDefined('annotations', sqlTable.annotations),\n ...ifDefined('checks', sqlTable.checks),\n policies: policiesByTable.get(tableName) ?? [],\n // Marker-driven, never derived from the policy set: the `rls` entry\n // is the single authored source of enablement.\n rlsEnabled: Object.hasOwn(ns.rls, tableName),\n });\n }\n\n for (const [tableName, tablePolicies] of policiesByTable) {\n if (!(tableName in tables)) {\n const policyName = tablePolicies[0]?.name ?? '(unknown)';\n throw new Error(\n `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`,\n );\n }\n if (!Object.hasOwn(ns.rls, tableName)) {\n const policyPrefix = tablePolicies[0]?.prefix ?? '(unknown)';\n throw new Error(\n `contract-to-postgres-database-schema-node: policy \"${policyPrefix}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`,\n );\n }\n }\n\n const nativeEnums = Object.values(ns.entries.native_enum ?? {}).map(\n (entity) =>\n new PostgresNativeEnumSchemaNode({\n typeName: entity.typeName,\n namespaceId: ddlSchema,\n members: entity.members,\n ...ifDefined('control', entity.control),\n }),\n );\n\n namespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n schemaName: ddlSchema,\n tables,\n nativeEnums,\n });\n }\n\n return new PostgresDatabaseSchemaNode({\n namespaces,\n roles,\n existingSchemas: ownedSchemas,\n pgVersion: '',\n });\n}\n","import type { Contract, ControlPolicy } from '@prisma-next/contract/types';\nimport type { SqlSchemaDiffResult } from '@prisma-next/family-sql/control';\nimport { buildNativeTypeExpander } from '@prisma-next/family-sql/control';\nimport { classifyDiffSubjectGranularity } from '@prisma-next/family-sql/diff';\nimport type { TargetBoundComponentDescriptor } from '@prisma-next/framework-components/components';\nimport type { DiffableNode, SchemaDiffIssue } from '@prisma-next/framework-components/control';\nimport { diffSchemas, issueOutcome } from '@prisma-next/framework-components/control';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport type { SqlSchemaIRNode } from '@prisma-next/sql-schema-ir/types';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport type { PostgresContract } from '../postgres-schema';\nimport { PostgresDatabaseSchemaNode } from '../schema-ir/postgres-database-schema-node';\nimport { PostgresNamespaceSchemaNode } from '../schema-ir/postgres-namespace-schema-node';\nimport {\n postgresDiffSubjectGranularity,\n type SqlSchemaDiffNode,\n} from '../schema-ir/schema-node-kinds';\nimport { contractToPostgresDatabaseSchemaNode } from './contract-to-postgres-database-schema-node';\nimport { resolvePostgresNodeIssueControlPolicySubject } from './control-policy';\n\n/**\n * Whether a diff issue's subject node is cluster-scoped — it carries its own\n * `namespaceId` field (only role and policy diff nodes do) and that\n * coordinate is the unbound sentinel, meaning the node is not owned by any\n * schema/namespace. A role node is always cluster-scoped (roles are\n * cluster-level objects); a policy node's `namespaceId` is always its\n * table's resolved DDL schema, never the sentinel. Namespace-ownership\n * scoping (which compares `issue.path[1]` against the set of DDL schemas\n * the contract owns) makes no sense for a cluster-scoped subject — its path\n * segment at that index is the object's own name, not a schema name — so\n * such an issue bypasses that scoping entirely.\n */\nfunction isClusterScopedIssue(issue: SchemaDiffIssue): boolean {\n const node = issue.expected ?? issue.actual;\n return node !== undefined && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\n\nfunction nodeNamespaceId(node: DiffableNode): string | undefined {\n if (!Object.hasOwn(node, 'namespaceId')) return undefined;\n return blindCast<\n { namespaceId: string },\n 'presence of an own namespaceId field was just checked via Object.hasOwn'\n >(node).namespaceId;\n}\n\nfunction ownedSchemaNames(expected: PostgresDatabaseSchemaNode): ReadonlySet<string> {\n const policyNamespaces = Object.values(expected.namespaces).flatMap((ns) =>\n Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)),\n );\n return new Set([...policyNamespaces, ...expected.existingSchemas]);\n}\n\n/**\n * Drops contract namespaces that declare no tables from the verdict-diff\n * expected tree and the relational owned-schema set. The legacy relational\n * walk skipped a table-less namespace (e.g. an enums-only schema) before\n * pairing, so neither its DDL schema's absence nor that schema's live\n * relational contents ever reached the verdict — the pruned tree\n * reproduces that. The prune loses no expected policies: policies attach\n * to tables, so a table-less namespace carries none (the projection\n * throws on a policy referencing an absent table). Live policies in a\n * pruned schema remain governed via the full owned set (see\n * {@link diffPostgresSchema}).\n */\nfunction pruneTableLessNamespaces(\n expected: PostgresDatabaseSchemaNode,\n): PostgresDatabaseSchemaNode {\n const namespaces = Object.fromEntries(\n Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0),\n );\n return new PostgresDatabaseSchemaNode({\n namespaces,\n roles: [...expected.roles],\n existingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== undefined),\n pgVersion: expected.pgVersion,\n });\n}\n\n/**\n * Resolves a verdict-diff issue's subject's declared control policy directly\n * from the contract, by delegating to the same node-typed resolver\n * ({@link resolvePostgresNodeIssueControlPolicySubject}) the planner uses to\n * gate DDL calls. `undefined` when the issue resolves to no contract subject.\n *\n * A role issue resolves through that same resolver to `external`\n * unconditionally (see its role branch), regardless of the contract's own\n * default policy: a role is referenced by the contract but not owned, and\n * `external`'s existing semantics — a missing declared subject still fails,\n * every extra is suppressed — are exactly the wanted asymmetric grading for\n * a cluster object the framework does not own.\n */\nfunction resolveControlPolicy(\n issue: SchemaDiffIssue,\n contract: Contract<SqlStorage>,\n): ControlPolicy | undefined {\n const nodeIssue = blindCast<\n SchemaDiffIssue<SqlSchemaDiffNode>,\n 'every node in a Postgres schema diff tree is a SqlSchemaDiffNode'\n >(issue);\n return resolvePostgresNodeIssueControlPolicySubject(nodeIssue, contract)\n ?.explicitNodeControlPolicy;\n}\n\n/**\n * The Postgres full-tree node diff for the family verify verdict: derive\n * the expected tree (resolved leaf values, expander threaded, FK schemas\n * resolved, table-less namespaces pruned), run the generic\n * differ over the trees as derived, and scope out `not-expected` findings under namespaces the\n * contract does not own. Ownership scoping bypasses cluster-scoped subjects\n * (roles today), mirroring the legacy decomposition: relational extras check\n * the PRUNED owned set (the legacy\n * per-namespace walk never visited a table-less namespace, so its live\n * relational contents are invisible), while `structural` extras (RLS\n * policies) check the FULL owned set (the legacy policy diff governed\n * every contract schema regardless of tables — RLS governance does not\n * shrink because a namespace declares no tables). The codec `verifyType`\n * hooks run once per contract namespace with tables against that\n * namespace's paired actual node (the hooks read namespace-scoped state\n * such as `nativeEnums`).\n */\nexport function diffPostgresSchema(input: {\n readonly contract: Contract<SqlStorage>;\n readonly schema: SqlSchemaIRNode;\n readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;\n}): SqlSchemaDiffResult {\n const postgresContract = blindCast<\n PostgresContract,\n 'diffPostgresSchema is only called with a postgres contract'\n >(input.contract);\n PostgresDatabaseSchemaNode.assert(input.schema);\n const actual = input.schema;\n const expandNativeType = buildNativeTypeExpander(input.frameworkComponents);\n const fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n annotationNamespace: 'pg',\n ...ifDefined('expandNativeType', expandNativeType),\n });\n const expected = pruneTableLessNamespaces(fullExpected);\n const relationalOwned = ownedSchemaNames(expected);\n const structuralOwned = ownedSchemaNames(fullExpected);\n const issues = diffSchemas(expected, actual).filter((issue) => {\n if (issueOutcome(issue) !== 'not-expected') return true;\n if (isClusterScopedIssue(issue)) return true;\n const granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n const namespaceSegment = issue.path[1];\n if (namespaceSegment === undefined) return true;\n const owned = granularity === 'structural' ? structuralOwned : relationalOwned;\n return owned.has(namespaceSegment);\n });\n const namespacePairs = Object.values(expected.namespaces).map((ns) => ({\n actual: actual.namespaces[ns.schemaName],\n }));\n return {\n issues,\n resolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n namespacePairs,\n };\n}\n\n/**\n * Adds an empty namespace node to the actual tree for every expected namespace\n * absent from it. The relational plan diff pairs on namespace: a contract\n * namespace whose live schema does not exist yet must surface each of its\n * tables as `not-found` (→ `CREATE TABLE`), NOT as a single namespace\n * `not-found` that subtree-coalescing would collapse (leaving `CREATE SCHEMA`\n * with no tables). Padding makes the namespaces pair, so only table/column/\n * policy drift surfaces; `CREATE SCHEMA` comes separately from the synthesized\n * namespace-presence stitch (`verifyPostgresNamespacePresence`), never from the\n * tree diff — matching the retired per-namespace-paired relational walk, which\n * paired a missing schema against an empty namespace node.\n */\nfunction padActualNamespaces(\n expected: PostgresDatabaseSchemaNode,\n actual: PostgresDatabaseSchemaNode,\n): PostgresDatabaseSchemaNode {\n const namespaces: Record<string, PostgresNamespaceSchemaNode> = { ...actual.namespaces };\n let padded = false;\n for (const schemaName of Object.keys(expected.namespaces)) {\n if (namespaces[schemaName] === undefined) {\n namespaces[schemaName] = new PostgresNamespaceSchemaNode({\n schemaName,\n tables: {},\n });\n padded = true;\n }\n }\n if (!padded) return actual;\n return new PostgresDatabaseSchemaNode({\n namespaces,\n roles: [...actual.roles],\n existingSchemas: [...actual.existingSchemas],\n pgVersion: actual.pgVersion,\n });\n}\n\nexport interface PostgresPlanDiff {\n /** The desired (\"end\") tree — resolved leaf values (incl. `codecRef`) on every column, table-less namespaces pruned. */\n readonly expected: PostgresDatabaseSchemaNode;\n /** The live (\"start\") tree, padded with empty namespaces so a missing schema's tables pair. */\n readonly actual: PostgresDatabaseSchemaNode;\n /** The one node diff over the two trees: relational + policy drift, cluster-scope-aware ownership filtered. */\n readonly issues: readonly SchemaDiffIssue<SqlSchemaDiffNode>[];\n}\n\n/**\n * The Postgres planner's diff input: the SAME tree-building\n * `diffPostgresSchema` uses (expander threaded, FK schemas resolved,\n * table-less namespaces pruned, cluster-scope-aware ownership filter) plus\n * actual namespace padding (so a missing\n * schema's tables surface as `not-found` instead of a swallowed namespace\n * `not-found`). One differ drives both verify and plan; this is the\n * plan-side derivation. The single issue list covers tables / columns /\n * constraints / indexes / defaults AND policies — the caller splits it\n * (relational → `mapNodeIssueToCall`; policy → RLS ops) and stitches in\n * `CREATE SCHEMA` separately.\n */\nexport function buildPostgresPlanDiff(input: {\n readonly contract: Contract<SqlStorage>;\n readonly actualSchema: SqlSchemaIRNode;\n readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;\n}): PostgresPlanDiff {\n const postgresContract = blindCast<\n PostgresContract,\n 'buildPostgresPlanDiff is only called with a postgres contract'\n >(input.contract);\n PostgresDatabaseSchemaNode.assert(input.actualSchema);\n const actual = input.actualSchema;\n const expandNativeType = buildNativeTypeExpander(input.frameworkComponents);\n const projectionOptions = {\n annotationNamespace: 'pg',\n ...ifDefined('expandNativeType', expandNativeType),\n };\n const fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, projectionOptions);\n const expected = pruneTableLessNamespaces(fullExpected);\n const paddedActual = padActualNamespaces(expected, actual);\n const relationalOwned = ownedSchemaNames(expected);\n const structuralOwned = ownedSchemaNames(fullExpected);\n const issues = blindCast<\n readonly SchemaDiffIssue<SqlSchemaDiffNode>[],\n 'both trees are PostgresDatabaseSchemaNodes, so every diff-issue node is a SqlSchemaDiffNode'\n >(diffSchemas(expected, paddedActual)).filter((issue) => {\n if (issueOutcome(issue) !== 'not-expected') return true;\n if (isClusterScopedIssue(issue)) return true;\n const granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n const namespaceSegment = issue.path[1];\n if (namespaceSegment === undefined) return true;\n const owned = granularity === 'structural' ? structuralOwned : relationalOwned;\n return owned.has(namespaceSegment);\n });\n return { expected, actual: paddedActual, issues };\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAS,eAAmE;CAC1E,OAAO;EAAE,UAAU,uBAAuB;EAAU,IAAI;CAAW;AACrE;AAEA,SAAS,eAAe,aAAqB,WAAkC;CAC7E,OAAO;EACL,aAAa;EACb;GAAE,UAAU,uBAAuB;GAAW,IAAI;EAAY;EAC9D;GAAE,UAAU,uBAAuB;GAAO,IAAI;EAAU;CAC1D;AACF;AAEA,SAAS,cAAc,MAA6B;CAClD,OAAO,CAAC,aAAa,GAAG;EAAE,UAAU,uBAAuB;EAAM,IAAI;CAAK,CAAC;AAC7E;;;;;;;AAQA,SAAS,gBACP,aACA,WACA,SAC0B;CAC1B,OAAO,QAAQ,KAAK,WAAW,CAC7B,GAAG,eAAe,aAAa,SAAS,GACxC;EAAE,UAAU,yBAAyB;EAAQ,IAAI,UAAU;CAAS,CACtE,CAAC;AACH;AAEA,SAAS,aAAa,QAA2B,aAA+C;CAC9F,OAAO,IAAI,yBAAyB;EAClC,MAAM,OAAO;EACb,QAAQ,OAAO;EACf,WAAW,OAAO;EAClB;EACA,WAAW,OAAO;EAClB,OAAO,CAAC,GAAG,OAAO,KAAK;EACvB,GAAG,UAAU,SAAS,OAAO,KAAK;EAClC,GAAG,UAAU,aAAa,OAAO,SAAS;EAC1C,YAAY,OAAO;EACnB,WAAW,CAAC,eAAe,aAAa,OA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AAkB,iBAAiB,YAAY;CAarD,OAAO;EAAE;EAAU,QAAQ;EAAc,QAZ1B,UAGb,YAAY,UAAU,YAAY,CAAC,CAAC,CAAC,QAAQ,UAAU;GACvD,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO;GACnD,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,MAAM,cAAc,+BAA+B,OAAO,8BAA8B;GACxF,MAAM,mBAAmB,MAAM,KAAK;GACpC,IAAI,qBAAqB,KAAA,GAAW,OAAO;GAE3C,QADc,gBAAgB,eAAe,kBAAkB,gBAAA,CAClD,IAAI,gBAAgB;EACnC,CAC8C;CAAE;AAClD"}
@@ -1,20 +1,11 @@
1
- import { t as PostgresDatabaseSchemaNode } from "./postgres-database-schema-node-CJv5bfbs.mjs";
1
+ import { t as PostgresDatabaseSchemaNode } from "./postgres-database-schema-node-DJOTywwQ.mjs";
2
+ import { n as SqlSchemaDiffNode } from "./schema-node-kinds-CrYzCR1i.mjs";
2
3
  import { SqlStorage } from "@prisma-next/sql-contract/types";
3
4
  import { SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
4
- import { DiffableNode, SchemaDiffIssue } from "@prisma-next/framework-components/control";
5
+ import { SchemaDiffIssue } from "@prisma-next/framework-components/control";
5
6
  import { Contract } from "@prisma-next/contract/types";
6
7
  import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
7
8
 
8
- //#region src/core/schema-ir/schema-node-kinds.d.ts
9
- /**
10
- * A Postgres schema-diff-tree node: a `SqlSchemaIRNode` that also implements
11
- * `DiffableNode` (the five `Postgres*SchemaNode` classes). `SqlSchemaIRNode`
12
- * alone is not a `DiffableNode` — its relational subclasses (`SqlColumnIR`, …)
13
- * carry no `id`/`isEqualTo`/`children` — so this intersection is the honest node
14
- * type the differ produces and the planner consumes (`SchemaDiff<SqlSchemaDiffNode>`).
15
- */
16
- type SqlSchemaDiffNode = SqlSchemaIRNode & DiffableNode;
17
- //#endregion
18
9
  //#region src/core/migrations/diff-database-schema.d.ts
19
10
  interface PostgresPlanDiff {
20
11
  /** The desired ("end") tree — resolved leaf values (incl. `codecRef`) on every column, table-less namespaces pruned. */
@@ -1 +1 @@
1
- {"version":3,"file":"diff-database-schema.d.mts","names":[],"sources":["../src/core/schema-ir/schema-node-kinds.ts","../src/core/migrations/diff-database-schema.ts"],"mappings":";;;;;;;;;;;;;;;KAiBY,iBAAA,GAAoB,eAAA,GAAkB,YAAY;;;UCmL7C,gBAAA;EAMW;EAAA,SAJjB,QAAA,EAAU,0BAAA;EAIwC;EAAA,SAFlD,MAAA,EAAQ,0BAAA;EAiBH;EAAA,SAfL,MAAA,WAAiB,eAAA,CAAgB,iBAAA;AAAA;;;;;;;;;;;;;iBAe5B,qBAAA,CAAsB,KAAA;EAAA,SAC3B,QAAA,EAAU,QAAA,CAAS,UAAA;EAAA,SACnB,YAAA,EAAc,eAAA;EAAA,SACd,mBAAA,EAAqB,aAAA,CAAc,8BAAA;AAAA,IAC1C,gBAAA"}
1
+ {"version":3,"file":"diff-database-schema.d.mts","names":[],"sources":["../src/core/migrations/diff-database-schema.ts"],"mappings":";;;;;;;;;UAoMiB,gBAAA;EAsBa;EAAA,SApBnB,QAAA,EAAU,0BAAA;EAqBI;EAAA,SAnBd,MAAA,EAAQ,0BAAA;EAoBa;EAAA,SAlBrB,MAAA,WAAiB,eAAA,CAAgB,iBAAA;AAAA;;;;;;;;;;;;;iBAe5B,qBAAA,CAAsB,KAAA;EAAA,SAC3B,QAAA,EAAU,QAAA,CAAS,UAAA;EAAA,SACnB,YAAA,EAAc,eAAA;EAAA,SACd,mBAAA,EAAqB,aAAA,CAAc,8BAAA;AAAA,IAC1C,gBAAA"}
@@ -1,2 +1,2 @@
1
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-Bfgshz4v.mjs";
1
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-oY3brcLj.mjs";
2
2
  export { buildPostgresPlanDiff };
@@ -1,4 +1,4 @@
1
- import { w as PostgresOpFactoryCall } from "./op-factory-call-Bn9zDx4_.mjs";
1
+ import { O as PostgresOpFactoryCall } from "./op-factory-call-CvH0JeBW.mjs";
2
2
  import { SqlStorage, StorageTable, StorageTypeInstance } from "@prisma-next/sql-contract/types";
3
3
  import { CodecControlHooks, MigrationOperationPolicy, SqlPlannerConflict } from "@prisma-next/family-sql/control";
4
4
  import { SqlColumnIR, SqlSchemaIR, SqlSchemaIRNode } from "@prisma-next/sql-schema-ir/types";
@@ -1 +1 @@
1
- {"version":3,"file":"issue-planner.d.mts","names":[],"sources":["../src/core/migrations/planner-strategies.ts","../src/core/migrations/issue-planner.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAwIiB,eAAA;EAAA,SACN,UAAA,EAAY,QAAA,CAAS,UAAA;EAAA,SACrB,YAAA,EAAc,QAAA,CAAS,UAAA;EAAA,SACvB,UAAA;EAAA,SACA,UAAA,EAAY,WAAA,SAAoB,iBAAA;EAAA,SAChC,YAAA,EAAc,QAAA,CAAS,MAAA,SAAe,mBAAA;EAAA,SACtC,MAAA,EAAQ,WAAA;EAAA,SACR,MAAA,EAAQ,wBAAA;EAAA,SACR,mBAAA,EAAqB,aAAA,CAAc,8BAAA;AAAA;;AChB9C;;;;AACgD;AAkThD;KDrRY,qBAAA,IACV,MAAA,WAAiB,eAAA,IACjB,OAAA,EAAS,eAAA;EAGL,IAAA;EACA,MAAA,WAAiB,eAAA;EACjB,KAAA,WAAgB,qBAAA;EC+Qa;;;;;;;EDvQ7B,MAAA;AAAA;EAEA,IAAA;AAAA;;;UC/CW,iBAAA;EAAA,SACN,KAAA,WAAgB,qBAAqB;AAAA;;;;;;;;;;iBAkThC,qBAAA,eAAoC,YAAA,GAAe,YAAA,EACjE,MAAA,WAAiB,eAAA,CAAgB,KAAA,eACvB,eAAA,CAAgB,KAAA;AAAA,UAgiBX,mBAAA;EAAA,SACN,MAAA,WAAiB,eAAA;EAAA,SACjB,UAAA,EAAY,QAAA,CAAS,UAAA;EAAA,SACrB,YAAA,EAAc,QAAA,CAAS,UAAA;EAAA,SACvB,UAAA;EAAA,SACA,UAAA,EAAY,WAAA,SAAoB,iBAAA;EAAA,SAChC,YAAA,EAAc,QAAA,CAAS,MAAA,SAAe,mBAAA;EAviBd;;;;;;;EAAA,SA+iBxB,MAAA,GAAS,WAAA;EAhjB+C;;;;;EAAA,SAsjBxD,MAAA,GAAS,wBAAA;EApjBa;AAAA;AAgiBjC;;EAhiBiC,SAyjBtB,mBAAA,GAAsB,aAAA,CAAc,8BAAA;EAAA,SACpC,UAAA,YAAsB,qBAAA;AAAA;;;;;;;;iBAUjB,UAAA,CACd,OAAA,EAAS,mBAAA,GACR,MAAA,CAAO,iBAAA,WAA4B,kBAAA"}
1
+ {"version":3,"file":"issue-planner.d.mts","names":[],"sources":["../src/core/migrations/planner-strategies.ts","../src/core/migrations/issue-planner.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAyIiB,eAAA;EAAA,SACN,UAAA,EAAY,QAAA,CAAS,UAAA;EAAA,SACrB,YAAA,EAAc,QAAA,CAAS,UAAA;EAAA,SACvB,UAAA;EAAA,SACA,UAAA,EAAY,WAAA,SAAoB,iBAAA;EAAA,SAChC,YAAA,EAAc,QAAA,CAAS,MAAA,SAAe,mBAAA;EAAA,SACtC,MAAA,EAAQ,WAAA;EAAA,SACR,MAAA,EAAQ,wBAAA;EAAA,SACR,mBAAA,EAAqB,aAAA,CAAc,8BAAA;AAAA;;AChB9C;;;;AACgD;AAwQhD;KD3OY,qBAAA,IACV,MAAA,WAAiB,eAAA,IACjB,OAAA,EAAS,eAAA;EAGL,IAAA;EACA,MAAA,WAAiB,eAAA;EACjB,KAAA,WAAgB,qBAAA;ECqOa;;;;;;;ED7N7B,MAAA;AAAA;EAEA,IAAA;AAAA;;;UC/CW,iBAAA;EAAA,SACN,KAAA,WAAgB,qBAAqB;AAAA;;;;;;;;;;iBAwQhC,qBAAA,eAAoC,YAAA,GAAe,YAAA,EACjE,MAAA,WAAiB,eAAA,CAAgB,KAAA,eACvB,eAAA,CAAgB,KAAA;AAAA,UAgiBX,mBAAA;EAAA,SACN,MAAA,WAAiB,eAAA;EAAA,SACjB,UAAA,EAAY,QAAA,CAAS,UAAA;EAAA,SACrB,YAAA,EAAc,QAAA,CAAS,UAAA;EAAA,SACvB,UAAA;EAAA,SACA,UAAA,EAAY,WAAA,SAAoB,iBAAA;EAAA,SAChC,YAAA,EAAc,QAAA,CAAS,MAAA,SAAe,mBAAA;EAjzBhC;;;;AAC+B;AAwQhD;;EAzQiB,SAyzBN,MAAA,GAAS,WAAA;EAhjBgC;;;;;EAAA,SAsjBzC,MAAA,GAAS,wBAAA;EApjBO;;;;EAAA,SAyjBhB,mBAAA,GAAsB,aAAA,CAAc,8BAAA;EAAA,SACpC,UAAA,YAAsB,qBAAA;AAAA;;;;;AA1jBA;AAgiBjC;;iBAoCgB,UAAA,CACd,OAAA,EAAS,mBAAA,GACR,MAAA,CAAO,iBAAA,WAA4B,kBAAA"}
@@ -1,2 +1,2 @@
1
- import { l as planIssues, o as coalesceSubtreeIssues } from "./control-policy-1Tcf7Tyu.mjs";
1
+ import { l as planIssues, o as coalesceSubtreeIssues } from "./control-policy-DaLdbcYE.mjs";
2
2
  export { coalesceSubtreeIssues, planIssues };
@@ -1,6 +1,6 @@
1
1
  import { n as DataTransformOptions, r as dataTransform, t as DataTransformClosure } from "./data-transform-DPzwBMhW.mjs";
2
- import { k as Op } from "./op-factory-call-Bn9zDx4_.mjs";
3
- import { t as PostgresMigration } from "./postgres-migration-DbckK1su.mjs";
2
+ import { P as Op } from "./op-factory-call-CvH0JeBW.mjs";
3
+ import { t as PostgresMigration } from "./postgres-migration-ulfqRGA1.mjs";
4
4
  import { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from "@prisma-next/sql-relational-core/contract-free";
5
5
  import { placeholder } from "@prisma-next/errors/migration";
6
6
  import { MigrationCLI } from "@prisma-next/cli/migration-cli";
@@ -1,6 +1,6 @@
1
- import { P as createExtension } from "./op-factory-call-C38NzvQD.mjs";
1
+ import { P as createExtension } from "./op-factory-call-tBcLo_B8.mjs";
2
2
  import { t as dataTransform } from "./data-transform-BOWpliq8.mjs";
3
- import { t as PostgresMigration } from "./postgres-migration-arMSWU9b.mjs";
3
+ import { t as PostgresMigration } from "./postgres-migration-Bt3sXoID.mjs";
4
4
  import { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from "@prisma-next/sql-relational-core/contract-free";
5
5
  import { placeholder } from "@prisma-next/errors/migration";
6
6
  import { MigrationCLI } from "@prisma-next/cli/migration-cli";
@@ -171,7 +171,6 @@ declare class AddNotNullColumnDirectCall extends PostgresOpFactoryCallNode {
171
171
  constructor(schemaName: string, tableName: string, columnName: string, column: DdlColumn);
172
172
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
173
173
  renderTypeScript(): string;
174
- importRequirements(): readonly ImportRequirement[];
175
174
  }
176
175
  /**
177
176
  * Planner-internal call for adding a NOT NULL column (no contract default)
@@ -205,7 +204,6 @@ declare class AddNotNullColumnWithTempDefaultCall extends PostgresOpFactoryCallN
205
204
  });
206
205
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
207
206
  renderTypeScript(): string;
208
- importRequirements(): readonly ImportRequirement[];
209
207
  }
210
208
  declare class AddPrimaryKeyCall extends PostgresOpFactoryCallNode {
211
209
  readonly factoryName: "addPrimaryKey";
@@ -429,6 +427,7 @@ declare class CreatePostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
429
427
  constructor(schemaName: string, tableName: string, policy: PostgresRlsPolicy);
430
428
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
431
429
  renderTypeScript(): string;
430
+ importRequirements(): readonly ImportRequirement[];
432
431
  }
433
432
  declare class DropPostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
434
433
  readonly factoryName: "dropRlsPolicy";
@@ -440,6 +439,7 @@ declare class DropPostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
440
439
  constructor(schemaName: string, tableName: string, policyName: string);
441
440
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
442
441
  renderTypeScript(): string;
442
+ importRequirements(): readonly ImportRequirement[];
443
443
  }
444
444
  declare class EnableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
445
445
  readonly factoryName: "enableRowLevelSecurity";
@@ -450,6 +450,7 @@ declare class EnableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
450
450
  constructor(schemaName: string, tableName: string);
451
451
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
452
452
  renderTypeScript(): string;
453
+ importRequirements(): readonly ImportRequirement[];
453
454
  }
454
455
  declare class DisableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
455
456
  readonly factoryName: "disableRowLevelSecurity";
@@ -460,6 +461,7 @@ declare class DisableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
460
461
  constructor(schemaName: string, tableName: string);
461
462
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
462
463
  renderTypeScript(): string;
464
+ importRequirements(): readonly ImportRequirement[];
463
465
  }
464
466
  declare class RenamePostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
465
467
  readonly factoryName: "renameRlsPolicy";
@@ -472,8 +474,9 @@ declare class RenamePostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
472
474
  constructor(schemaName: string, tableName: string, oldPolicyName: string, newPolicyName: string);
473
475
  toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
474
476
  renderTypeScript(): string;
477
+ importRequirements(): readonly ImportRequirement[];
475
478
  }
476
479
  type PostgresOpFactoryCall = CreateTableCall | DropTableCall | AddColumnCall | DropColumnCall | AlterColumnTypeCall | SetNotNullCall | DropNotNullCall | SetDefaultCall | DropDefaultCall | AddNotNullColumnDirectCall | AddNotNullColumnWithTempDefaultCall | AddPrimaryKeyCall | AddForeignKeyCall | AddUniqueCall | AddCheckConstraintCall | DropCheckConstraintCall | CreateIndexCall | DropIndexCall | DropConstraintCall | RawSqlCall | CreateExtensionCall | CreateSchemaCall | CreateNativeEnumTypeCall | DropNativeEnumTypeCall | AddNativeEnumValueCall | CreatePostgresRlsPolicyCall | DropPostgresRlsPolicyCall | EnableRowLevelSecurityCall | DisableRowLevelSecurityCall | RenamePostgresRlsPolicyCall | DataTransformCall;
477
480
  //#endregion
478
- export { DropTableCall as C, SetNotNullCall as D, SetDefaultCall as E, ForeignKeySpec as O, DropNotNullCall as S, RawSqlCall as T, DropColumnCall as _, AddNotNullColumnWithTempDefaultCall as a, DropIndexCall as b, AlterColumnTypeCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DropCheckConstraintCall as g, DataTransformCall as h, AddNativeEnumValueCall as i, Op$1 as k, AlterColumnTypeOptions as l, CreateTableCall as m, AddColumnCall as n, AddPrimaryKeyCall as o, CreateSchemaCall as p, AddForeignKeyCall as r, AddUniqueCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropConstraintCall as v, PostgresOpFactoryCall as w, DropNativeEnumTypeCall as x, DropDefaultCall as y };
479
- //# sourceMappingURL=op-factory-call-Bn9zDx4_.d.mts.map
481
+ export { RenamePostgresRlsPolicyCall as A, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, SetNotNullCall as M, ForeignKeySpec as N, PostgresOpFactoryCall as O, Op$1 as P, DropIndexCall as S, DropPostgresRlsPolicyCall as T, DisableRowLevelSecurityCall as _, AddNotNullColumnWithTempDefaultCall as a, DropConstraintCall as b, AlterColumnTypeCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddNativeEnumValueCall as i, SetDefaultCall as j, RawSqlCall as k, AlterColumnTypeOptions as l, CreateSchemaCall as m, AddColumnCall as n, AddPrimaryKeyCall as o, CreatePostgresRlsPolicyCall as p, AddForeignKeyCall as r, AddUniqueCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y };
482
+ //# sourceMappingURL=op-factory-call-CvH0JeBW.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-CvH0JeBW.d.mts","names":[],"sources":["../src/core/migrations/operations/shared.ts","../src/core/migrations/op-factory-call.ts"],"mappings":";;;;;;;;;;KAKY,IAAA,GAAK,yBAAyB,CAAC,yBAAA;;;;;;UAO1B,cAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;IAAA,SACE,MAAA;IAAA,SACA,KAAA;IAAA,SACA,OAAA;EAAA;EAAA,SAEF,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAiB;AAAA;;;KCoElC,EAAA,GAAK,yBAAyB,CAAC,yBAAA;AAAA,uBAgBrB,yBAAA,SAAkC,YAAA,YAAwB,aAAA;EAAA,kBACrD,WAAA;EAAA,kBACA,cAAA,EAAgB,uBAAA;EAAA,kBAChB,KAAA;EAAA,SACT,IAAA,CAAK,OAAA,GAAU,OAAA,GAAU,EAAA,GAAK,OAAA,CAAQ,EAAA;EAE/C,kBAAA,aAA+B,iBAAA;EAAA,UAIrB,MAAA;AAAA;AAAA,cAsGC,eAAA,SAAwB,yBAAA;EAAA,SAC1B,WAAA;EAAA,SACA,cAAA;EAAA,SACA,UAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA,WAAkB,SAAA;EAAA,SAClB,WAAA,WAAsB,kBAAA;EAAA,SACtB,KAAA;cAGP,UAAA,UACA,SAAA,UACA,OAAA,WAAkB,SAAA,IAClB,WAAA,YAAuB,kBAAA;EAWnB,IAAA,CAAK,OAAA,GAAU,qBAAA,GAAwB,OAAA,CAAQ,EAAA;EAoCrD,gBAAA;EAiBS,kBAAA,aAA+B,iBAAA;AAAA;AAAA,cAe7B,aAAA,SAAsB,yBAAA;EAAA,SACxB,WAAA;EAAA,SACA,cAAA;EAAA,SACA,UAAA;EAAA,SACA,SAAA;EAAA,SACA,KAAA;cAEG,UAAA,UAAoB,SAAA;EAQ1B,IAAA,CAAK,OA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A;AAAA,cAK7B,2BAAA,SAAoC,yBAAA;EAAA,SACtC,WAAA;EAAA,SAKA,cAAA;EAAA,SACA,UAAA;EAAA,SACA,SAAA;EAAA,SACA,aAAA;EAAA,SACA,aAAA;EAAA,SACA,KAAA;cAEG,UAAA,UAAoB,SAAA,UAAmB,aAAA,UAAuB,aAAA;EAUpE,IAAA,CAAK,OAAA,GAAU,qBAAA,GAAwB,OAAA,CAAQ,EAAA;EAerD,gBAAA;EAIS,kBAAA,aAA+B,iBAAA;AAAA;AAAA,KAK9B,qBAAA,GACR,eAAA,GACA,aAAA,GACA,aAAA,GACA,cAAA,GACA,mBAAA,GACA,cAAA,GACA,eAAA,GACA,cAAA,GACA,eAAA,GACA,0BAAA,GACA,mCAAA,GACA,iBAAA,GACA,iBAAA,GACA,aAAA,GACA,sBAAA,GACA,uBAAA,GACA,eAAA,GACA,aAAA,GACA,kBAAA,GACA,UAAA,GACA,mBAAA,GACA,gBAAA,GACA,wBAAA,GACA,sBAAA,GACA,sBAAA,GACA,2BAAA,GACA,yBAAA,GACA,0BAAA,GACA,2BAAA,GACA,2BAAA,GACA,iBAAA"}
@@ -1235,9 +1235,6 @@ var AddNotNullColumnDirectCall = class extends PostgresOpFactoryCallNode {
1235
1235
  operationClass: "additive"
1236
1236
  })})`;
1237
1237
  }
1238
- importRequirements() {
1239
- return [];
1240
- }
1241
1238
  };
1242
1239
  /**
1243
1240
  * Planner-internal call for adding a NOT NULL column (no contract default)
@@ -1292,9 +1289,6 @@ var AddNotNullColumnWithTempDefaultCall = class extends PostgresOpFactoryCallNod
1292
1289
  operationClass: "additive"
1293
1290
  })})`;
1294
1291
  }
1295
- importRequirements() {
1296
- return [];
1297
- }
1298
1292
  };
1299
1293
  function constraintCallOptions(schemaName, tableName, constraintName) {
1300
1294
  const opts = [];
@@ -1828,7 +1822,22 @@ var CreatePostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
1828
1822
  return createRlsPolicy(this.schemaName, this.tableName, this.policy, lowerer);
1829
1823
  }
1830
1824
  renderTypeScript() {
1831
- return `createRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.policy)})`;
1825
+ const p = this.policy;
1826
+ const input = {
1827
+ name: p.name,
1828
+ prefix: p.prefix,
1829
+ tableName: p.tableName,
1830
+ namespaceId: p.namespaceId,
1831
+ operation: p.operation,
1832
+ roles: p.roles,
1833
+ ...ifDefined("using", p.using),
1834
+ ...ifDefined("withCheck", p.withCheck),
1835
+ permissive: p.permissive
1836
+ };
1837
+ return `this.createRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, policy: ${jsonToTsSource(input)} })`;
1838
+ }
1839
+ importRequirements() {
1840
+ return [];
1832
1841
  }
1833
1842
  };
1834
1843
  var DropPostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
@@ -1851,7 +1860,10 @@ var DropPostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
1851
1860
  return dropRlsPolicy(this.schemaName, this.tableName, this.policyName, lowerer);
1852
1861
  }
1853
1862
  renderTypeScript() {
1854
- return `dropRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.policyName)})`;
1863
+ return `this.dropRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, policy: ${jsonToTsSource(this.policyName)} })`;
1864
+ }
1865
+ importRequirements() {
1866
+ return [];
1855
1867
  }
1856
1868
  };
1857
1869
  var EnableRowLevelSecurityCall = class extends PostgresOpFactoryCallNode {
@@ -1872,7 +1884,10 @@ var EnableRowLevelSecurityCall = class extends PostgresOpFactoryCallNode {
1872
1884
  return enableRowLevelSecurity(this.schemaName, this.tableName, lowerer);
1873
1885
  }
1874
1886
  renderTypeScript() {
1875
- return `enableRowLevelSecurity(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;
1887
+ return `this.enableRowLevelSecurity({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)} })`;
1888
+ }
1889
+ importRequirements() {
1890
+ return [];
1876
1891
  }
1877
1892
  };
1878
1893
  var DisableRowLevelSecurityCall = class extends PostgresOpFactoryCallNode {
@@ -1893,7 +1908,10 @@ var DisableRowLevelSecurityCall = class extends PostgresOpFactoryCallNode {
1893
1908
  return disableRowLevelSecurity(this.schemaName, this.tableName, lowerer);
1894
1909
  }
1895
1910
  renderTypeScript() {
1896
- return `disableRowLevelSecurity(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;
1911
+ return `this.disableRowLevelSecurity({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)} })`;
1912
+ }
1913
+ importRequirements() {
1914
+ return [];
1897
1915
  }
1898
1916
  };
1899
1917
  var RenamePostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
@@ -1918,10 +1936,13 @@ var RenamePostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
1918
1936
  return renameRlsPolicy(this.schemaName, this.tableName, this.oldPolicyName, this.newPolicyName, lowerer);
1919
1937
  }
1920
1938
  renderTypeScript() {
1921
- return `renameRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.oldPolicyName)}, ${jsonToTsSource(this.newPolicyName)})`;
1939
+ return `this.renameRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, from: ${jsonToTsSource(this.oldPolicyName)}, to: ${jsonToTsSource(this.newPolicyName)} })`;
1940
+ }
1941
+ importRequirements() {
1942
+ return [];
1922
1943
  }
1923
1944
  };
1924
1945
  //#endregion
1925
1946
  export { SetDefaultCall as A, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, installExtension as F, postgresDefaultToDdlColumnDefault as M, buildTargetDetails as N, RawSqlCall as O, createExtension as P, DropIndexCall as S, DropPostgresRlsPolicyCall as T, DisableRowLevelSecurityCall as _, AddNotNullColumnDirectCall as a, DropConstraintCall as b, AddUniqueCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddNativeEnumValueCall as i, SetNotNullCall as j, RenamePostgresRlsPolicyCall as k, AlterColumnTypeCall as l, CreateSchemaCall as m, AddColumnCall as n, AddNotNullColumnWithTempDefaultCall as o, CreatePostgresRlsPolicyCall as p, AddForeignKeyCall as r, AddPrimaryKeyCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y };
1926
1947
 
1927
- //# sourceMappingURL=op-factory-call-C38NzvQD.mjs.map
1948
+ //# sourceMappingURL=op-factory-call-tBcLo_B8.mjs.map