@prisma/orm-target-postgres 8.0.0-rc.14-dev.11 → 8.0.0-rc.14-dev.13

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 (94) hide show
  1. package/dist/{adapter-Bb_FFDea-Bnp9ew_B.mjs → adapter-Bb_FFDea-DyyfToJz.mjs} +2 -2
  2. package/dist/{adapter-Bb_FFDea-Bnp9ew_B.mjs.map → adapter-Bb_FFDea-DyyfToJz.mjs.map} +1 -1
  3. package/dist/adapter.mjs +2 -2
  4. package/dist/adapter__adapter.mjs +1 -1
  5. package/dist/adapter__control.mjs +3 -3
  6. package/dist/adapter__runtime.mjs +2 -2
  7. package/dist/{authoring-2oKPEpBv-DfCFpeuD.mjs → authoring-DULm2ZZP-DgykBF-F.mjs} +4 -4
  8. package/dist/{authoring-2oKPEpBv-DfCFpeuD.mjs.map → authoring-DULm2ZZP-DgykBF-F.mjs.map} +1 -1
  9. package/dist/{contract-free-B2-ZWT2L.mjs → contract-free-C0GQe4X_.mjs} +3 -3
  10. package/dist/{contract-free-B2-ZWT2L.mjs.map → contract-free-C0GQe4X_.mjs.map} +1 -1
  11. package/dist/{control-D5Vb1l8F.mjs → control-BMhsfqMy.mjs} +13 -25
  12. package/dist/control-BMhsfqMy.mjs.map +1 -0
  13. package/dist/{control-CUzQZfhu.d.mts → control-D7_yfEfH.d.mts} +5 -2
  14. package/dist/{control-CUzQZfhu.d.mts.map → control-D7_yfEfH.d.mts.map} +1 -1
  15. package/dist/{control-adapter-C6kz--Q4-CAryb7mj.mjs → control-adapter-C6kz--Q4-BBli0l1k.mjs} +4 -4
  16. package/dist/{control-adapter-C6kz--Q4-CAryb7mj.mjs.map → control-adapter-C6kz--Q4-BBli0l1k.mjs.map} +1 -1
  17. package/dist/{control-policy-API5I4jr-ivEvCf_e.mjs → control-policy-CThlWQ8k-m3CT6KpR.mjs} +28 -15
  18. package/dist/control-policy-CThlWQ8k-m3CT6KpR.mjs.map +1 -0
  19. package/dist/{ddl-BEslwyjE-CzNPjhh1.mjs → ddl-C6M0Hkbe-BSSauy2X.mjs} +3 -3
  20. package/dist/{ddl-BEslwyjE-CzNPjhh1.mjs.map → ddl-C6M0Hkbe-BSSauy2X.mjs.map} +1 -1
  21. package/dist/{descriptor-meta-B1rbY3IE-I1ec-I6j.mjs → descriptor-meta-JJJwM3Gl-BcH0pYOV.mjs} +4 -4
  22. package/dist/{descriptor-meta-B1rbY3IE-I1ec-I6j.mjs.map → descriptor-meta-JJJwM3Gl-BcH0pYOV.mjs.map} +1 -1
  23. package/dist/{diff-database-schema-MymRFpdQ-CyY82tmS.mjs → diff-database-schema-Bp0uC68P-NxeVJERq.mjs} +7 -7
  24. package/dist/{diff-database-schema-MymRFpdQ-CyY82tmS.mjs.map → diff-database-schema-Bp0uC68P-NxeVJERq.mjs.map} +1 -1
  25. package/dist/{infer-psl-contract-CsDvYcvN-CMQR2WNf.mjs → infer-psl-contract-ChPangpl-CxL4__yw.mjs} +5 -5
  26. package/dist/{infer-psl-contract-CsDvYcvN-CMQR2WNf.mjs.map → infer-psl-contract-ChPangpl-CxL4__yw.mjs.map} +1 -1
  27. package/dist/{issue-planner-C4iR-Ik-.d.mts → issue-planner-WWpJ3gOQ.d.mts} +2 -2
  28. package/dist/{issue-planner-C4iR-Ik-.d.mts.map → issue-planner-WWpJ3gOQ.d.mts.map} +1 -1
  29. package/dist/{migration-BTiY0PPC.d.mts → migration-DwqTcQ5d.d.mts} +3 -3
  30. package/dist/{migration-BTiY0PPC.d.mts.map → migration-DwqTcQ5d.d.mts.map} +1 -1
  31. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  32. package/dist/{op-factory-call-VLJFI-b_-Du23HNYc.d.mts → op-factory-call-CmhDgfov-BjHdIpND.d.mts} +24 -7
  33. package/dist/op-factory-call-CmhDgfov-BjHdIpND.d.mts.map +1 -0
  34. package/dist/{op-factory-call-uRJcYmJG-Bpyq2pCt.mjs → op-factory-call-DYkz28kP-4BmpSB4B.mjs} +81 -18
  35. package/dist/op-factory-call-DYkz28kP-4BmpSB4B.mjs.map +1 -0
  36. package/dist/op-factory-call-DbjizP4b.d.mts +1 -0
  37. package/dist/{planner-Bp89yaJS-4TV82o0Y.mjs → planner-B_ILQa75-CoVpbzCr.mjs} +32 -214
  38. package/dist/planner-B_ILQa75-CoVpbzCr.mjs.map +1 -0
  39. package/dist/{planner-SLaWpf7q.d.mts → planner-fD25Vk53.d.mts} +2 -41
  40. package/dist/{planner-SLaWpf7q.d.mts.map → planner-fD25Vk53.d.mts.map} +1 -1
  41. package/dist/{planner-produced-postgres-migration-D7vODJo4-BoaNLGvs.mjs → planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs} +3 -3
  42. package/dist/{planner-produced-postgres-migration-D7vODJo4-BoaNLGvs.mjs.map → planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs.map} +1 -1
  43. package/dist/{planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.d.mts → planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.d.mts} +3 -3
  44. package/dist/planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.d.mts.map +1 -0
  45. package/dist/planner-produced-postgres-migration-DJFPEI7l.d.mts +1 -0
  46. package/dist/{planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs → planner-sql-checks-Bxz8yvg8-Bj6jGClB.mjs} +3 -3
  47. package/dist/{planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs.map → planner-sql-checks-Bxz8yvg8-Bj6jGClB.mjs.map} +1 -1
  48. package/dist/{postgres-contract-view-CUWYe586-CHykrpRs.mjs → postgres-contract-view-BEp5ikai-BmYXd1MR.mjs} +4 -4
  49. package/dist/{postgres-contract-view-CUWYe586-CHykrpRs.mjs.map → postgres-contract-view-BEp5ikai-BmYXd1MR.mjs.map} +1 -1
  50. package/dist/postgres-migration-DWtr5s00-CSlA4I1U.mjs +569 -0
  51. package/dist/postgres-migration-DWtr5s00-CSlA4I1U.mjs.map +1 -0
  52. package/dist/{postgres-migration-B03W06rR-DTB0R3cj.d.mts → postgres-migration-vpMSrXLQ-CJ72Zey3.d.mts} +19 -3
  53. package/dist/postgres-migration-vpMSrXLQ-CJ72Zey3.d.mts.map +1 -0
  54. package/dist/{postgres-schema-yugFGBdS-5cY1PCmb.mjs → postgres-schema-C8slJGZo-CFGUyJPt.mjs} +3 -3
  55. package/dist/{postgres-schema-yugFGBdS-5cY1PCmb.mjs.map → postgres-schema-C8slJGZo-CFGUyJPt.mjs.map} +1 -1
  56. package/dist/{prisma7-binding-D8_eGy5l.mjs → prisma7-binding-Cajs2zo2.mjs} +5 -5
  57. package/dist/{prisma7-binding-D8_eGy5l.mjs.map → prisma7-binding-Cajs2zo2.mjs.map} +1 -1
  58. package/dist/{resolve-ddl-schema-euaYYSHi-DM7kyWEw.mjs → resolve-ddl-schema-Bq4m2dD9-DrlUipYU.mjs} +3 -3
  59. package/dist/{resolve-ddl-schema-euaYYSHi-DM7kyWEw.mjs.map → resolve-ddl-schema-Bq4m2dD9-DrlUipYU.mjs.map} +1 -1
  60. package/dist/target.d.mts +10 -10
  61. package/dist/target.mjs +17 -17
  62. package/dist/target__contract-free.mjs +3 -3
  63. package/dist/target__control.d.mts +1 -1
  64. package/dist/target__control.mjs +3 -2
  65. package/dist/target__diff-database-schema.mjs +1 -1
  66. package/dist/target__issue-planner.d.mts +1 -1
  67. package/dist/target__issue-planner.mjs +1 -1
  68. package/dist/target__migration.d.mts +2 -2
  69. package/dist/target__migration.mjs +2 -2
  70. package/dist/target__op-factory-call.d.mts +3 -3
  71. package/dist/target__op-factory-call.mjs +2 -2
  72. package/dist/target__pack.mjs +1 -1
  73. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  74. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  75. package/dist/target__planner-sql-checks.mjs +1 -1
  76. package/dist/target__planner.d.mts +1 -1
  77. package/dist/target__planner.mjs +2 -2
  78. package/dist/target__prisma7-binding.mjs +1 -1
  79. package/dist/target__runtime.mjs +2 -2
  80. package/dist/target__runtime.mjs.map +1 -1
  81. package/dist/target__schema-ir-annotations.mjs +1 -1
  82. package/dist/target__types.mjs +1 -1
  83. package/package.json +9 -9
  84. package/dist/control-D5Vb1l8F.mjs.map +0 -1
  85. package/dist/control-policy-API5I4jr-ivEvCf_e.mjs.map +0 -1
  86. package/dist/op-factory-call-Bi1XxJEv.d.mts +0 -1
  87. package/dist/op-factory-call-VLJFI-b_-Du23HNYc.d.mts.map +0 -1
  88. package/dist/op-factory-call-uRJcYmJG-Bpyq2pCt.mjs.map +0 -1
  89. package/dist/planner-Bp89yaJS-4TV82o0Y.mjs.map +0 -1
  90. package/dist/planner-produced-postgres-migration-Bi_Otmtx.d.mts +0 -1
  91. package/dist/planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.d.mts.map +0 -1
  92. package/dist/postgres-migration-B03W06rR-DTB0R3cj.d.mts.map +0 -1
  93. package/dist/postgres-migration-DMTY4p1--KjAAFSJ_.mjs +0 -223
  94. package/dist/postgres-migration-DMTY4p1--KjAAFSJ_.mjs.map +0 -1
@@ -1,20 +1,20 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { d as isPostgresSchema, i as PostgresRlsPolicy } from "./postgres-schema-yugFGBdS-5cY1PCmb.mjs";
2
+ import { d as isPostgresSchema, i as PostgresRlsPolicy } from "./postgres-schema-C8slJGZo-CFGUyJPt.mjs";
3
3
  import { r as PostgresTableSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
4
4
  import { n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
5
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-euaYYSHi-DM7kyWEw.mjs";
6
- import { A as RenameIndexCall, C as DropNativeEnumTypeCall, E as DropTableCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from "./op-factory-call-uRJcYmJG-Bpyq2pCt.mjs";
7
- import { a as planIssues, c as renderPostgresSuppression, d as resolvePostgresNodeIssueControlPolicySubject, f as resolvePostgresNodeIssueCreationFactoryName, i as issueSchemaName, l as resolveNamespaceIdForDdlSchema, n as conflictForDisallowedCall, o as postgresNodeStorageCoordinate, r as issueNode, s as postgresPlannerStrategies, t as coalesceSubtreeIssues, u as resolvePostgresCallControlPolicySubject } from "./control-policy-API5I4jr-ivEvCf_e.mjs";
8
- import { n as buildPostgresPlanDiff } from "./diff-database-schema-MymRFpdQ-CyY82tmS.mjs";
9
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-D7vODJo4-BoaNLGvs.mjs";
5
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-Bq4m2dD9-DrlUipYU.mjs";
6
+ import { B as renameTableStatement, C as DropNativeEnumTypeCall, E as DropTableCall, M as RenameTableCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, j as RenamePostgresRlsPolicyCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from "./op-factory-call-DYkz28kP-4BmpSB4B.mjs";
7
+ import { c as planIssues, d as renderPostgresSuppression, f as resolveNamespaceIdForDdlSchema, h as resolvePostgresNodeIssueCreationFactoryName, l as postgresNodeStorageCoordinate, m as resolvePostgresNodeIssueControlPolicySubject, n as conflictForDisallowedCall, o as issueNode, p as resolvePostgresCallControlPolicySubject, s as issueSchemaName, t as coalesceSubtreeIssues, u as postgresPlannerStrategies } from "./control-policy-CThlWQ8k-m3CT6KpR.mjs";
8
+ import { n as buildPostgresPlanDiff } from "./diff-database-schema-Bp0uC68P-NxeVJERq.mjs";
9
+ import { i as pairIndexRenames, n as emissionSchemaForNamespace, r as pairCheckRenames } from "./postgres-migration-DWtr5s00-CSlA4I1U.mjs";
10
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs";
10
11
  import { blindCast } from "@prisma/orm-framework/utils/casts";
11
12
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
12
13
  import { issueOutcome } from "@prisma/orm-framework/components/control";
13
- import { ifDefined } from "@prisma/orm-framework/utils/defined";
14
14
  import { namingOf, parseWireName } from "@prisma/orm-family-sql/schema-ir/naming";
15
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
15
16
  import { controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure } from "@prisma/orm-family-sql/family/control";
16
- import { SqlCheckConstraintIR, SqlIndexIR } from "@prisma/orm-family-sql/schema-ir/types";
17
- //#region ../../../3-targets/3-targets/postgres/dist/planner-Bp89yaJS.mjs
17
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-B_ILQa75.mjs
18
18
  /**
19
19
  * Resolves the live-database schema name for a given namespace
20
20
  * coordinate. Mirrors `resolveDdlSchemaForNamespace` in
@@ -96,6 +96,14 @@ function verifyPostgresNamespacePresence(input) {
96
96
  }
97
97
  return issues;
98
98
  }
99
+ function partitionPostgresCallsByControlPolicy(calls, contract) {
100
+ return partitionCallsByControlPolicy({
101
+ calls,
102
+ contract,
103
+ resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, contract),
104
+ resolveFactoryName: (call) => call.factoryName
105
+ });
106
+ }
99
107
  function createPostgresMigrationPlanner(lowerer) {
100
108
  return new PostgresMigrationPlanner(lowerer);
101
109
  }
@@ -150,8 +158,8 @@ var PostgresMigrationPlanner = class {
150
158
  contract: options.contract,
151
159
  schema: options.schema
152
160
  }), ...gated];
153
- const indexRenames = this.pairIndexRenames(options, schemaIssues);
154
- const checkRenames = this.pairCheckRenames(options, schemaIssues);
161
+ const indexRenames = pairIndexRenames(options, schemaIssues);
162
+ const checkRenames = pairCheckRenames(options, schemaIssues);
155
163
  const renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);
156
164
  const plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));
157
165
  const codecHooks = extractCodecControlHooks(options.frameworkComponents);
@@ -169,7 +177,11 @@ var PostgresMigrationPlanner = class {
169
177
  const node = issueNode(issue);
170
178
  return node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;
171
179
  },
172
- namespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName)
180
+ namespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),
181
+ renameByHandStatements: (rename) => [renameTableStatement(emissionSchemaForNamespace(options.contract, rename.namespaceId), rename.from, rename.to)],
182
+ renameTableCall: (rename) => new RenameTableCall(rename.namespaceId ?? UNBOUND_NAMESPACE_ID, rename.from, rename.to).renderTypeScript(),
183
+ contract: options.contract,
184
+ defaultNamespaceId: DEFAULT_NAMESPACE_ID
173
185
  });
174
186
  if (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);
175
187
  const result = planIssues({
@@ -186,28 +198,13 @@ var PostgresMigrationPlanner = class {
186
198
  });
187
199
  const schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);
188
200
  if (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);
189
- const indexRenamePartition = partitionCallsByControlPolicy({
190
- calls: [...indexRenames.calls, ...checkRenames.calls],
191
- contract: options.contract,
192
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
193
- resolveFactoryName: (call) => call.factoryName
194
- });
195
- const schemaDiffPartition = partitionCallsByControlPolicy({
196
- calls: schemaDiff.calls,
197
- contract: options.contract,
198
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
199
- resolveFactoryName: (call) => call.factoryName
200
- });
201
- const fieldEventPartition = partitionCallsByControlPolicy({
202
- calls: blindCast(planFieldEventOperations({
203
- priorContract: options.fromContract,
204
- newContract: options.contract,
205
- codecHooks
206
- })),
207
- contract: options.contract,
208
- resolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, options.contract),
209
- resolveFactoryName: (call) => call.factoryName
210
- });
201
+ const indexRenamePartition = partitionPostgresCallsByControlPolicy([...indexRenames.calls, ...checkRenames.calls], options.contract);
202
+ const schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);
203
+ const fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(planFieldEventOperations({
204
+ priorContract: options.fromContract,
205
+ newContract: options.contract,
206
+ codecHooks
207
+ })), options.contract);
211
208
  const ordered = movePolicyDropsBeforeBlockedDdl(result.value.calls, schemaDiffPartition.kept);
212
209
  const calls = [
213
210
  ...ordered.structural,
@@ -238,185 +235,6 @@ var PostgresMigrationPlanner = class {
238
235
  });
239
236
  }
240
237
  /**
241
- * Rename post-pass for indexes, per `(schema, table)`, widening-only,
242
- * deterministic by sorted names — the same structure as the policy pass
243
- * below (which stays untouched: policies pair by hash only).
244
- *
245
- * Hash pairing (prefix-only renames): extras whose live names parse as
246
- * wire names, grouped by `(schema, table, hash)`; missing nodes iterated
247
- * in sorted-name order consume the sorted-name-first candidate.
248
- *
249
- * Content pairing (exact→wire convergence), after hash pairing has
250
- * consumed its matches: the remaining wire-named-missing nodes
251
- * (`prefix` defined) against the remaining extras of any name shape,
252
- * paired iff content-equal (columns ordered-strict both-defined-or-
253
- * both-undefined, `unique`/`type` strict, `options` loose, bodies
254
- * byte-equal).
255
- *
256
- * Leftovers proceed as create/drop exactly as before; without the
257
- * widening allowance the pass is skipped and pairing degrades to the
258
- * additive half, like the policy pass.
259
- */
260
- pairIndexRenames(options, issues) {
261
- const consumed = /* @__PURE__ */ new Set();
262
- const calls = [];
263
- if (!options.policy.allowedOperationClasses.includes("widening")) return {
264
- calls,
265
- consumed
266
- };
267
- const missing = [];
268
- const extra = [];
269
- for (const issue of issues) {
270
- const node = issueNode(issue);
271
- if (node === void 0 || !SqlIndexIR.is(node)) continue;
272
- const ddlSchema = issue.path[1];
273
- const tableName = issue.path[2];
274
- if (ddlSchema === void 0 || tableName === void 0) continue;
275
- if (issueOutcome(issue) === "not-found") missing.push({
276
- issue,
277
- node,
278
- ddlSchema,
279
- tableName
280
- });
281
- else if (issueOutcome(issue) === "not-expected") extra.push({
282
- issue,
283
- node,
284
- ddlSchema,
285
- tableName
286
- });
287
- }
288
- if (missing.length === 0 || extra.length === 0) return {
289
- calls,
290
- consumed
291
- };
292
- const byName = (a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0;
293
- const emissionSchema = (ddlSchema) => resolveNamespaceIdForDdlSchema(options.contract, ddlSchema) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchema;
294
- const pairingKey = (finding, hash) => JSON.stringify([
295
- finding.ddlSchema,
296
- finding.tableName,
297
- hash
298
- ]);
299
- const rename = (missingFinding, candidate) => {
300
- consumed.add(missingFinding.issue);
301
- consumed.add(candidate.issue);
302
- calls.push(new RenameIndexCall(emissionSchema(missingFinding.ddlSchema), missingFinding.tableName, candidate.node.name, missingFinding.node.name));
303
- };
304
- const sortedMissing = [...missing].sort(byName);
305
- const extrasByHash = /* @__PURE__ */ new Map();
306
- for (const finding of extra) {
307
- const parsed = parseWireName(finding.node.name);
308
- if (parsed === void 0) continue;
309
- const key = pairingKey(finding, parsed.hash);
310
- const group = extrasByHash.get(key) ?? [];
311
- group.push(finding);
312
- extrasByHash.set(key, group);
313
- }
314
- for (const group of extrasByHash.values()) group.sort(byName);
315
- for (const missingFinding of sortedMissing) {
316
- const parsed = parseWireName(missingFinding.node.name);
317
- if (parsed === void 0) continue;
318
- const candidate = extrasByHash.get(pairingKey(missingFinding, parsed.hash))?.shift();
319
- if (candidate === void 0) continue;
320
- rename(missingFinding, candidate);
321
- }
322
- const sortedExtras = [...extra].sort(byName);
323
- for (const missingFinding of sortedMissing) {
324
- if (consumed.has(missingFinding.issue)) continue;
325
- if (missingFinding.node.prefix === void 0) continue;
326
- const candidate = sortedExtras.find((extraFinding) => !consumed.has(extraFinding.issue) && extraFinding.ddlSchema === missingFinding.ddlSchema && extraFinding.tableName === missingFinding.tableName && missingFinding.node.contentEquals(extraFinding.node, {
327
- columnPresence: "matching",
328
- bodies: "verbatim"
329
- }));
330
- if (candidate === void 0) continue;
331
- rename(missingFinding, candidate);
332
- }
333
- return {
334
- calls,
335
- consumed
336
- };
337
- }
338
- /**
339
- * Check-constraint rename post-pass: a `not-found` and a `not-expected`
340
- * check on the same table whose wire-name content hashes match but whose
341
- * prefixes differ is a prefix-only rename, and collapses into one
342
- * `ALTER TABLE … RENAME CONSTRAINT`.
343
- *
344
- * This is the index pass's hash-pairing phase and nothing else. There is
345
- * deliberately no content-pairing phase: a live check body is whatever
346
- * Postgres reprinted, so it never byte-matches the authored text, and
347
- * pairing an exact-named live check by content would bless whatever
348
- * predicate is actually live. Adoption of an old exact-named check stays
349
- * drop + add.
350
- *
351
- * Runs only when the policy allows `widening` (rename's class). Without it
352
- * the pass no-ops and the pair degrades to the slice-1 behavior: an add,
353
- * plus a drop when `destructive` is allowed too.
354
- */
355
- pairCheckRenames(options, issues) {
356
- const consumed = /* @__PURE__ */ new Set();
357
- const calls = [];
358
- if (!options.policy.allowedOperationClasses.includes("widening")) return {
359
- calls,
360
- consumed
361
- };
362
- const missing = [];
363
- const extra = [];
364
- for (const issue of issues) {
365
- const node = issueNode(issue);
366
- if (node === void 0 || !SqlCheckConstraintIR.is(node)) continue;
367
- const ddlSchema = issue.path[1];
368
- const tableName = issue.path[2];
369
- if (ddlSchema === void 0 || tableName === void 0) continue;
370
- if (issueOutcome(issue) === "not-found") missing.push({
371
- issue,
372
- node,
373
- ddlSchema,
374
- tableName
375
- });
376
- else if (issueOutcome(issue) === "not-expected") extra.push({
377
- issue,
378
- node,
379
- ddlSchema,
380
- tableName
381
- });
382
- }
383
- if (missing.length === 0 || extra.length === 0) return {
384
- calls,
385
- consumed
386
- };
387
- const byName = (a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0;
388
- const emissionSchema = (ddlSchema) => resolveNamespaceIdForDdlSchema(options.contract, ddlSchema) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchema;
389
- const pairingKey = (finding, hash) => JSON.stringify([
390
- finding.ddlSchema,
391
- finding.tableName,
392
- hash
393
- ]);
394
- const sortedMissing = [...missing].sort(byName);
395
- const extrasByHash = /* @__PURE__ */ new Map();
396
- for (const finding of extra) {
397
- const parsed = parseWireName(finding.node.name);
398
- if (parsed === void 0) continue;
399
- const key = pairingKey(finding, parsed.hash);
400
- const group = extrasByHash.get(key) ?? [];
401
- group.push(finding);
402
- extrasByHash.set(key, group);
403
- }
404
- for (const group of extrasByHash.values()) group.sort(byName);
405
- for (const missingFinding of sortedMissing) {
406
- const parsed = parseWireName(missingFinding.node.name);
407
- if (parsed === void 0) continue;
408
- const candidate = extrasByHash.get(pairingKey(missingFinding, parsed.hash))?.shift();
409
- if (candidate === void 0) continue;
410
- consumed.add(missingFinding.issue);
411
- consumed.add(candidate.issue);
412
- calls.push(new RenameCheckConstraintCall(emissionSchema(missingFinding.ddlSchema), missingFinding.tableName, candidate.node.name, missingFinding.node.name));
413
- }
414
- return {
415
- calls,
416
- consumed
417
- };
418
- }
419
- /**
420
238
  * Maps the RLS policy findings of the one combined tree diff
421
239
  * (`buildPostgresPlanDiff`, already ownership-filtered) into
422
240
  * `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a
@@ -711,4 +529,4 @@ function policyNodeToContractPolicy(node) {
711
529
  //#endregion
712
530
  export { createPostgresMigrationPlanner as t };
713
531
 
714
- //# sourceMappingURL=planner-Bp89yaJS-4TV82o0Y.mjs.map
532
+ //# sourceMappingURL=planner-B_ILQa75-CoVpbzCr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-B_ILQa75-CoVpbzCr.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-B_ILQa75.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { _ as PostgresRlsPolicy, r as isPostgresSchema } from \"./postgres-schema-C8slJGZo.mjs\";\nimport { t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-Bq4m2dD9.mjs\";\nimport { t as buildPostgresPlanDiff } from \"./diff-database-schema-Bp0uC68P.mjs\";\nimport { a as resolvePostgresNodeIssueCreationFactoryName, c as issueNode, d as postgresPlannerStrategies, h as postgresNodeStorageCoordinate, i as resolvePostgresNodeIssueControlPolicySubject, l as issueSchemaName, n as resolveNamespaceIdForDdlSchema, o as coalesceSubtreeIssues, r as resolvePostgresCallControlPolicySubject, s as conflictForDisallowedCall, t as renderPostgresSuppression, u as planIssues } from \"./control-policy-CThlWQ8k.mjs\";\nimport { C as DropNativeEnumTypeCall, E as DropTableCall, M as RenameTableCall, O as RawSqlCall, R as renameTableStatement, T as DropPostgresRlsPolicyCall, j as RenamePostgresRlsPolicyCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from \"./op-factory-call-DYkz28kP.mjs\";\nimport { a as pairCheckRenames, n as emissionSchemaForNamespace, o as pairIndexRenames } from \"./postgres-migration-DWtr5s00.mjs\";\nimport { t as TypeScriptRenderablePostgresMigration } from \"./planner-produced-postgres-migration-BQFrdLuE.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure } from \"@internal/family-sql/control\";\nimport { namingOf, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/verify-postgres-namespaces.ts\n/**\n* Resolves the live-database schema name for a given namespace\n* coordinate. Mirrors `resolveDdlSchemaForNamespace` in\n* `planner-strategies.ts` so the verifier's projection and the\n* planner's projection always agree — Postgres-aware namespaces (the\n* production path) dispatch to `ddlSchemaName(storage)`, and bare\n* object payloads (used by some tests) fall back to the coordinate\n* itself.\n*/\nfunction resolveDdlSchemaName(storage, namespaceId) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n/**\n* Reads the introspected list of schema names from the database-root schema\n* node. `existingSchemas` is database-level, so it lives on the\n* `PostgresDatabaseSchemaNode` root — not on the per-schema namespace nodes.\n*\n* Defaults to the always-present `public` schema when the node is not the\n* database root — a fresh Postgres database always carries `public` (unless an\n* operator dropped it manually), so any verifier path that runs without an\n* enriched introspection still suppresses the redundant `CREATE SCHEMA\n* \"public\"`.\n*\n* Production introspection (`PostgresControlAdapter.introspect`) is the\n* authoritative source: it queries `pg_namespace` and sets `existingSchemas`\n* on the returned root. Tests that want to assert against a richer initial\n* state construct a `PostgresDatabaseSchemaNode` explicitly.\n*/\nfunction existingSchemasFromSchema(schema) {\n\tif (PostgresDatabaseSchemaNode.is(schema)) return schema.existingSchemas;\n\treturn [DEFAULT_NAMESPACE_ID];\n}\n/**\n* Emits a `postgres-namespace` `not-found` diff issue for every\n* contract-declared Postgres namespace whose live container does not yet\n* exist. The planner prepends these (node-typed, synthesized) to the\n* relational diff issues so a multi-schema plan emits `CREATE SCHEMA`\n* before the tables that need it — a planner-only concern (verify already\n* rejects via the `not-found` table issues a missing schema already\n* produces), so this is not part of the shared diff.\n*\n* A namespace's live container is the schema returned by its\n* polymorphic `ddlSchemaName(storage)` method — named schemas resolve\n* to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`\n* and is skipped explicitly (late-bound namespaces have no fixed DDL\n* schema). Issues are emitted only when the resolved name is a real,\n* creatable schema (not the unbound sentinel) and is missing from the\n* introspected list. `public` is suppressed implicitly because the\n* introspection (or its sensible default) always carries it.\n*\n* Each emitted issue's path is `['database', ddlName]` — an ancestor of\n* every table path under that schema, so it must never be run through\n* `coalesceSubtreeIssues` alongside the table diff (it would swallow the\n* table-level `not-found` issues that drive `CREATE TABLE`); the planner\n* adds these AFTER coalescing the relational issues, and they are not\n* subject to sibling-space ownership scoping (mirrors the retired\n* coordinate walk, which prepended namespace issues after that filter).\n*/\nfunction verifyPostgresNamespacePresence(input) {\n\tconst { contract, schema } = input;\n\tconst existing = new Set(existingSchemasFromSchema(schema));\n\tconst issues = [];\n\tconst namespaceIds = Object.keys(contract.storage.namespaces).sort();\n\tfor (const namespaceId of namespaceIds) {\n\t\tif (namespaceId === UNBOUND_NAMESPACE_ID) continue;\n\t\tconst ddlName = resolveDdlSchemaName(contract.storage, namespaceId);\n\t\tif (ddlName === UNBOUND_NAMESPACE_ID) continue;\n\t\tif (existing.has(ddlName)) continue;\n\t\tconst namespace = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlName,\n\t\t\ttables: {}\n\t\t});\n\t\tissues.push({\n\t\t\tpath: [\"database\", ddlName],\n\t\t\texpected: namespace\n\t\t});\n\t}\n\treturn issues;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction partitionPostgresCallsByControlPolicy(calls, contract) {\n\treturn partitionCallsByControlPolicy({\n\t\tcalls,\n\t\tcontract,\n\t\tresolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, contract),\n\t\tresolveFactoryName: (call) => call.factoryName\n\t});\n}\nfunction createPostgresMigrationPlanner(lowerer) {\n\treturn new PostgresMigrationPlanner(lowerer);\n}\n/**\n* Postgres migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the target contract against the live schema via the one\n* differ (`buildPostgresPlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the unified `postgresPlannerStrategies`\n* list: NOT-NULL backfill, type-change, nullable-tightening, codec-hook\n* storage types, component-declared dependency installs, and\n* shared-temp-default / empty-table-guarded NOT-NULL add-column. The same\n* strategy list runs for `migration plan`, `db update`, and `db init`;\n* behavior diverges purely on `policy.allowedOperationClasses` (the\n* data-safe strategies short-circuit when `'data'` is excluded). The issue\n* planner applies operation-class policy gates and emits a single\n* `PostgresOpFactoryCall[]` that drives both the runtime-ops view (via\n* `renderOps`) and the `renderTypeScript()` authoring surface. RLS policy\n* drift (the structural half of the same one-differ tree) is handled\n* separately via `planPostgresSchemaDiff`.\n*/\nvar PostgresMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(blindCast(options));\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderablePostgresMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tPostgresDatabaseSchemaNode.assert(options.schema);\n\t\tconst { issues: rawIssues } = buildPostgresPlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: options.schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue));\n\t\tconst relationalDiffIssues = rawIssues.filter((issue) => !isPolicyDiffIssue(issue));\n\t\tconst strict = options.policy.allowedOperationClasses.includes(\"widening\") || options.policy.allowedOperationClasses.includes(\"destructive\");\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(relationalDiffIssues), options.ownership, options.contract);\n\t\tconst gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\");\n\t\tconst schemaIssues = [...verifyPostgresNamespacePresence({\n\t\t\tcontract: options.contract,\n\t\t\tschema: options.schema\n\t\t}), ...gated];\n\t\tconst indexRenames = pairIndexRenames(options, schemaIssues);\n\t\tconst checkRenames = pairCheckRenames(options, schemaIssues);\n\t\tconst renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);\n\t\tconst plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst storageTypes = options.contract.storage.types ?? {};\n\t\tconst relationalSchema = relationalNamespaceNode(options.schema, schemaName);\n\t\tconst issuePartition = partitionIssuesByControlPolicy({\n\t\t\tissues: plannableIssues,\n\t\t\tcontract: options.contract,\n\t\t\tresolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),\n\t\t\tresolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName\n\t\t});\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),\n\t\t\trenameByHandStatements: (rename) => [renameTableStatement(emissionSchemaForNamespace(options.contract, rename.namespaceId), rename.from, rename.to)],\n\t\t\trenameTableCall: (rename) => new RenameTableCall(rename.namespaceId ?? UNBOUND_NAMESPACE_ID, rename.from, rename.to).renderTypeScript(),\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst result = planIssues({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttoContract: options.contract,\n\t\t\tfromContract: options.fromContract,\n\t\t\tschemaName,\n\t\t\tcodecHooks,\n\t\t\tstorageTypes,\n\t\t\t...ifDefined(\"schema\", relationalSchema),\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstrategies: postgresPlannerStrategies\n\t\t});\n\t\tconst schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);\n\t\tif (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);\n\t\tconst indexRenamePartition = partitionPostgresCallsByControlPolicy([...indexRenames.calls, ...checkRenames.calls], options.contract);\n\t\tconst schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);\n\t\tconst fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(planFieldEventOperations({\n\t\t\tpriorContract: options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks\n\t\t})), options.contract);\n\t\tconst ordered = movePolicyDropsBeforeBlockedDdl(result.value.calls, schemaDiffPartition.kept);\n\t\tconst calls = [\n\t\t\t...ordered.structural,\n\t\t\t...indexRenamePartition.kept,\n\t\t\t...ordered.policyCalls,\n\t\t\t...fieldEventPartition.kept\n\t\t];\n\t\tconst seenWarnings = /* @__PURE__ */ new Set();\n\t\tconst warnings = [\n\t\t\t...issuePartition.suppressions,\n\t\t\t...indexRenamePartition.suppressions,\n\t\t\t...schemaDiff.suppressions,\n\t\t\t...schemaDiffPartition.suppressions,\n\t\t\t...fieldEventPartition.suppressions\n\t\t].map((record) => renderPostgresSuppression(record, options.contract)).filter((warning) => {\n\t\t\tconst key = JSON.stringify(warning);\n\t\t\tif (seenWarnings.has(key)) return false;\n\t\t\tseenWarnings.add(key);\n\t\t\treturn true;\n\t\t});\n\t\treturn Object.freeze({\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderablePostgresMigration(calls, {\n\t\t\t\tfrom: options.fromContract?.storage.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, this.#lowerer),\n\t\t\t...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}\n\t\t});\n\t}\n\t/**\n\t* Maps the RLS policy findings of the one combined tree diff\n\t* (`buildPostgresPlanDiff`, already ownership-filtered) into\n\t* `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a\n\t* `not-equal` finding (an exact-named policy whose content drifted)\n\t* becomes drop + create, or a disallowed-call conflict when the policy\n\t* forbids the destructive drop. It\n\t* does not re-diff — it consumes exactly the policy-node subset of the\n\t* shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE\n\t* ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`\n\t* attribute diff on the relational side.\n\t*\n\t* Rename post-pass (the index pass's structure): hash pairing pairs a\n\t* `not-found` and a `not-expected` policy on the SAME table whose\n\t* wire-name content hashes match but prefixes differ (prefix-only rename);\n\t* content pairing then pairs remaining wire-named-missing policies against remaining\n\t* extras of any name shape by verbatim content (the node-owned `contentEquals` —\n\t* exact→wire adoption). Multi-candidate groups pair deterministically\n\t* by sorted name; leftovers proceed as create/drop; an exact-named\n\t* missing policy never content-pairs.\n\t*\n\t* The pairing runs only when the policy allows `widening` (rename's\n\t* class). Without it (db-init's additive-only set), pairing degrades\n\t* deliberately to the additive half: the new name is CREATEd and the old\n\t* policy survives live until a widening/destructive-allowed plan runs —\n\t* emitting an ungated widening rename would only fail at the runner's\n\t* class re-enforcement.\n\t*/\n\tplanPostgresSchemaDiff(options, filteredDiffIssues) {\n\t\tconst allowsDestructive = options.policy.allowedOperationClasses.includes(\"destructive\");\n\t\tconst allowsWidening = options.policy.allowedOperationClasses.includes(\"widening\");\n\t\tconst missing = [];\n\t\tconst extra = [];\n\t\tconst changed = [];\n\t\tfor (const issue of filteredDiffIssues) if (issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tchanged.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-found\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tmissing.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-expected\") {\n\t\t\tconst actual = issue.actual;\n\t\t\tPostgresPolicySchemaNode.assert(actual);\n\t\t\textra.push({\n\t\t\t\tnode: actual,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, actual.namespaceId)\n\t\t\t});\n\t\t}\n\t\tconst calls = [];\n\t\tconst conflicts = [];\n\t\tconst suppressions = [];\n\t\tconst renamedExtras = /* @__PURE__ */ new Set();\n\t\tconst renamedMissing = /* @__PURE__ */ new Set();\n\t\tconst pairingKey = (finding, hash) => JSON.stringify([\n\t\t\tfinding.schemaForTable,\n\t\t\tfinding.node.tableName,\n\t\t\thash\n\t\t]);\n\t\tif (allowsWidening) {\n\t\t\tconst extrasByGroup = /* @__PURE__ */ new Map();\n\t\t\tfor (const finding of extra) {\n\t\t\t\tconst parsed = parseWireName(finding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst key = pairingKey(finding, parsed.hash);\n\t\t\t\tconst group = extrasByGroup.get(key) ?? [];\n\t\t\t\tgroup.push(finding);\n\t\t\t\textrasByGroup.set(key, group);\n\t\t\t}\n\t\t\tfor (const group of extrasByGroup.values()) group.sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tconst sortedMissing = [...missing].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tconst parsed = parseWireName(missingFinding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst candidate = extrasByGroup.get(pairingKey(missingFinding, parsed.hash))?.shift();\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t\tconst sortedExtras = [...extra].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tif (renamedMissing.has(missingFinding)) continue;\n\t\t\t\tif (missingFinding.node.prefix === void 0) continue;\n\t\t\t\tconst candidate = sortedExtras.find((extraFinding) => !renamedExtras.has(extraFinding) && extraFinding.schemaForTable === missingFinding.schemaForTable && extraFinding.node.tableName === missingFinding.node.tableName && missingFinding.node.contentEquals(extraFinding.node));\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t}\n\t\tfor (const finding of changed) {\n\t\t\tconst replacement = {\n\t\t\t\tdrop: new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name),\n\t\t\t\tcreate: new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node))\n\t\t\t};\n\t\t\tconst graded = gradePolicyReplacement(replacement, options.contract, options.policy.allowedOperationClasses);\n\t\t\tif (graded.disposition === \"suppress\") {\n\t\t\t\tsuppressions.push(graded.record);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (graded.disposition === \"conflict\") {\n\t\t\t\tconflicts.push(graded.conflict);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcalls.push(replacement.drop);\n\t\t\tcalls.push(replacement.create);\n\t\t}\n\t\tfor (const finding of missing) {\n\t\t\tif (renamedMissing.has(finding)) continue;\n\t\t\tcalls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));\n\t\t}\n\t\tif (allowsDestructive) for (const finding of extra) {\n\t\t\tif (renamedExtras.has(finding)) continue;\n\t\t\tcalls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));\n\t\t}\n\t\treturn {\n\t\t\tcalls,\n\t\t\tconflicts,\n\t\t\tsuppressions\n\t\t};\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n};\n/**\n* A diff issue whose node is an RLS policy — the structural half of the one\n* combined tree diff, routed to `planPostgresSchemaDiff` instead of\n* `planIssues`.\n*/\nfunction isPolicyDiffIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && PostgresPolicySchemaNode.is(node);\n}\n/**\n* Postgres refuses these statements while a policy uses the object they touch:\n* - dropping a column (2BP01) or changing its type (0A000);\n* - dropping a table that a policy on another table uses (2BP01); a table's own policies go with it;\n* - dropping a native enum type (2BP01);\n* - a destructive codec type operation (a `RawSqlCall` on a type), such as dropping or rebuilding\n* the type (2BP01) or changing a composite type's attribute type (0A000). Additive and widening\n* type operations, such as adding an enum value or renaming the type, go through.\n*\n* So every policy drop moves to just before the first structural call that a policy can block.\n* Without such a call, the policy calls keep their place after the structural calls.\n*/\nfunction movePolicyDropsBeforeBlockedDdl(structural, policyCalls) {\n\tconst firstBlockable = structural.findIndex(policyCanBlock);\n\tif (firstBlockable === -1) return {\n\t\tstructural,\n\t\tpolicyCalls\n\t};\n\tconst isPolicyDrop = (call) => call instanceof DropPostgresRlsPolicyCall;\n\treturn {\n\t\tstructural: [\n\t\t\t...structural.slice(0, firstBlockable),\n\t\t\t...policyCalls.filter(isPolicyDrop),\n\t\t\t...structural.slice(firstBlockable)\n\t\t],\n\t\tpolicyCalls: policyCalls.filter((call) => !isPolicyDrop(call))\n\t};\n}\nfunction policyCanBlock(call) {\n\tif (call instanceof RawSqlCall) return call.operationClass === \"destructive\" && call.op.target.details?.objectType === \"type\";\n\treturn call instanceof DropColumnCall || call instanceof AlterColumnTypeCall || call instanceof DropTableCall || call instanceof DropNativeEnumTypeCall;\n}\n/**\n* Drops a `not-expected` issue when it is a whole extra storage entity (a table\n* or a native enum) that some space in the composition owns. Each such node\n* yields its own storage coordinate (see {@link postgresNodeStorageCoordinate}),\n* so `declaresEntity` answers over the whole composition on one uniform\n* coordinate: a positive answer means a sibling owns this entity here — leave\n* it; a negative answer means a genuine orphan — drop it. A node with no storage\n* coordinate (a namespace, or a deeper column/constraint drift on an owned\n* table) is this space's own and is always kept. No oracle ⇒ keep everything.\n*/\nfunction retainUnownedExtras(issues, ownership, contract) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0) return true;\n\t\tconst coordinate = postgresNodeStorageCoordinate(node);\n\t\tif (coordinate === void 0) return true;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tif (ddlSchemaName === void 0) return true;\n\t\tconst namespaceId = resolveNamespaceIdForDdlSchema(contract, ddlSchemaName);\n\t\treturn !ownership.declaresEntity({\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t});\n\t});\n}\n/**\n* Returns the one namespace node the relational strategy layer probes for\n* live-table existence and reads codec-hook context off — the namespace\n* matching the planner's resolved schema name, or the first namespace when\n* none matches. `undefined` when the tree has no namespaces, so the strategy\n* context uses its empty-schema default.\n*\n* The relational strategies key tables by bare name, so they can only probe one\n* namespace at a time; probing across every namespace at once is future work.\n*\n* Returns the real `PostgresNamespaceSchemaNode` reference rather than a\n* projection: `storageTypePlanCallStrategy` hands this same value to codec\n* `planTypeOperations` hooks as `schema`, and hooks read the Postgres-specific\n* `nativeEnums` field off it (via `PostgresNamespaceSchemaNode.is`) to decide\n* whether a native enum type already exists — a projection that only copies\n* `tables` would silently drop that signal. `StrategyContext.schema`'s\n* declared type (`SqlSchemaIR`, shared with SQLite's flat shape) doesn't\n* capture this, so the return is `blindCast` the same way `namespaceSchemaNodes`\n* in the family's relational walk already treats a namespace node as a\n* structurally-`SqlSchemaIR`-shaped value.\n*/\nfunction relationalNamespaceNode(schema, schemaName) {\n\tconst namespaceNodes = Object.values(schema.namespaces);\n\tconst namespaceNode = namespaceNodes.find((node) => node.schemaName === schemaName) ?? namespaceNodes[0];\n\tif (namespaceNode === void 0) return void 0;\n\treturn blindCast(namespaceNode);\n}\n/**\n* Grades a {@link PolicyReplacement} as one unit against the table's\n* control policy, BEFORE the pair becomes calls or a conflict. This runs\n* ahead of `partitionCallsByControlPolicy`, which later re-grades the\n* surviving calls per-call — a no-op here, since only managed units\n* survive this grading.\n*\n* A replacement is deliberately STRICTER than the shared\n* `callAllowedUnderControlPolicy` rule: `tolerated` permits whole-object\n* creation, but a replacement's create is the second half of a repair of\n* an existing object, not a new object — so ANY non-managed control\n* (external, observed, tolerated) suppresses the whole unit. Drift on an\n* object the plan does not manage is reported, never repaired; the\n* suppression subject names the drifted policy (`rlsPolicy`) so the\n* report says which policy drifted, matching the conflict path's\n* `location.rlsPolicy`.\n*/\nfunction gradePolicyReplacement(replacement, contract, allowedOperationClasses) {\n\tconst subject = resolvePostgresCallControlPolicySubject(replacement.drop, contract);\n\tconst controlPolicy = controlPolicyForCall(subject, contract.defaultControlPolicy);\n\tif (controlPolicy !== \"managed\") return {\n\t\tdisposition: \"suppress\",\n\t\trecord: {\n\t\t\tsubject: subject === void 0 ? void 0 : {\n\t\t\t\t...subject,\n\t\t\t\trlsPolicy: replacement.drop.policyName\n\t\t\t},\n\t\t\tpolicy: controlPolicy,\n\t\t\tfactoryName: void 0,\n\t\t\tcreatesNewObject: false\n\t\t}\n\t};\n\tif (!allowedOperationClasses.includes(\"destructive\")) return {\n\t\tdisposition: \"conflict\",\n\t\tconflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)\n\t};\n\treturn { disposition: \"plan\" };\n}\n/**\n* Rebuilds the `PostgresRlsPolicy` contract entity `CreatePostgresRlsPolicyCall`\n* carries (its `renderTypeScript`/`createRlsPolicy` paths serialize the whole\n* entity, `namespaceId` included). This reconstructs rather than looking the\n* original up in the contract on purpose: the diff node's `namespaceId` is the\n* *resolved DDL schema* (set when the expected tree was built), which is the\n* value the emitted op must carry; the contract-stored entity holds the raw,\n* pre-resolution coordinate, so a lookup would change the migration output.\n*/\nfunction policyNodeToContractPolicy(node) {\n\treturn new PostgresRlsPolicy({\n\t\tnaming: namingOf(node.name, node.prefix),\n\t\ttableName: node.tableName,\n\t\tnamespaceId: node.namespaceId,\n\t\toperation: node.operation,\n\t\troles: [...node.roles],\n\t\tusing: node.using,\n\t\twithCheck: node.withCheck,\n\t\tpermissive: node.permissive\n\t});\n}\n//#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MAAM,iBAAiB,OAAO,OAAO,OAAO,UAAU;CACtD,MAAM,gBAAgB,eAAe,MAAM,SAAS,KAAK,eAAe,UAAU,KAAK,eAAe;CACtG,IAAI,kBAAkB,KAAK,GAAG,OAAO,KAAK;CAC1C,OAAO,UAAU,aAAa;AAC/B;;;;;;;;;;;;;;;;;;AAkBA,SAAS,uBAAuB,aAAa,UAAU,yBAAyB;CAC/E,MAAM,UAAU,wCAAwC,YAAY,MAAM,QAAQ;CAClF,MAAM,gBAAgB,qBAAqB,SAAS,SAAS,oBAAoB;CACjF,IAAI,kBAAkB,WAAW,OAAO;EACvC,aAAa;EACb,QAAQ;GACP,SAAS,YAAY,KAAK,IAAI,KAAK,IAAI;IACtC,GAAG;IACH,WAAW,YAAY,KAAK;GAC7B;GACA,QAAQ;GACR,aAAa,KAAK;GAClB,kBAAkB;EACnB;CACD;CACA,IAAI,CAAC,wBAAwB,SAAS,aAAa,GAAG,OAAO;EAC5D,aAAa;EACb,UAAU,0BAA0B,YAAY,MAAM,uBAAuB;CAC9E;CACA,OAAO,EAAE,aAAa,OAAO;AAC9B;;;;;;;;;;AAUA,SAAS,2BAA2B,MAAM;CACzC,OAAO,IAAI,kBAAkB;EAC5B,QAAQ,SAAS,KAAK,MAAM,KAAK,MAAM;EACvC,WAAW,KAAK;EAChB,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,OAAO,CAAC,GAAG,KAAK,KAAK;EACrB,OAAO,KAAK;EACZ,WAAW,KAAK;EAChB,YAAY,KAAK;CAClB,CAAC;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { t as PostgresDatabaseSchemaNode } from "./postgres-database-schema-node-Cv8usVNX-BP4GzjSf.mjs";
2
2
  import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
3
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.mjs";
3
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.mjs";
4
4
  import { MigrationPlanWithAuthoringSurface, MigrationPlanner, MigrationScaffoldContext, SchemaOwnership } from "@prisma/orm-framework/components/control";
5
5
  import { ContractToSchemaIROptions, MigrationOperationPolicy, SqlPlannerConflict, SqlPlannerFailureResult } from "@prisma/orm-family-sql/family/control";
6
6
  import { Contract } from "@prisma/orm-framework/contract/types";
@@ -106,45 +106,6 @@ declare class PostgresMigrationPlanner implements MigrationPlanner<'sql', 'postg
106
106
  }): PostgresPlanResult;
107
107
  emptyMigration(context: MigrationScaffoldContext, spaceId: string): MigrationPlanWithAuthoringSurface;
108
108
  private planSql;
109
- /**
110
- * Rename post-pass for indexes, per `(schema, table)`, widening-only,
111
- * deterministic by sorted names — the same structure as the policy pass
112
- * below (which stays untouched: policies pair by hash only).
113
- *
114
- * Hash pairing (prefix-only renames): extras whose live names parse as
115
- * wire names, grouped by `(schema, table, hash)`; missing nodes iterated
116
- * in sorted-name order consume the sorted-name-first candidate.
117
- *
118
- * Content pairing (exact→wire convergence), after hash pairing has
119
- * consumed its matches: the remaining wire-named-missing nodes
120
- * (`prefix` defined) against the remaining extras of any name shape,
121
- * paired iff content-equal (columns ordered-strict both-defined-or-
122
- * both-undefined, `unique`/`type` strict, `options` loose, bodies
123
- * byte-equal).
124
- *
125
- * Leftovers proceed as create/drop exactly as before; without the
126
- * widening allowance the pass is skipped and pairing degrades to the
127
- * additive half, like the policy pass.
128
- */
129
- private pairIndexRenames;
130
- /**
131
- * Check-constraint rename post-pass: a `not-found` and a `not-expected`
132
- * check on the same table whose wire-name content hashes match but whose
133
- * prefixes differ is a prefix-only rename, and collapses into one
134
- * `ALTER TABLE … RENAME CONSTRAINT`.
135
- *
136
- * This is the index pass's hash-pairing phase and nothing else. There is
137
- * deliberately no content-pairing phase: a live check body is whatever
138
- * Postgres reprinted, so it never byte-matches the authored text, and
139
- * pairing an exact-named live check by content would bless whatever
140
- * predicate is actually live. Adoption of an old exact-named check stays
141
- * drop + add.
142
- *
143
- * Runs only when the policy allows `widening` (rename's class). Without it
144
- * the pass no-ops and the pair degrades to the slice-1 behavior: an add,
145
- * plus a drop when `destructive` is allowed too.
146
- */
147
- private pairCheckRenames;
148
109
  /**
149
110
  * Maps the RLS policy findings of the one combined tree diff
150
111
  * (`buildPostgresPlanDiff`, already ownership-filtered) into
@@ -178,4 +139,4 @@ declare class PostgresMigrationPlanner implements MigrationPlanner<'sql', 'postg
178
139
  }
179
140
  //#endregion
180
141
  export { createPostgresMigrationPlanner as n, contractToPostgresDatabaseSchemaNode as t };
181
- //# sourceMappingURL=planner-SLaWpf7q.d.mts.map
142
+ //# sourceMappingURL=planner-fD25Vk53.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-SLaWpf7q.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BiB,qCAAqC,UAAU,yBAAyB,SAAS,4BAA4B;;;iBAG7G,+BAA+B,SAAS,wBAAwB;;;;;;;;KAQ5E;WACM;WACA,MAAM;WACN,oBAAoB;IAC3B;;;;;;;;;;;;;;;;;;;cAmBU,oCAAoC;;EAEhD,YAAY,UAAU;EACtB,KAAK;aACM;aACA;aACA,QAAQ;;;;;;;;;;;;;;;aAeR,cAAc;aACd;aACA,qBAAqB,cAAc;;;;;;aAMnC;;;;;aAKA,YAAY;;;;;;aAMZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;UAC5D;;;;;;;;;;;;;;;;;;;;;UAqBA;;;;;;;;;;;;;;;;;;UAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BA;UACA"}
1
+ {"version":3,"file":"planner-fD25Vk53.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BiB,qCAAqC,UAAU,yBAAyB,SAAS,4BAA4B;;;iBAG7G,+BAA+B,SAAS,wBAAwB;;;;;;;;KAQ5E;WACM;WACA,MAAM;WACN,oBAAoB;IAC3B;;;;;;;;;;;;;;;;;;;cAmBU,oCAAoC;;EAEhD,YAAY,UAAU;EACtB,KAAK;aACM;aACA;aACA,QAAQ;;;;;;;;;;;;;;;aAeR,cAAc;aACd;aACA,qBAAqB,cAAc;;;;;;aAMnC;;;;;aAKA,YAAY;;;;;;aAMZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;UAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BA;UACA"}
@@ -1,7 +1,7 @@
1
- import { t as PostgresMigration } from "./postgres-migration-DMTY4p1--KjAAFSJ_.mjs";
1
+ import { t as PostgresMigration } from "./postgres-migration-DWtr5s00-CSlA4I1U.mjs";
2
2
  import { t as renderOps } from "./render-ops-D2vJApKB-B281fzmn.mjs";
3
3
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-D7vODJo4.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BQFrdLuE.mjs
5
5
  var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
6
6
  #calls;
7
7
  #meta;
@@ -44,4 +44,4 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
44
44
  //#endregion
45
45
  export { TypeScriptRenderablePostgresMigration as t };
46
46
 
47
- //# sourceMappingURL=planner-produced-postgres-migration-D7vODJo4-BoaNLGvs.mjs.map
47
+ //# sourceMappingURL=planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-produced-postgres-migration-D7vODJo4-BoaNLGvs.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-D7vODJo4.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DMTY4p1-.mjs\";\nimport { t as renderOps } from \"./render-ops-D2vJApKB.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-D7vODJo4.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BQFrdLuE.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DWtr5s00.mjs\";\nimport { t as renderOps } from \"./render-ops-D2vJApKB.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BQFrdLuE.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
@@ -1,11 +1,11 @@
1
1
  import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
2
- import { t as PostgresMigration } from "./postgres-migration-B03W06rR-DTB0R3cj.mjs";
2
+ import { t as PostgresMigration } from "./postgres-migration-vpMSrXLQ-CJ72Zey3.mjs";
3
3
  import { MigrationPlanWithAuthoringSurface, OpFactoryCall } from "@prisma/orm-framework/components/control";
4
4
  import { SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
5
5
  import { MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
7
7
  import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
8
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-CoOcn-b9.d.mts
8
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-CMGC3vS6.d.mts
9
9
  //#region src/core/migrations/planner-produced-postgres-migration.d.ts
10
10
  declare class TypeScriptRenderablePostgresMigration extends PostgresMigration implements MigrationPlanWithAuthoringSurface {
11
11
  #private;
@@ -22,4 +22,4 @@ declare class TypeScriptRenderablePostgresMigration extends PostgresMigration im
22
22
  }
23
23
  //#endregion
24
24
  export { TypeScriptRenderablePostgresMigration as t };
25
- //# sourceMappingURL=planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.d.mts.map
25
+ //# sourceMappingURL=planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-CMGC3vS6.d.mts"],"mappings":";;;;;;;;;cAQc,8CAA8C,6BAA6B;;EAEvF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,UAAU;MACtH,wBAAwB,0BAA0B,6BAA6B,QAAQ,0BAA0B;EACrH,YAAY;;;;;;MAMR;EACJ,iBAAiB,wBAAwB"}
@@ -0,0 +1 @@
1
+ import "./planner-produced-postgres-migration-CMGC3vS6-CGdYLZFB.mjs";
@@ -1,8 +1,8 @@
1
1
  import { r as quoteIdentifier } from "./sql-utils-Bh-mnsSY-D6hnFPrP.mjs";
2
- import { h as postgresCreateNamespace } from "./postgres-schema-yugFGBdS-5cY1PCmb.mjs";
2
+ import { h as postgresCreateNamespace } from "./postgres-schema-C8slJGZo-CFGUyJPt.mjs";
3
3
  import { n as normalizeSchemaNativeType, r as withLengthOneWhenBare } from "./native-type-normalizer-CW6g9Fut-C5lMRRjS.mjs";
4
4
  import { t as resolveColumnTypeMetadata } from "./planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs";
5
- //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-ZMXeCK6W.mjs
5
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-Bxz8yvg8.mjs
6
6
  /**
7
7
  * String-keyed entry points the migration ops use to render
8
8
  * schema-qualified DDL and catalog checks. The `schema` argument is
@@ -189,4 +189,4 @@ function buildExpectedFormatType(column, codecHooks, storageTypes = {}) {
189
189
  //#endregion
190
190
  export { qualifyTableName as n, buildExpectedFormatType as t };
191
191
 
192
- //# sourceMappingURL=planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs.map
192
+ //# sourceMappingURL=planner-sql-checks-Bxz8yvg8-Bj6jGClB.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-ZMXeCK6W.mjs"],"sourcesContent":["import { r as quoteIdentifier } from \"./sql-utils-Bh-mnsSY.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-yugFGBdS.mjs\";\nimport { n as normalizeSchemaNativeType, r as withLengthOneWhenBare } from \"./native-type-normalizer-CW6g9Fut.mjs\";\nimport { t as resolveColumnTypeMetadata } from \"./planner-type-resolution-Bt2f_q-F.mjs\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** Each type `format_type` displays under another name: that name, and the words it writes after the type's modifier. */\nconst FORMAT_TYPE_DISPLAY = /* @__PURE__ */ new Map([\n\t[\"int2\", {\n\t\tname: \"smallint\",\n\t\tafter: \"\"\n\t}],\n\t[\"int4\", {\n\t\tname: \"integer\",\n\t\tafter: \"\"\n\t}],\n\t[\"int8\", {\n\t\tname: \"bigint\",\n\t\tafter: \"\"\n\t}],\n\t[\"float4\", {\n\t\tname: \"real\",\n\t\tafter: \"\"\n\t}],\n\t[\"float8\", {\n\t\tname: \"double precision\",\n\t\tafter: \"\"\n\t}],\n\t[\"bool\", {\n\t\tname: \"boolean\",\n\t\tafter: \"\"\n\t}],\n\t[\"timestamp\", {\n\t\tname: \"timestamp\",\n\t\tafter: \" without time zone\"\n\t}],\n\t[\"timestamptz\", {\n\t\tname: \"timestamp\",\n\t\tafter: \" with time zone\"\n\t}],\n\t[\"time\", {\n\t\tname: \"time\",\n\t\tafter: \" without time zone\"\n\t}],\n\t[\"timetz\", {\n\t\tname: \"time\",\n\t\tafter: \" with time zone\"\n\t}]\n]);\nconst TYPE_NAME_PARTS = /^([a-z][a-z0-9 ]*?)(\\([^)]*\\))?$/;\n/** A type named as introspection reports it, as `format_type` displays it: `int4` as `integer`, and `timestamptz(3)` as `timestamp(3) with time zone`. */\nfunction formatTypeDisplay(typeName) {\n\tconst parts = TYPE_NAME_PARTS.exec(typeName);\n\tconst display = parts === null ? void 0 : FORMAT_TYPE_DISPLAY.get(parts[1] ?? \"\");\n\tif (parts === null || display === void 0) return typeName;\n\treturn `${display.name}${parts[2] ?? \"\"}${display.after}`;\n}\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = /* @__PURE__ */ new Set([\n\t\"all\",\n\t\"analyse\",\n\t\"analyze\",\n\t\"and\",\n\t\"any\",\n\t\"array\",\n\t\"as\",\n\t\"asc\",\n\t\"asymmetric\",\n\t\"authorization\",\n\t\"between\",\n\t\"binary\",\n\t\"both\",\n\t\"case\",\n\t\"cast\",\n\t\"check\",\n\t\"collate\",\n\t\"column\",\n\t\"constraint\",\n\t\"create\",\n\t\"current_catalog\",\n\t\"current_date\",\n\t\"current_role\",\n\t\"current_time\",\n\t\"current_timestamp\",\n\t\"current_user\",\n\t\"default\",\n\t\"deferrable\",\n\t\"desc\",\n\t\"distinct\",\n\t\"do\",\n\t\"else\",\n\t\"end\",\n\t\"except\",\n\t\"false\",\n\t\"fetch\",\n\t\"for\",\n\t\"foreign\",\n\t\"freeze\",\n\t\"from\",\n\t\"full\",\n\t\"grant\",\n\t\"group\",\n\t\"having\",\n\t\"ilike\",\n\t\"in\",\n\t\"initially\",\n\t\"inner\",\n\t\"intersect\",\n\t\"into\",\n\t\"is\",\n\t\"isnull\",\n\t\"join\",\n\t\"lateral\",\n\t\"leading\",\n\t\"left\",\n\t\"like\",\n\t\"limit\",\n\t\"localtime\",\n\t\"localtimestamp\",\n\t\"natural\",\n\t\"not\",\n\t\"notnull\",\n\t\"null\",\n\t\"offset\",\n\t\"on\",\n\t\"only\",\n\t\"or\",\n\t\"order\",\n\t\"outer\",\n\t\"overlaps\",\n\t\"placing\",\n\t\"primary\",\n\t\"references\",\n\t\"right\",\n\t\"select\",\n\t\"session_user\",\n\t\"similar\",\n\t\"some\",\n\t\"symmetric\",\n\t\"table\",\n\t\"then\",\n\t\"to\",\n\t\"trailing\",\n\t\"true\",\n\t\"union\",\n\t\"unique\",\n\t\"user\",\n\t\"using\",\n\t\"variadic\",\n\t\"verbose\",\n\t\"when\",\n\t\"where\",\n\t\"window\",\n\t\"with\"\n]);\nfunction formatUserDefinedTypeName(identifier) {\n\tif (UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) && !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)) return identifier;\n\treturn quoteIdentifier(identifier);\n}\nfunction buildExpectedFormatType(column, codecHooks, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tif (resolved.typeParams && resolved.codecId) {\n\t\tconst hooks = codecHooks.get(resolved.codecId);\n\t\tif (hooks?.expandNativeType) return formatTypeDisplay(normalizeSchemaNativeType(hooks.expandNativeType({\n\t\t\tnativeType: resolved.nativeType,\n\t\t\tcodecId: resolved.codecId,\n\t\t\ttypeParams: resolved.typeParams\n\t\t})));\n\t}\n\tif (column.typeRef) return formatUserDefinedTypeName(resolved.nativeType);\n\treturn formatTypeDisplay(withLengthOneWhenBare(normalizeSchemaNativeType(resolved.nativeType)));\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-ZMXeCK6W.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,MAAM,sCAAsC,IAAI,IAAI;CACnD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,aAAa;EACb,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,eAAe;EACf,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;AACF,CAAC;AACD,MAAM,kBAAkB;;AAExB,SAAS,kBAAkB,UAAU;CACpC,MAAM,QAAQ,gBAAgB,KAAK,QAAQ;CAC3C,MAAM,UAAU,UAAU,OAAO,KAAK,IAAI,oBAAoB,IAAI,MAAM,MAAM,EAAE;CAChF,IAAI,UAAU,QAAQ,YAAY,KAAK,GAAG,OAAO;CACjD,OAAO,GAAG,QAAQ,OAAO,MAAM,MAAM,KAAK,QAAQ;AACnD;AACA,MAAM,uCAAuC;AAC7C,MAAM,qDAAqD,IAAI,IAAI;CAClE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,0BAA0B,YAAY;CAC9C,IAAI,qCAAqC,KAAK,UAAU,KAAK,CAAC,mCAAmC,IAAI,UAAU,GAAG,OAAO;CACzH,OAAO,gBAAgB,UAAU;AAClC;AACA,SAAS,wBAAwB,QAAQ,YAAY,eAAe,CAAC,GAAG;CACvE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,IAAI,SAAS,cAAc,SAAS,SAAS;EAC5C,MAAM,QAAQ,WAAW,IAAI,SAAS,OAAO;EAC7C,IAAI,OAAO,kBAAkB,OAAO,kBAAkB,0BAA0B,MAAM,iBAAiB;GACtG,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;EACtB,CAAC,CAAC,CAAC;CACJ;CACA,IAAI,OAAO,SAAS,OAAO,0BAA0B,SAAS,UAAU;CACxE,OAAO,kBAAkB,sBAAsB,0BAA0B,SAAS,UAAU,CAAC,CAAC;AAC/F"}
1
+ {"version":3,"file":"planner-sql-checks-Bxz8yvg8-Bj6jGClB.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-Bxz8yvg8.mjs"],"sourcesContent":["import { r as quoteIdentifier } from \"./sql-utils-Bh-mnsSY.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-C8slJGZo.mjs\";\nimport { n as normalizeSchemaNativeType, r as withLengthOneWhenBare } from \"./native-type-normalizer-CW6g9Fut.mjs\";\nimport { t as resolveColumnTypeMetadata } from \"./planner-type-resolution-Bt2f_q-F.mjs\";\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/** Each type `format_type` displays under another name: that name, and the words it writes after the type's modifier. */\nconst FORMAT_TYPE_DISPLAY = /* @__PURE__ */ new Map([\n\t[\"int2\", {\n\t\tname: \"smallint\",\n\t\tafter: \"\"\n\t}],\n\t[\"int4\", {\n\t\tname: \"integer\",\n\t\tafter: \"\"\n\t}],\n\t[\"int8\", {\n\t\tname: \"bigint\",\n\t\tafter: \"\"\n\t}],\n\t[\"float4\", {\n\t\tname: \"real\",\n\t\tafter: \"\"\n\t}],\n\t[\"float8\", {\n\t\tname: \"double precision\",\n\t\tafter: \"\"\n\t}],\n\t[\"bool\", {\n\t\tname: \"boolean\",\n\t\tafter: \"\"\n\t}],\n\t[\"timestamp\", {\n\t\tname: \"timestamp\",\n\t\tafter: \" without time zone\"\n\t}],\n\t[\"timestamptz\", {\n\t\tname: \"timestamp\",\n\t\tafter: \" with time zone\"\n\t}],\n\t[\"time\", {\n\t\tname: \"time\",\n\t\tafter: \" without time zone\"\n\t}],\n\t[\"timetz\", {\n\t\tname: \"time\",\n\t\tafter: \" with time zone\"\n\t}]\n]);\nconst TYPE_NAME_PARTS = /^([a-z][a-z0-9 ]*?)(\\([^)]*\\))?$/;\n/** A type named as introspection reports it, as `format_type` displays it: `int4` as `integer`, and `timestamptz(3)` as `timestamp(3) with time zone`. */\nfunction formatTypeDisplay(typeName) {\n\tconst parts = TYPE_NAME_PARTS.exec(typeName);\n\tconst display = parts === null ? void 0 : FORMAT_TYPE_DISPLAY.get(parts[1] ?? \"\");\n\tif (parts === null || display === void 0) return typeName;\n\treturn `${display.name}${parts[2] ?? \"\"}${display.after}`;\n}\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = /* @__PURE__ */ new Set([\n\t\"all\",\n\t\"analyse\",\n\t\"analyze\",\n\t\"and\",\n\t\"any\",\n\t\"array\",\n\t\"as\",\n\t\"asc\",\n\t\"asymmetric\",\n\t\"authorization\",\n\t\"between\",\n\t\"binary\",\n\t\"both\",\n\t\"case\",\n\t\"cast\",\n\t\"check\",\n\t\"collate\",\n\t\"column\",\n\t\"constraint\",\n\t\"create\",\n\t\"current_catalog\",\n\t\"current_date\",\n\t\"current_role\",\n\t\"current_time\",\n\t\"current_timestamp\",\n\t\"current_user\",\n\t\"default\",\n\t\"deferrable\",\n\t\"desc\",\n\t\"distinct\",\n\t\"do\",\n\t\"else\",\n\t\"end\",\n\t\"except\",\n\t\"false\",\n\t\"fetch\",\n\t\"for\",\n\t\"foreign\",\n\t\"freeze\",\n\t\"from\",\n\t\"full\",\n\t\"grant\",\n\t\"group\",\n\t\"having\",\n\t\"ilike\",\n\t\"in\",\n\t\"initially\",\n\t\"inner\",\n\t\"intersect\",\n\t\"into\",\n\t\"is\",\n\t\"isnull\",\n\t\"join\",\n\t\"lateral\",\n\t\"leading\",\n\t\"left\",\n\t\"like\",\n\t\"limit\",\n\t\"localtime\",\n\t\"localtimestamp\",\n\t\"natural\",\n\t\"not\",\n\t\"notnull\",\n\t\"null\",\n\t\"offset\",\n\t\"on\",\n\t\"only\",\n\t\"or\",\n\t\"order\",\n\t\"outer\",\n\t\"overlaps\",\n\t\"placing\",\n\t\"primary\",\n\t\"references\",\n\t\"right\",\n\t\"select\",\n\t\"session_user\",\n\t\"similar\",\n\t\"some\",\n\t\"symmetric\",\n\t\"table\",\n\t\"then\",\n\t\"to\",\n\t\"trailing\",\n\t\"true\",\n\t\"union\",\n\t\"unique\",\n\t\"user\",\n\t\"using\",\n\t\"variadic\",\n\t\"verbose\",\n\t\"when\",\n\t\"where\",\n\t\"window\",\n\t\"with\"\n]);\nfunction formatUserDefinedTypeName(identifier) {\n\tif (UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) && !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)) return identifier;\n\treturn quoteIdentifier(identifier);\n}\nfunction buildExpectedFormatType(column, codecHooks, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tif (resolved.typeParams && resolved.codecId) {\n\t\tconst hooks = codecHooks.get(resolved.codecId);\n\t\tif (hooks?.expandNativeType) return formatTypeDisplay(normalizeSchemaNativeType(hooks.expandNativeType({\n\t\t\tnativeType: resolved.nativeType,\n\t\t\tcodecId: resolved.codecId,\n\t\t\ttypeParams: resolved.typeParams\n\t\t})));\n\t}\n\tif (column.typeRef) return formatUserDefinedTypeName(resolved.nativeType);\n\treturn formatTypeDisplay(withLengthOneWhenBare(normalizeSchemaNativeType(resolved.nativeType)));\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-Bxz8yvg8.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;AAEA,MAAM,sCAAsC,IAAI,IAAI;CACnD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,aAAa;EACb,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,eAAe;EACf,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,QAAQ;EACR,MAAM;EACN,OAAO;CACR,CAAC;CACD,CAAC,UAAU;EACV,MAAM;EACN,OAAO;CACR,CAAC;AACF,CAAC;AACD,MAAM,kBAAkB;;AAExB,SAAS,kBAAkB,UAAU;CACpC,MAAM,QAAQ,gBAAgB,KAAK,QAAQ;CAC3C,MAAM,UAAU,UAAU,OAAO,KAAK,IAAI,oBAAoB,IAAI,MAAM,MAAM,EAAE;CAChF,IAAI,UAAU,QAAQ,YAAY,KAAK,GAAG,OAAO;CACjD,OAAO,GAAG,QAAQ,OAAO,MAAM,MAAM,KAAK,QAAQ;AACnD;AACA,MAAM,uCAAuC;AAC7C,MAAM,qDAAqD,IAAI,IAAI;CAClE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,0BAA0B,YAAY;CAC9C,IAAI,qCAAqC,KAAK,UAAU,KAAK,CAAC,mCAAmC,IAAI,UAAU,GAAG,OAAO;CACzH,OAAO,gBAAgB,UAAU;AAClC;AACA,SAAS,wBAAwB,QAAQ,YAAY,eAAe,CAAC,GAAG;CACvE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,IAAI,SAAS,cAAc,SAAS,SAAS;EAC5C,MAAM,QAAQ,WAAW,IAAI,SAAS,OAAO;EAC7C,IAAI,OAAO,kBAAkB,OAAO,kBAAkB,0BAA0B,MAAM,iBAAiB;GACtG,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;EACtB,CAAC,CAAC,CAAC;CACJ;CACA,IAAI,OAAO,SAAS,OAAO,0BAA0B,SAAS,UAAU;CACxE,OAAO,kBAAkB,sBAAsB,0BAA0B,SAAS,UAAU,CAAC,CAAC;AAC/F"}
@@ -1,6 +1,6 @@
1
1
  import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
2
- import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-yugFGBdS-5cY1PCmb.mjs";
3
- import { c as postgresAuthoringEntityTypes } from "./authoring-2oKPEpBv-DfCFpeuD.mjs";
2
+ import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-C8slJGZo-CFGUyJPt.mjs";
3
+ import { c as postgresAuthoringEntityTypes } from "./authoring-DULm2ZZP-DgykBF-F.mjs";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
6
6
  import { isAuthoringEntityTypeDescriptor } from "@prisma/orm-framework/components/authoring";
@@ -9,7 +9,7 @@ import { buildSqlSchemaQualifiedView } from "@prisma/orm-family-sql/contract/con
9
9
  import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing-utils";
10
10
  import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
11
11
  import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
12
- //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-CUWYe586.mjs
12
+ //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-BEp5ikai.mjs
13
13
  const POSTGRES_AUTHORING_CTX = {
14
14
  family: "sql",
15
15
  target: "postgres",
@@ -141,4 +141,4 @@ const PostgresContractView = {
141
141
  //#endregion
142
142
  export { PostgresContractView as n, PostgresContractSerializer as t };
143
143
 
144
- //# sourceMappingURL=postgres-contract-view-CUWYe586-CHykrpRs.mjs.map
144
+ //# sourceMappingURL=postgres-contract-view-BEp5ikai-BmYXd1MR.mjs.map