@prisma/orm-target-postgres 8.0.0-rc.24-dev.40 → 8.0.0-rc.24-dev.41

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 (76) hide show
  1. package/dist/{adapter-VDAs5CMq-OezO60C5.mjs → adapter-CHlJgR4S-CLUPSnvo.mjs} +3 -3
  2. package/dist/{adapter-VDAs5CMq-OezO60C5.mjs.map → adapter-CHlJgR4S-CLUPSnvo.mjs.map} +1 -1
  3. package/dist/adapter.mjs +2 -2
  4. package/dist/adapter__adapter.mjs +2 -2
  5. package/dist/adapter__control.mjs +2 -2
  6. package/dist/adapter__control.mjs.map +1 -1
  7. package/dist/adapter__runtime.mjs +2 -2
  8. package/dist/adapter__runtime.mjs.map +1 -1
  9. package/dist/{authoring-4dCWsSXg-DeIEoQWg.mjs → authoring-ZsHi4vLr-qbZ1hNzY.mjs} +3 -3
  10. package/dist/{authoring-4dCWsSXg-DeIEoQWg.mjs.map → authoring-ZsHi4vLr-qbZ1hNzY.mjs.map} +1 -1
  11. package/dist/{contract-contributions-DG0aJRRu-31YCQkp-.mjs → contract-contributions-BB4GLsqV-DRI0-5Oy.mjs} +19 -10
  12. package/dist/contract-contributions-BB4GLsqV-DRI0-5Oy.mjs.map +1 -0
  13. package/dist/{contract-free-dQ4A6kPg.mjs → contract-free-C74Twi_E.mjs} +3 -3
  14. package/dist/{contract-free-dQ4A6kPg.mjs.map → contract-free-C74Twi_E.mjs.map} +1 -1
  15. package/dist/{control-policy-Crcjg7Vz-39_fO8yR.mjs → control-policy-Ckz2Fs57-C98YTOWU.mjs} +21 -8
  16. package/dist/control-policy-Ckz2Fs57-C98YTOWU.mjs.map +1 -0
  17. package/dist/{ddl-Cy_8QS23-D9EVihrI.mjs → ddl-BcqT3JRx-Dz0WRW0c.mjs} +3 -3
  18. package/dist/{ddl-Cy_8QS23-D9EVihrI.mjs.map → ddl-BcqT3JRx-Dz0WRW0c.mjs.map} +1 -1
  19. package/dist/{descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs → descriptor-meta-CqWmMocA-D_Sj3QrO.mjs} +3 -3
  20. package/dist/{descriptor-meta-DwXEu6Ap-qDhyaRK4.mjs.map → descriptor-meta-CqWmMocA-D_Sj3QrO.mjs.map} +1 -1
  21. package/dist/{descriptor-meta-CakMYWwZ-DSQNCwWB.mjs → descriptor-meta-D49elEeZ-Bx0EB8FX.mjs} +4 -4
  22. package/dist/{descriptor-meta-CakMYWwZ-DSQNCwWB.mjs.map → descriptor-meta-D49elEeZ-Bx0EB8FX.mjs.map} +1 -1
  23. package/dist/{diff-database-schema-CVmwyjFf-DSWPpd4M.mjs → diff-database-schema-LHXykgph-DoYVYqfq.mjs} +15 -20
  24. package/dist/diff-database-schema-LHXykgph-DoYVYqfq.mjs.map +1 -0
  25. package/dist/{infer-psl-contract-DgQutzGt-C1wN72ZC.mjs → infer-psl-contract-C12P-2OG-ChFgcM6f.mjs} +14 -5
  26. package/dist/infer-psl-contract-C12P-2OG-ChFgcM6f.mjs.map +1 -0
  27. package/dist/migration-Be_iuIpn.mjs.map +1 -1
  28. package/dist/{op-factory-call-DvezqqJx-KBDyNT08.mjs → op-factory-call-BQOeT_F--DpdYzN0o.mjs} +5 -5
  29. package/dist/{op-factory-call-DvezqqJx-KBDyNT08.mjs.map → op-factory-call-BQOeT_F--DpdYzN0o.mjs.map} +1 -1
  30. package/dist/{planner-D2T46plG-BChGUTOA.mjs → planner-UNJid9ms-DiphUfCo.mjs} +12 -12
  31. package/dist/planner-UNJid9ms-DiphUfCo.mjs.map +1 -0
  32. package/dist/{planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs → planner-produced-postgres-migration-0n4ABKFA-Cu07sYKL.mjs} +5 -5
  33. package/dist/{planner-produced-postgres-migration-BLKk9Vaz-CsUhcKp1.mjs.map → planner-produced-postgres-migration-0n4ABKFA-Cu07sYKL.mjs.map} +1 -1
  34. package/dist/{planner-sql-checks-CzxowQml-moHPNh20.mjs → planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs} +3 -3
  35. package/dist/{planner-sql-checks-CzxowQml-moHPNh20.mjs.map → planner-sql-checks-DE7POy4E-BAVOBp_Q.mjs.map} +1 -1
  36. package/dist/{postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs → postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs} +4 -4
  37. package/dist/{postgres-contract-view-DhDzWNCN-BA5OpwhY.mjs.map → postgres-contract-view-CCbDZeIo-CK9z1Hw9.mjs.map} +1 -1
  38. package/dist/{postgres-migration-DEa-g6j1-CoG3QOV3.mjs → postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs} +12 -12
  39. package/dist/postgres-migration-BZ4z5KJ6-Cmya-r8H.mjs.map +1 -0
  40. package/dist/{postgres-schema-CIfq1AjC-CGiMjtSX.mjs → postgres-schema-BaGmKymi-WHJQsmeb.mjs} +8 -3
  41. package/dist/postgres-schema-BaGmKymi-WHJQsmeb.mjs.map +1 -0
  42. package/dist/{prisma7-binding-BRPindAK.mjs → prisma7-binding-D9c8koix.mjs} +4 -4
  43. package/dist/{prisma7-binding-BRPindAK.mjs.map → prisma7-binding-D9c8koix.mjs.map} +1 -1
  44. package/dist/{render-ops-Bl1R5cz0-CFshOROt.mjs → render-ops-Owjb6xFw-ClGtnwWZ.mjs} +3 -3
  45. package/dist/{render-ops-Bl1R5cz0-CFshOROt.mjs.map → render-ops-Owjb6xFw-ClGtnwWZ.mjs.map} +1 -1
  46. package/dist/{render-typescript-B-Igkk6D-CQ-WlBmb.mjs → render-typescript-kNKf8www-Cyz2V7o5.mjs} +3 -3
  47. package/dist/{render-typescript-B-Igkk6D-CQ-WlBmb.mjs.map → render-typescript-kNKf8www-Cyz2V7o5.mjs.map} +1 -1
  48. package/dist/{resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs → resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs} +3 -3
  49. package/dist/{resolve-ddl-schema-C2KTxEX3-D8Jd9Rx1.mjs.map → resolve-ddl-schema-DjC64uGi-CDs0tX1m.mjs.map} +1 -1
  50. package/dist/runtime-BArZXVRj.mjs.map +1 -1
  51. package/dist/target.mjs +18 -18
  52. package/dist/target__contract-free.mjs +3 -3
  53. package/dist/target__control.mjs +10 -10
  54. package/dist/target__control.mjs.map +1 -1
  55. package/dist/target__diff-database-schema.mjs +1 -1
  56. package/dist/target__issue-planner.mjs +1 -1
  57. package/dist/target__migration.mjs +1 -1
  58. package/dist/target__op-factory-call.mjs +1 -1
  59. package/dist/target__pack.mjs +1 -1
  60. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  61. package/dist/target__planner-sql-checks.mjs +1 -1
  62. package/dist/target__planner.mjs +2 -2
  63. package/dist/target__prisma7-binding.mjs +1 -1
  64. package/dist/target__render-ops.mjs +1 -1
  65. package/dist/target__render-typescript.mjs +1 -1
  66. package/dist/target__runtime.mjs +1 -1
  67. package/dist/target__schema-ir-annotations.mjs +1 -1
  68. package/dist/target__types.mjs +1 -1
  69. package/package.json +10 -10
  70. package/dist/contract-contributions-DG0aJRRu-31YCQkp-.mjs.map +0 -1
  71. package/dist/control-policy-Crcjg7Vz-39_fO8yR.mjs.map +0 -1
  72. package/dist/diff-database-schema-CVmwyjFf-DSWPpd4M.mjs.map +0 -1
  73. package/dist/infer-psl-contract-DgQutzGt-C1wN72ZC.mjs.map +0 -1
  74. package/dist/planner-D2T46plG-BChGUTOA.mjs.map +0 -1
  75. package/dist/postgres-migration-DEa-g6j1-CoG3QOV3.mjs.map +0 -1
  76. package/dist/postgres-schema-CIfq1AjC-CGiMjtSX.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"control-policy-Crcjg7Vz-39_fO8yR.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/control-policy-Crcjg7Vz.mjs"],"sourcesContent":["import { A as pgText, E as pgNumeric, H as pgVarbit, I as pgTimestamptz, M as pgTime, P as pgTimestamp, R as pgTimetz, U as pgVarchar, _ as pgInt2, h as pgFloat8, m as pgFloat4, v as pgInt4, y as pgInt8 } from \"./data-types-DgYRia-g.mjs\";\nimport \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-CIfq1AjC.mjs\";\nimport { i as hasAutoincrementDefault, n as autoincrementWidthOfDataType } from \"./autoincrement-widths-BZUr8bLa.mjs\";\nimport { a as stackDataTypes } from \"./planner-sql-checks-CzxowQml.mjs\";\nimport { A as EnableRowLevelSecurityCall, C as DropExtensionCall, E as DropNotNullCall, G as SetExtensionSchemaCall, K as SetNotNullCall, N as RawSqlCall, S as DropDefaultCall, T as DropNativeEnumTypeCall, W as SetDefaultCall, Y as columnNameOfCall, Z as postgresDefaultToDdlColumnDefault, a as AddNativeEnumValueCall, b as DropColumnCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, k as DropTableCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DisableRowLevelSecurityCall, w as DropIndexCall, x as DropConstraintCall, y as DropCheckConstraintCall } from \"./op-factory-call-DvezqqJx.mjs\";\nimport { a as searchPathFix, i as offSearchPathText, l as postgresNodeEntityKind, n as PostgresNativeEnumSchemaNode, o as PostgresSchemaNodeKind, r as PostgresExtensionSchemaNode, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-OQRI_GIM.mjs\";\nimport { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from \"./default-constraint-names-Cz9Yoeim.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CUEF0s90.mjs\";\nimport { t as buildColumnTypeSql } from \"./planner-ddl-builders-Blf3qKKf.mjs\";\nimport { n as resolveIdentityValue } from \"./planner-identity-values-CX3J2pLA.mjs\";\nimport { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { isSqlDataType, renderSqlTypeName } from \"@internal/sql-contract/data-type\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { issueOutcome, orderIssuesByDependencies } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID, entityAt } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport * as contractFree from \"@internal/sql-relational-core/contract-free\";\nimport { columnTakesTemporaryValue } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, sqlColumnTypesEqual } from \"@internal/sql-schema-ir/types\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/core/schema-ir/node-storage-coordinate.ts\n/**\n* The storage-`entries` coordinate `(entityKind, entityName)` a Postgres diff\n* node addresses — a table by its name, a native enum by its physical type\n* name. `undefined` for a node that is not a whole storage entity (a namespace,\n* a column, a policy). Lets ownership/subject resolution treat every entity kind\n* uniformly, the node self-describing its storage identity.\n*/\nfunction postgresNodeStorageCoordinate(node) {\n\tif (PostgresTableSchemaNode.is(node)) {\n\t\tconst entityKind = postgresNodeEntityKind(node.nodeKind);\n\t\treturn entityKind === void 0 ? void 0 : {\n\t\t\tentityKind,\n\t\t\tentityName: node.name\n\t\t};\n\t}\n\tif (PostgresNativeEnumSchemaNode.is(node)) {\n\t\tconst entityKind = postgresNodeEntityKind(node.nodeKind);\n\t\treturn entityKind === void 0 ? void 0 : {\n\t\t\tentityKind,\n\t\t\tentityName: node.typeName\n\t\t};\n\t}\n\tif (PostgresExtensionSchemaNode.is(node)) {\n\t\tconst entityKind = postgresNodeEntityKind(node.nodeKind);\n\t\treturn entityKind === void 0 ? void 0 : {\n\t\t\tentityKind,\n\t\t\tentityName: node.name\n\t\t};\n\t}\n}\n//#endregion\n//#region src/core/migrations/column-ddl-rendering.ts\nconst AUTOINCREMENT = \"autoincrement()\";\n/**\n* Reconstructs the `StorageColumn`-shaped fields the DDL builder functions\n* (`buildColumnTypeSql`, `resolveIdentityValue`)\n* expect, from a column node's own stamped codec identity (`codecRef`,\n* Decision 5) — never the contract.\n*/\nfunction columnLike(column) {\n\treturn {\n\t\t...columnTypeLike(`column \"${column.name}\"`, column),\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"default\", column.authoredDefault ?? column.resolvedDefault)\n\t};\n}\nfunction columnTypeLike(owner, identity) {\n\tif (identity.codecRef === void 0) throw new InternalError(`columnTypeLike: expected ${owner} carries no codec identity — the expected tree must be derived via contractToSchemaIR for planning`);\n\treturn {\n\t\tcodecId: identity.codecRef.codecId,\n\t\tmany: identity.many ?? identity.codecRef.many ? { elementNullable: false } : false,\n\t\t...ifDefined(\"typeParams\", identity.codecRef.typeParams !== void 0 ? blindCast(identity.codecRef.typeParams) : void 0)\n\t};\n}\n/**\n* The type DDL writes for a column node: the name of the type it is stored as, with the parameters as the contract writes them, `[]` for a list, and for an `autoincrement()` column of an integer type the serial pseudo-type when `allowPseudoTypes`.\n*/\nfunction columnTypeSql(column, allowPseudoTypes) {\n\tconst type = column.storedType;\n\tif (type === void 0 || !isSqlDataType(type)) throw new InternalError(`column \"${column.name}\" has no data type; the expected tree must be derived via contractToSchemaIR for planning`);\n\tconst columnDefault = column.authoredDefault ?? column.resolvedDefault;\n\tif (allowPseudoTypes && columnDefault?.kind === \"function\" && columnDefault.expression === AUTOINCREMENT) {\n\t\tconst width = autoincrementWidthOfDataType(type.id);\n\t\tif (width !== void 0) return width.serialType;\n\t}\n\tconst typeSql = renderSqlTypeName(type, dataTypeParams(type, column.codecRef?.typeParams));\n\treturn column.many ?? column.codecRef?.many ? `${typeSql}[]` : typeSql;\n}\n/**\n* Builds the `CREATE TABLE` / `ADD COLUMN` DDL column for an expected column\n* node, writing its type from the type the column is stored as.\n*/\nfunction renderColumnDdl(name, column) {\n\tconst typeSql = columnTypeSql(column, true);\n\tconst ddlDefault = postgresDefaultToDdlColumnDefault(column.authoredDefault ?? column.resolvedDefault);\n\treturn contractFree.col(name, typeSql, {\n\t\t...!column.nullable ? { notNull: true } : {},\n\t\t...ifDefined(\"default\", ddlDefault),\n\t\t...ifDefined(\"codecRef\", column.codecRef)\n\t});\n}\n/**\n* Builds the `ALTER COLUMN … TYPE` operands for an expected column node.\n*/\nfunction renderColumnAlterType(column) {\n\treturn columnTypeSql(column, false);\n}\n/**\n* Resolves the identity value (monoid neutral element) SQL literal used as\n* the temporary default when adding a NOT-NULL column with no contract\n* default (`notNullAddColumnCallStrategy`'s shared-temp-default backfill).\n* `null` when the column's type has no built-in/codec-provided identity\n* value.\n*/\nfunction resolveColumnTemporaryDefault(column, codecHooks, types) {\n\treturn resolveIdentityValue(columnLike(column), codecHooks, types);\n}\n/**\n* The column whose `SET DEFAULT` a column-default diff node asks for, carrying its authored default, or its resolved one when nothing was authored, and its type and codec, from which the adapter writes the clause. An `autoincrement()` default is carried as itself, for `setDefault` to attach a sequence, or to refuse when the column is not a smallint, integer or bigint. `undefined` when the node carries no default, or one DDL does not write.\n*/\nfunction buildSetDefaultColumn(columnName, defaultNode, types) {\n\tconst authored = defaultNode.authored ?? defaultNode.resolved;\n\tif (authored === void 0) return void 0;\n\tconst typeLike = columnTypeLike(\"column default\", defaultNode);\n\tif (authored.kind === \"function\" && authored.expression === AUTOINCREMENT) return contractFree.col(columnName, buildColumnTypeSql(typeLike, types, false), {\n\t\tdefault: contractFree.fn(AUTOINCREMENT),\n\t\t...ifDefined(\"codecRef\", defaultNode.codecRef)\n\t});\n\tconst ddlDefault = postgresDefaultToDdlColumnDefault(authored);\n\tif (ddlDefault === void 0) return void 0;\n\treturn contractFree.col(columnName, buildColumnTypeSql(typeLike, types, false), {\n\t\tdefault: ddlDefault,\n\t\t...ifDefined(\"codecRef\", defaultNode.codecRef)\n\t});\n}\n//#endregion\n//#region src/core/migrations/primary-key-change.ts\nfunction keyChangeOf(issue) {\n\tconst ddlSchemaName = issueSchemaName(issue);\n\tconst tableName = issueTableName(issue);\n\tif (issueNode(issue)?.nodeKind !== RelationalSchemaNodeKind.primaryKey || issueOutcome(issue) === \"not-found\" || ddlSchemaName === void 0 || tableName === void 0) return;\n\treturn {\n\t\tissue,\n\t\tddlSchemaName,\n\t\ttableName,\n\t\toldKey: blindCast(issue.actual)\n\t};\n}\nfunction sameColumnSet(left, right) {\n\treturn left.length === right.length && left.every((column) => right.includes(column));\n}\nfunction foreignKeysOf(tree) {\n\treturn Object.values(tree.namespaces).flatMap((namespace) => Object.values(namespace.tables).flatMap((table) => table.foreignKeys.map((foreignKey) => ({\n\t\tddlSchemaName: namespace.schemaName,\n\t\ttableName: table.name,\n\t\tforeignKey\n\t}))));\n}\nfunction referencesKey(at, change) {\n\treturn (at.foreignKey.resolvedReferencedNamespace ?? at.ddlSchemaName) === change.ddlSchemaName && at.foreignKey.referencedTable === change.tableName && sameColumnSet(at.foreignKey.referencedColumns, change.oldKey.columns);\n}\nfunction isTableIssueOf(issue, at) {\n\treturn issueSchemaName(issue) === at.ddlSchemaName && issueTableName(issue) === at.tableName;\n}\nfunction hasOwnIssue(at, issues) {\n\treturn issues.some((issue) => issueNode(issue)?.nodeKind === RelationalSchemaNodeKind.foreignKey && isTableIssueOf(issue, at) && issue.actual?.id === at.foreignKey.id);\n}\nfunction dropsTable(at, issues) {\n\treturn issues.some((issue) => issueNode(issue)?.nodeKind === PostgresSchemaNodeKind.table && issueOutcome(issue) === \"not-expected\" && isTableIssueOf(issue, at));\n}\nfunction endForeignKey(endTree, at) {\n\treturn Object.values(endTree.namespaces).find((candidate) => candidate.schemaName === at.ddlSchemaName)?.tables[at.tableName]?.foreignKeys.find((foreignKey) => foreignKey.id === at.foreignKey.id);\n}\nfunction foreignKeyName(at) {\n\treturn at.foreignKey.name ?? defaultForeignKeyName(at.tableName, at.foreignKey.columns);\n}\nconst migrationNewAdvice = \"write the change as its own migration with prisma migration new, dropping that foreign key before the key change and adding it back after it.\";\nfunction quotedTable(at) {\n\treturn `\"${at.ddlSchemaName}\".\"${at.tableName}\"`;\n}\nfunction blockedKeyChange(change, at, reason, why) {\n\tconst keyName = change.oldKey.name ?? defaultPrimaryKeyName(change.tableName);\n\tconst name = foreignKeyName(at);\n\treturn {\n\t\tkind: \"foreignKeyConflict\",\n\t\tsummary: `Primary key \"${keyName}\" on \"${change.ddlSchemaName}\".\"${change.tableName}\" cannot change while foreign key \"${name}\" on ${quotedTable(at)} references it, and ${reason}.`,\n\t\twhy,\n\t\tlocation: {\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: at.tableName,\n\t\t\tconstraint: name\n\t\t}\n\t};\n}\nfunction controlPolicyRefusal(change, at, declared) {\n\tconst table = quotedTable(at);\n\tconst dbUpdateAdvice = declared ? \"With db update, drop that foreign key yourself and leave it out of the contract, run db update, then add the foreign key back to both if you still want it and run db update again.\" : \"With db update, drop that foreign key yourself, run db update, then add the foreign key back if you still want it.\";\n\treturn blockedKeyChange(change, at, `the control policy does not let this plan change ${table}`, `With migration plan, give ${table} a control policy that lets this plan change it and plan again, or ${migrationNewAdvice} ${dbUpdateAdvice}`);\n}\nfunction otherSpaceRefusal(change, at) {\n\tconst table = quotedTable(at);\n\treturn blockedKeyChange(change, at, `another contract space owns ${table}`, `Change that foreign key through the contract space that owns ${table}, or ${migrationNewAdvice}`);\n}\nfunction undeclaredTableRefusal(change, at) {\n\tconst table = quotedTable(at);\n\treturn blockedKeyChange(change, at, `the contract does not declare ${table}`, `This plan allows only additive changes, as db init does, so it cannot change a primary key. Run db update instead, which drops ${table} together with its foreign key; add ${table} to the contract first if you want to keep it.`);\n}\nfunction removedForeignKeyRefusal(change, at) {\n\treturn blockedKeyChange(change, at, `the contract leaves that foreign key out of ${quotedTable(at)}`, \"This plan allows only additive changes, as db init does, so it can neither drop that foreign key nor change a primary key. Run db update instead, which drops that foreign key before the key change.\");\n}\nfunction undeclaredSchemaRefusal(change, at) {\n\tconst table = quotedTable(at);\n\treturn blockedKeyChange(change, at, `the contract does not declare schema \"${at.ddlSchemaName}\", whose tables a plan never drops`, `With migration plan, declare ${table} in the contract and plan again, or ${migrationNewAdvice} With db update, drop that foreign key yourself, run db update, then add the foreign key back if you still want it.`);\n}\nfunction allowsOnlyAdditive(ctx) {\n\tconst allowed = ctx.policy.allowedOperationClasses;\n\treturn !allowed.includes(\"widening\") && !allowed.includes(\"destructive\");\n}\nfunction tableInEndTree(endTree, at) {\n\treturn Object.values(endTree.namespaces).some((namespace) => namespace.schemaName === at.ddlSchemaName && namespace.tables[at.tableName] !== void 0);\n}\nfunction keyCalls(change, ctx) {\n\tconst schemaName = emissionSchemaName(ctx, change.ddlSchemaName);\n\tconst drop = new DropConstraintCall(schemaName, change.tableName, change.oldKey.name ?? defaultPrimaryKeyName(change.tableName), \"primaryKey\");\n\tif (issueOutcome(change.issue) === \"not-expected\") return [drop];\n\tconst newKey = blindCast(change.issue.expected);\n\treturn [drop, new AddPrimaryKeyCall(schemaName, change.tableName, newKey.name ?? defaultPrimaryKeyName(change.tableName), [...newKey.columns])];\n}\n/**\n* Plans a primary key whose columns change, or that is removed: a drop of the old key, then an add of the new one. Postgres refuses to drop a key while a foreign key depends on its index, so every foreign key of the start tree that references the old key's columns is dropped first, unless its own issue already drops it, and added back from the end tree. The plan refuses the change instead when such a foreign key is on a table the control policy keeps it away from or another contract space owns, or when the end tree leaves the foreign key out and the plan does not drop it or its table: under a policy that allows additive changes alone, as `db init` does, or because the table is in a schema the end contract does not declare.\n*/\nfunction primaryKeyChangeStrategy(issues, ctx) {\n\tconst changes = issues.flatMap((issue) => keyChangeOf(issue) ?? []);\n\tif (changes.length === 0) return { kind: \"no_match\" };\n\tconst startForeignKeys = foreignKeysOf(ctx.startTree);\n\tconst calls = [];\n\tconst conflicts = [];\n\tfor (const change of changes) {\n\t\tconst changeCalls = [];\n\t\tconst changeConflicts = [];\n\t\tfor (const at of startForeignKeys) {\n\t\t\tif (!referencesKey(at, change) || hasOwnIssue(at, ctx.allIssues)) continue;\n\t\t\tconst drop = new DropConstraintCall(emissionSchemaName(ctx, at.ddlSchemaName), at.tableName, foreignKeyName(at), \"foreignKey\");\n\t\t\tconst kept = endForeignKey(ctx.endTree, at);\n\t\t\tconst authority = ctx.foreignKeyDropAuthority(at.ddlSchemaName, at.tableName, at.foreignKey);\n\t\t\tif (authority !== \"allowed\") {\n\t\t\t\tchangeConflicts.push(authority === \"otherSpace\" ? otherSpaceRefusal(change, at) : controlPolicyRefusal(change, at, kept !== void 0));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (kept !== void 0) changeCalls.push(drop, new AddForeignKeyCall(drop.schemaName, at.tableName, fkSpecFromNode(kept, at.tableName)));\n\t\t\telse if (dropsTable(at, ctx.allIssues)) changeCalls.push(drop);\n\t\t\telse changeConflicts.push(tableInEndTree(ctx.endTree, at) ? removedForeignKeyRefusal(change, at) : allowsOnlyAdditive(ctx) ? undeclaredTableRefusal(change, at) : undeclaredSchemaRefusal(change, at));\n\t\t}\n\t\tif (changeConflicts.length > 0) conflicts.push(...changeConflicts);\n\t\telse calls.push(...changeCalls, ...keyCalls(change, ctx));\n\t}\n\tconst consumed = new Set(changes.map((change) => change.issue));\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((issue) => !consumed.has(issue)),\n\t\tcalls,\n\t\tconflicts\n\t};\n}\n//#endregion\n//#region src/core/migrations/safe-widenings.ts\n/** The changes between data types that keep every value: each pair is `from→to` by data type id. */\nconst SAFE_WIDENINGS = /* @__PURE__ */ new Set([\n\t`${pgInt2.id}→${pgInt4.id}`,\n\t`${pgInt2.id}→${pgInt8.id}`,\n\t`${pgInt4.id}→${pgInt8.id}`,\n\t`${pgInt2.id}→${pgFloat4.id}`,\n\t`${pgInt2.id}→${pgFloat8.id}`,\n\t`${pgInt4.id}→${pgFloat8.id}`,\n\t`${pgFloat4.id}→${pgFloat8.id}`,\n\t`${pgVarchar.id}→${pgText.id}`,\n\t`${pgInt2.id}→${pgText.id}`,\n\t`${pgInt4.id}→${pgText.id}`,\n\t`${pgInt8.id}→${pgText.id}`,\n\t`${pgNumeric.id}→${pgText.id}`,\n\t`${pgFloat4.id}→${pgText.id}`,\n\t`${pgFloat8.id}→${pgText.id}`\n]);\n/** Types whose `length` caps their values; a larger cap, or none, keeps every value. */\nconst LENGTH_CAPPED = /* @__PURE__ */ new Set([pgVarchar.id, pgVarbit.id]);\n/** Types whose `precision` rounds their fractional seconds; more, or none, keeps every value. */\nconst PRECISION_ROUNDED = /* @__PURE__ */ new Set([\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id\n]);\nfunction numberParam(params, key) {\n\tconst value = params[key];\n\treturn typeof value === \"number\" ? value : void 0;\n}\n/** Whether a cap, where `undefined` means none, is at least as large as before. */\nfunction capGrows(from, to) {\n\treturn to === void 0 || from !== void 0 && to >= from;\n}\n/**\n* A `numeric` keeps every value when it allows at least as many digits before the point and after\n* it; an unconstrained `numeric` holds any value.\n*/\nfunction numericGrows(from, to) {\n\tconst toPrecision = numberParam(to, \"precision\");\n\tif (toPrecision === void 0) return true;\n\tconst fromPrecision = numberParam(from, \"precision\");\n\tif (fromPrecision === void 0) return false;\n\tconst fromScale = numberParam(from, \"scale\") ?? 0;\n\tconst toScale = numberParam(to, \"scale\") ?? 0;\n\treturn toScale >= fromScale && toPrecision - toScale >= fromPrecision - fromScale;\n}\n/** Whether changing a column from one type to another keeps every value: both have a stored type, and the pair is a safe widening by stored type id and parameters in normal form. */\nfunction isSafeTypeWidening(from, to) {\n\tif (from.storedType === void 0 || to.storedType === void 0) return false;\n\tconst fromId = from.storedType.id;\n\tconst toId = to.storedType.id;\n\tconst fromParams = from.storedTypeParams ?? {};\n\tconst toParams = to.storedTypeParams ?? {};\n\tif (SAFE_WIDENINGS.has(`${fromId}→${toId}`)) return true;\n\tif (fromId !== toId) return false;\n\tif (LENGTH_CAPPED.has(fromId)) return capGrows(numberParam(fromParams, \"length\"), numberParam(toParams, \"length\"));\n\tif (PRECISION_ROUNDED.has(fromId)) return capGrows(numberParam(fromParams, \"precision\"), numberParam(toParams, \"precision\"));\n\tif (fromId === pgNumeric.id) return numericGrows(fromParams, toParams);\n\treturn false;\n}\n/** Whether changing a live column to the contract's column keeps every value. A list column never widens safely. */\nfunction liveColumnWidensSafely(expected, actual) {\n\tif (expected.many === true || actual.many === true) return false;\n\treturn isSafeTypeWidening(actual, expected);\n}\n//#endregion\n//#region src/core/migrations/planner-strategies.ts\n/**\n* Look up a storage table by its explicit namespace coordinate. Returns\n* `undefined` when the namespace has no table by that name (or no such\n* namespace exists). Callers that get `undefined` MUST treat it as an\n* explicit conflict — never silently fall back to a global default\n* schema or a name-only walk, because that footgun would resolve a\n* stale or duplicate table name to whichever namespace the iteration\n* order surfaced first (a real data-loss hazard in multi-namespace\n* contracts where two namespaces can carry the same table name).\n*/\nfunction tableAt(storage, namespaceId, tableName) {\n\tconst ns = storage.namespaces[namespaceId];\n\tif (ns === void 0) return void 0;\n\treturn ns.entries.table?.[tableName];\n}\n/**\n* Recovers the contract namespace id for a DDL schema name embedded in a\n* diff-issue path (`path[1]`). The strategies need the CONTRACT column/table\n* (for codec-hook reads and eligibility probes the retained subsystems still\n* run) even though the issue itself only carries the resolved DDL schema —\n* this is the reverse of `resolveDdlSchemaForNamespace`.\n*/\nfunction namespaceIdForDdlSchema(ctx, ddlSchemaName) {\n\treturn resolveNamespaceIdForDdlSchema(ctx.toContract, ddlSchemaName);\n}\n/** A `not-equal` column issue whose node pair is narrowed to `SqlColumnIR`. */\nfunction columnNodePair(issue) {\n\tconst node = issueNode(issue);\n\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) return void 0;\n\tif (issue.expected === void 0 || issue.actual === void 0) return void 0;\n\treturn {\n\t\texpected: blindCast(issue.expected),\n\t\tactual: blindCast(issue.actual)\n\t};\n}\n/** The `--backfill` statement's column an issue is about, if a statement names it. */\nfunction backfilled(ctx, ddlSchemaName, tableName, columnName) {\n\tconst namespaceId = namespaceIdForDdlSchema(ctx, ddlSchemaName);\n\treturn ctx.statementColumns.backfill.find((column) => column.namespaceId === namespaceId && column.table === tableName && column.column === columnName);\n}\n/**\n* Handles a required column with no default added to an existing table, for a field a\n* `--backfill` statement names: a nullable add, a data transform whose slots the user fills, then\n* `SET NOT NULL`. Every other such column is left to `notNullAddColumnCallStrategy`.\n*/\nconst notNullBackfillCallStrategy = (issues, ctx) => {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-found\") continue;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) continue;\n\t\tconst expected = blindCast(issue.expected);\n\t\tif (expected.nullable !== false || expected.resolvedDefault !== void 0) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst named = backfilled(ctx, ddlSchemaName, tableName, expected.name);\n\t\tif (named === void 0) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tconst slot = named.text;\n\t\tmatched.push(issue);\n\t\tconst ddl = renderColumnDdl(expected.name, expected);\n\t\tconst nullableSpec = contractFree.col(ddl.name, ddl.type, { ...ddl.codecRef !== void 0 ? { codecRef: ddl.codecRef } : {} });\n\t\tcalls.push(new AddColumnCall(schemaName, tableName, nullableSpec, ctx.dataTypes), new DataTransformCall(`backfill-${tableName}-${expected.name}`, `${slot}:check`, `${slot}:run`, \"data\", {\n\t\t\tschema: schemaName,\n\t\t\ttable: tableName,\n\t\t\tcolumn: expected.name\n\t\t}), new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* Handles a `not-equal` column issue whose type differs, for a field a `--convert` statement names,\n* in a plan that may include `data` operations: `migration plan`. The alter is classed `data` and\n* its USING clause is a slot the user fills with the conversion. A known-safe widening needs no\n* conversion and is left to `mapNodeIssueToCall`, as is every type change no statement names: a\n* direct alter, `widening` or `destructive`, which the plan asks about.\n*\n* One node issue can carry both type and nullability drift, so the strategy also emits the\n* nullability change: `SET NOT NULL` after the alter, whose conversion can map NULL to a value.\n*/\n/** A field as a statement names it: with its namespace only when the contract has several. */\nconst typeChangeCallStrategy = (issues, ctx) => {\n\tif (ctx.fromContract === null || !ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-equal\") continue;\n\t\tconst pair = columnNodePair(issue);\n\t\tif (pair === void 0) continue;\n\t\tconst { expected, actual } = pair;\n\t\tif (sqlColumnTypesEqual(expected, actual)) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst namespaceId = namespaceIdForDdlSchema(ctx, ddlSchemaName);\n\t\tconst converted = ctx.statementColumns.convert.find((column) => column.namespaceId === namespaceId && column.table === tableName && column.column === expected.name);\n\t\tif (converted === void 0) continue;\n\t\tif (isSafeTypeWidening(actual, expected)) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tmatched.push(issue);\n\t\tcalls.push(new AlterColumnTypeCall({\n\t\t\tschemaName,\n\t\t\ttableName,\n\t\t\tcolumnName: expected.name,\n\t\t\ttype: renderColumnAlterType(expected),\n\t\t\tusing: {\n\t\t\t\tkind: \"placeholder\",\n\t\t\t\tslot: `${converted.text}:convert`\n\t\t\t},\n\t\t\t...expected.catalogText !== void 0 ? { raw: true } : {},\n\t\t\tdataTypes: ctx.dataTypes,\n\t\t\townsAutoincrementSequence: hasAutoincrementDefault(actual)\n\t\t}));\n\t\tif (expected.nullable !== actual.nullable) calls.push(expected.nullable ? new DropNotNullCall(schemaName, tableName, expected.name) : new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* Handles a `not-equal` column issue whose type did not change but which becomes required, for a\n* field a `--backfill` statement names: a data transform whose slots the user fills with values for\n* the NULLs, then `SET NOT NULL`. Every other such column gets the direct `SET NOT NULL` of\n* `mapNodeIssueToCall`. A type-changed issue's nullability is handled by `typeChangeCallStrategy`\n* or the direct alter.\n*/\nconst nullableTighteningCallStrategy = (issues, ctx) => {\n\tif (!ctx.policy.allowedOperationClasses.includes(\"data\")) return { kind: \"no_match\" };\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-equal\") continue;\n\t\tconst pair = columnNodePair(issue);\n\t\tif (pair === void 0) continue;\n\t\tconst { expected, actual } = pair;\n\t\tif (!sqlColumnTypesEqual(expected, actual)) continue;\n\t\tif (expected.nullable !== false || actual.nullable !== true) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst named = backfilled(ctx, ddlSchemaName, tableName, expected.name);\n\t\tif (named === void 0) continue;\n\t\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\t\tconst slot = named.text;\n\t\tmatched.push(issue);\n\t\tcalls.push(new DataTransformCall(`handle-nulls-${tableName}-${expected.name}`, `${slot}:check`, `${slot}:run`, \"data\", {\n\t\t\tschema: schemaName,\n\t\t\ttable: tableName,\n\t\t\tcolumn: expected.name\n\t\t}), new SetNotNullCall(schemaName, tableName, expected.name));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls,\n\t\trecipe: true\n\t};\n};\n/**\n* Dispatches codec-typed storage types through their codec's\n* `planTypeOperations` hook (the authoritative source for codec-driven DDL\n* such as custom type creation). Codec extension/type ops are not modeled as\n* diff nodes — this strategy drives entirely off `ctx.toContract.storage.types`\n* + codec hooks, consuming nothing from the node issue list (there is no\n* node-vocabulary equivalent of `type_missing` / `enum_values_changed`).\n*/\nconst storageTypePlanCallStrategy = (issues, ctx) => {\n\tconst storageTypes = ctx.toContract.storage.types ?? {};\n\tif (Object.keys(storageTypes).length === 0) return { kind: \"no_match\" };\n\tconst calls = [];\n\tfor (const [typeName, typeInstance] of Object.entries(storageTypes).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tconst codecInstance = blindCast(typeInstance);\n\t\tconst hook = ctx.codecHooks.get(codecInstance.codecId);\n\t\tif (!hook?.planTypeOperations) continue;\n\t\tconst planResult = hook.planTypeOperations({\n\t\t\ttypeName,\n\t\t\ttypeInstance: codecInstance,\n\t\t\tcontract: ctx.toContract,\n\t\t\tschema: ctx.schema,\n\t\t\tschemaName: ctx.schemaName,\n\t\t\tpolicy: ctx.policy\n\t\t});\n\t\tif (!planResult) continue;\n\t\tfor (const op of planResult.operations) calls.push(new RawSqlCall(blindCast({\n\t\t\t...op,\n\t\t\ttarget: {\n\t\t\t\tid: op.target.id,\n\t\t\t\tdetails: buildTargetDetails(\"type\", typeName, ctx.schemaName)\n\t\t\t}\n\t\t})));\n\t}\n\tif (calls.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues,\n\t\tcalls\n\t};\n};\n/**\n* Handles `not-found` column issues for NOT NULL columns without a contract\n* default. Replaces the legacy `buildAddColumnItem` non-default branches.\n*\n* Two shapes:\n* - Shared-temp-default safe: emit a single atomic composite op (add\n* nullable → backfill identity value → `SET NOT NULL` → `DROP DEFAULT`).\n* The temp-default value is resolved from the column node's `codecRef`\n* (`resolveColumnTemporaryDefault`, wrapping `resolveIdentityValue`).\n* - Empty-table guarded, for a column in a key, or whose values come from a value set, which\n* no one value stands in for: emit a hand-built op with a `tableIsEmptyCheck`\n* precheck so the failure message is \"table is not empty\" rather than the\n* raw PG NOT NULL violation.\n*\n* \"Normal\" not-found column cases (nullable or has a contract default) are\n* left for `mapNodeIssueToCall`'s default `AddColumnCall` emission.\n*/\nconst notNullAddColumnCallStrategy = (issues, ctx) => {\n\tconst matched = [];\n\tconst calls = [];\n\tfor (const issue of issues) {\n\t\tif (issueOutcome(issue) !== \"not-found\") continue;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.column) continue;\n\t\tconst expected = blindCast(issue.expected);\n\t\tif (expected.nullable !== false || expected.resolvedDefault !== void 0) continue;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tconst tableName = issueTableName(issue);\n\t\tif (ddlSchemaName === void 0 || tableName === void 0) continue;\n\t\tconst namespaceId = namespaceIdForDdlSchema(ctx, ddlSchemaName);\n\t\tconst schemaName = namespaceId === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : ddlSchemaName;\n\t\tconst contractTable = tableAt(ctx.toContract.storage, namespaceId, tableName);\n\t\tconst column = contractTable?.columns[expected.name];\n\t\tif (!contractTable || !column) continue;\n\t\tif (ctx.schema.tables[tableName] === void 0) continue;\n\t\tconst temporaryDefault = resolveColumnTemporaryDefault(expected, ctx.codecHooks, ctx.types);\n\t\tconst canUseSharedTempDefault = temporaryDefault !== null && columnTakesTemporaryValue(contractTable, expected.name);\n\t\tmatched.push(issue);\n\t\tconst ddl = renderColumnDdl(expected.name, expected);\n\t\tcalls.push(canUseSharedTempDefault && temporaryDefault !== null ? new AddColumnWithTemporaryDefaultCall(schemaName, tableName, ddl.name, ddl.type, temporaryDefault, ctx.dataTypes) : new AddRequiredColumnToEmptyTableCall(schemaName, tableName, ddl.name, ddl.type, ctx.dataTypes));\n\t}\n\tif (matched.length === 0) return { kind: \"no_match\" };\n\treturn {\n\t\tkind: \"match\",\n\t\tissues: issues.filter((i) => !matched.includes(i)),\n\t\tcalls\n\t};\n};\n/**\n* Ordered list of Postgres planner strategies, shared by `migration plan`\n* and `db update` / `db init`. The issue planner runs each strategy in\n* order, letting it consume any issues it handles, and routes whatever's\n* left through `mapNodeIssueToCall`.\n*\n* The strategies that write a placeholder (`notNullBackfillCallStrategy`,\n* `typeChangeCallStrategy`, `nullableTighteningCallStrategy`) act only on a\n* field a `--backfill` or `--convert` statement names, and only when the\n* policy allows `data` (`migration plan`). Every other required field added to\n* an existing table gets the temporary default of\n* `notNullAddColumnCallStrategy`, and every other change the direct DDL of\n* `mapNodeIssueToCall`, under either command.\n*\n* Codec-typed storage type entries are dispatched through\n* `storageTypePlanCallStrategy`.\n*/\nconst postgresPlannerStrategies = [\n\tnotNullBackfillCallStrategy,\n\ttypeChangeCallStrategy,\n\tnullableTighteningCallStrategy,\n\tstorageTypePlanCallStrategy,\n\tnotNullAddColumnCallStrategy,\n\tprimaryKeyChangeStrategy\n];\n//#endregion\n//#region src/core/migrations/issue-planner.ts\nfunction issueConflict(kind, summary, location) {\n\treturn {\n\t\tkind,\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\t...location ? { location } : {}\n\t};\n}\n/**\n* Classifies calls into DDL sequencing buckets. The order matches the\n* legacy walk-schema planner's emission order so `db init` and `db update`\n* produce byte-identical plans for the shared shape (deps → drops → tables\n* → columns → alters → PKs → uniques → indexes → FKs).\n*\n* `dropType` (DROP TYPE for a managed native enum) is its own bucket, ordered\n* after the general drop bucket: a type can only be dropped once every table\n* whose column uses it is gone. A column→enum edge would make this precise,\n* but `coalesceSubtreeIssues` removes the column issue under a whole-table\n* drop, so the edge never reaches the graph; the coarse bucket stands in until\n* that edge lands (the coordinate work is a later slice).\n*/\nfunction classifyCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createExtension\":\n\t\tcase \"setExtensionSchema\":\n\t\tcase \"createSchema\":\n\t\tcase \"createNativeEnumType\":\n\t\tcase \"addNativeEnumValue\": return \"dep\";\n\t\tcase \"dropNativeEnumType\":\n\t\tcase \"dropExtension\": return \"dropType\";\n\t\tcase \"dropTable\":\n\t\tcase \"dropColumn\":\n\t\tcase \"dropConstraint\":\n\t\tcase \"dropCheckConstraint\":\n\t\tcase \"dropIndex\":\n\t\tcase \"dropDefault\": return \"drop\";\n\t\tcase \"addCheckConstraint\":\n\t\tcase \"renameConstraint\": return \"unique\";\n\t\tcase \"createTable\":\n\t\tcase \"renameTable\":\n\t\tcase \"setTableSchema\":\n\t\tcase \"renameSchema\": return \"table\";\n\t\tcase \"dropSchema\": return \"dropSchema\";\n\t\tcase \"enableRowLevelSecurity\":\n\t\tcase \"disableRowLevelSecurity\": return \"rlsEnable\";\n\t\tcase \"createRlsPolicy\": return \"rlsPolicy\";\n\t\tcase \"dropRlsPolicy\": return \"drop\";\n\t\tcase \"addColumn\":\n\t\tcase \"renameColumn\": return \"column\";\n\t\tcase \"replaceStoredValue\":\n\t\tcase \"removeStoredValue\":\n\t\tcase \"renameStoredKey\":\n\t\tcase \"removeStoredKey\":\n\t\tcase \"fillStoredKey\":\n\t\tcase \"deleteRows\":\n\t\tcase \"alterColumnType\":\n\t\tcase \"setNotNull\":\n\t\tcase \"dropNotNull\":\n\t\tcase \"setDefault\": return \"alter\";\n\t\tcase \"addPrimaryKey\": return \"primaryKey\";\n\t\tcase \"addUnique\": return \"unique\";\n\t\tcase \"createIndex\":\n\t\tcase \"renameIndex\": return \"index\";\n\t\tcase \"addForeignKey\": return \"foreignKey\";\n\t\tcase \"rawSql\":\n\t\t\tif (blindCast(call).op?.target?.details?.objectType === \"type\") return \"dep\";\n\t\t\treturn \"alter\";\n\t\tdefault: return \"alter\";\n\t}\n}\nconst DEFAULT_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\",\n\t\"data\"\n] };\nfunction emptySchemaIR() {\n\treturn new SqlSchemaIR({ tables: {} });\n}\n/**\n* Foreign key drops run first, then primary key and unique constraint drops, then the rest. A constraint never needs another object dropped before it, and a column or table drop takes its constraints with it, so this order is always valid.\n*/\nfunction dropRank(call) {\n\tif (call.factoryName !== \"dropConstraint\") return 2;\n\treturn call.kind === \"foreignKey\" ? 0 : 1;\n}\n/**\n* Schemas come first, then extensions, then the other dependencies such as enum types: an extension may be installed into a schema the same plan creates.\n*/\nfunction depRank(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"createSchema\": return 0;\n\t\tcase \"createExtension\":\n\t\tcase \"setExtensionSchema\": return 1;\n\t\tdefault: return 2;\n\t}\n}\nfunction conflictKindForCall(call) {\n\tswitch (call.factoryName) {\n\t\tcase \"alterColumnType\": return \"typeMismatch\";\n\t\tcase \"setNotNull\":\n\t\tcase \"dropNotNull\": return \"nullabilityConflict\";\n\t\tcase \"addForeignKey\":\n\t\tcase \"dropConstraint\": return \"foreignKeyConflict\";\n\t\tcase \"createIndex\":\n\t\tcase \"renameIndex\":\n\t\tcase \"dropIndex\": return \"indexIncompatible\";\n\t\tcase \"createRlsPolicy\":\n\t\tcase \"dropRlsPolicy\":\n\t\tcase \"renameRlsPolicy\": return \"rlsPolicyIncompatible\";\n\t\tdefault: return \"missingButNonAdditive\";\n\t}\n}\nfunction locationForCall(call) {\n\tconst anyCall = blindCast(call);\n\tconst location = {};\n\tif (anyCall.tableName) {\n\t\tlocation.entityKind = \"table\";\n\t\tlocation.entityName = anyCall.tableName;\n\t} else if (anyCall.typeName) {\n\t\tlocation.entityKind = \"native_enum\";\n\t\tlocation.entityName = anyCall.typeName;\n\t}\n\tconst columnName = columnNameOfCall(call);\n\tif (columnName) location.column = columnName;\n\tif (anyCall.indexName) location.index = anyCall.indexName;\n\telse if (anyCall.newIndexName) location.index = anyCall.newIndexName;\n\tif (anyCall.constraintName) location.constraint = anyCall.constraintName;\n\telse if (anyCall.newConstraintName) location.constraint = anyCall.newConstraintName;\n\tif (anyCall.policyName) location.rlsPolicy = anyCall.policyName;\n\telse if (anyCall.policy?.name) location.rlsPolicy = anyCall.policy.name;\n\telse if (anyCall.newPolicyName) location.rlsPolicy = anyCall.newPolicyName;\n\treturn Object.keys(location).length > 0 ? blindCast(location) : void 0;\n}\nfunction conflictForDisallowedCall(call, allowed) {\n\tconst summary = `Operation \"${call.label}\" requires class \"${call.operationClass}\", but policy allows only: ${allowed.join(\", \")}`;\n\tconst location = locationForCall(call);\n\treturn {\n\t\tkind: conflictKindForCall(call),\n\t\tsummary,\n\t\twhy: \"Use `migration new` to author a custom migration for this change.\",\n\t\trefusedOperationClass: call.operationClass,\n\t\t...location ? { location } : {}\n\t};\n}\n/** The diff node an issue concerns — expected when present, else the actual (extra) node. */\nfunction issueNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node);\n}\n/** DDL schema segment of a table-or-descendant issue path: `[database, ddlSchema, table, …]`. */\nfunction issueSchemaName(issue) {\n\treturn issue.path[1];\n}\n/** Table segment of a table-or-descendant issue path: `[database, ddlSchema, table, …]`. */\nfunction issueTableName(issue) {\n\treturn issue.path[2];\n}\n/** Column name embedded in a column/default issue path segment (`column:<name>`). */\nfunction issueColumnName(issue) {\n\tconst segment = issue.path[3];\n\tif (segment === void 0 || !segment.startsWith(\"column:\")) return void 0;\n\treturn segment.slice(7);\n}\n/**\n* The DDL schema name to use when EMITTING an op against `ddlSchemaName` (the\n* diff tree's resolved physical schema, `issueSchemaName(issue)`). The\n* unbound namespace's diff-tree identity resolves to `public` (a concrete\n* physical default the differ needs in order to compare its tree against\n* introspection — `resolveDdlSchemaForNamespaceStorage`), but DDL EMISSION\n* must stay unqualified so the live connection's `search_path` resolves it\n* at runtime (`boundSchema`). Recovers the logical namespace id via the\n* contract and substitutes the unbound sentinel back in when it resolves\n* there; every other namespace's `ddlSchemaName` already agrees between the\n* two resolution paths, so it passes through unchanged. A schema the contract\n* does not declare, such as one the origin contract had, stays qualified.\n*/\nfunction emissionSchemaName(ctx, ddlSchemaName) {\n\treturn resolveNamespaceIdForDdlSchema(ctx.toContract, ddlSchemaName) === UNBOUND_NAMESPACE_ID && ddlSchemaName === \"public\" && Object.hasOwn(ctx.toContract.storage.namespaces, UNBOUND_NAMESPACE_ID) ? UNBOUND_NAMESPACE_ID : ddlSchemaName;\n}\n/**\n* The generic differ is total: a missing/extra table (or column) emits an\n* issue for itself AND for every node in its subtree. `CreateTable`/`DropTable`\n* and `AddColumn`/`DropColumn` already account for the whole subtree, so the\n* nested issues are redundant — coalescing drops any issue whose path is a\n* strict descendant of a `not-found`/`not-expected` issue's path. Run over the\n* relational subset ONLY (policy issues and synthesized namespace issues are\n* handled on their own paths, never coalesced against tables).\n*/\nfunction coalesceSubtreeIssues(issues) {\n\tconst collapsingPaths = issues.filter((issue) => issueOutcome(issue) !== \"not-equal\").map((issue) => issue.path);\n\tif (collapsingPaths.length === 0) return issues;\n\tconst isCollapsed = (issue) => collapsingPaths.some((ancestor) => isStrictDescendantPath(issue.path, ancestor));\n\tconst collapsed = issues.filter(isCollapsed);\n\tconst kept = issues.filter((issue) => !isCollapsed(issue));\n\tconst inherited = new Map(kept.map((issue) => [issue, subtreeDependencies(issue, collapsed)]));\n\tconst dependsOnTarget = (from, to) => (inherited.get(from) ?? []).some((path) => samePath(path, to.path));\n\treturn kept.map((issue) => {\n\t\tconst extra = (inherited.get(issue) ?? []).filter((path) => !kept.some((other) => samePath(other.path, path) && dependsOnTarget(other, issue)));\n\t\treturn extra.length === 0 ? issue : {\n\t\t\t...issue,\n\t\t\tdependsOn: [...issue.dependsOn ?? [], ...extra]\n\t\t};\n\t});\n}\n/**\n* The dependencies a dropped issue's collapsed subtree has outside the subtree, such as the tables\n* its foreign keys name, so a whole-table drop runs before the drop of a table it references. Two\n* dropped tables that reference each other keep neither edge.\n*/\nfunction subtreeDependencies(issue, collapsed) {\n\tif (issueOutcome(issue) !== \"not-expected\") return [];\n\treturn collapsed.filter((descendant) => isStrictDescendantPath(descendant.path, issue.path)).flatMap((descendant) => descendant.dependsOn ?? []).filter((path) => !isStrictDescendantPath(path, issue.path) && !samePath(path, issue.path));\n}\nfunction samePath(left, right) {\n\treturn left.length === right.length && left.every((segment, index) => segment === right[index]);\n}\nfunction isStrictDescendantPath(path, ancestor) {\n\tif (path.length <= ancestor.length) return false;\n\tfor (let i = 0; i < ancestor.length; i += 1) if (path[i] !== ancestor[i]) return false;\n\treturn true;\n}\nfunction fkSpecFromNode(fk, tableName) {\n\treturn {\n\t\tname: fk.name ?? defaultForeignKeyName(tableName, fk.columns),\n\t\tcolumns: [...fk.columns],\n\t\treferences: {\n\t\t\tschema: fk.referencedSchema ?? \"\",\n\t\t\ttable: fk.referencedTable,\n\t\t\tcolumns: [...fk.referencedColumns]\n\t\t},\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t};\n}\n/**\n* Builds the `CreateTable` + child `CreateIndex` / `AddForeignKey` / `AddUnique`\n* calls for a newly-expected table, reading only the table node's children. The\n* PK and every declared CHECK go inline as table constraints; indexes\n* (declared + FK-backing, already merged and ordered at derivation) and the\n* FK / unique constraints are separate calls (re-bucketed downstream). Every\n* column's DDL is resolved from its `codecRef` via `renderColumnDdl`.\n*/\nfunction buildCreateTableCallsFromNode(schemaName, ddlSchemaName, table) {\n\tconst ddlColumns = Object.values(table.columns).map((c) => renderColumnDdl(c.name, c));\n\tconst primaryKeyConstraints = table.primaryKey ? [contractFree.primaryKey([...table.primaryKey.columns], { ...ifDefined(\"name\", table.primaryKey.name) })] : [];\n\tconst declaredChecks = (table.checks ?? []).map((c) => contractFree.checkExpression(c.name, c.expression));\n\tconst allTableConstraints = [...primaryKeyConstraints, ...declaredChecks];\n\tconst calls = [new CreateTableCall(schemaName, table.name, ddlColumns, allTableConstraints.length > 0 ? allTableConstraints : void 0)];\n\tfor (const index of table.indexes) calls.push(createIndexCallFromNode(index, schemaName, table.name));\n\tfor (const fk of table.foreignKeys) calls.push(new AddForeignKeyCall(schemaName, table.name, fkSpecFromNode(fk, table.name)));\n\tfor (const unique of table.uniques) {\n\t\tconst constraintName = unique.name ?? defaultUniqueName(table.name, unique.columns);\n\t\tcalls.push(new AddUniqueCall(schemaName, table.name, constraintName, [...unique.columns]));\n\t}\n\tif (table.rlsEnabled) calls.push(new EnableRowLevelSecurityCall(ddlSchemaName, table.name));\n\treturn calls;\n}\nfunction nodeConflict(kind, message) {\n\treturn issueConflict(kind, message);\n}\n/**\n* True when `actualMembers` (the live database's ordered members) is a\n* strict, order-preserving prefix of `expectedMembers` (the contract's) —\n* the database already carries every contract member, in declaration\n* order, and the contract declares at least one member the database still\n* lacks. Any other relationship — a renamed value, a removed value, a\n* reordering, or the database holding members the contract lacks — is not\n* a suffix append.\n*/\nfunction isNativeEnumSuffixAppend(actualMembers, expectedMembers) {\n\tif (actualMembers.length >= expectedMembers.length) return false;\n\treturn actualMembers.every((member, index) => member === expectedMembers[index]);\n}\n/** Operator-worded refusal for a native-enum member change beyond a suffix append (design ruling — tests match this verbatim). */\nfunction nativeEnumMemberChangeRefusal(options) {\n\treturn `Native enum type \"${options.ddlSchemaName}\".\"${options.typeName}\" changed beyond appending new values (contract declares [${options.expectedMembers.join(\", \")}], database has [${options.actualMembers.join(\", \")}]). Prisma 8 does not modify a native enum's existing values (rename, removal, reorder) — see https://pris.ly/d/postgres-native-enums. Author the change manually with \\`migration new\\`.`;\n}\n/**\n* Managed native-enum issue -> op lowering. A missing declared type creates\n* it; an unclaimed live type drops it (ownership-scoped upstream by\n* `retainUnownedExtras`, and the `widening` drop gated by the operation-class\n* policy); a paired member-value mismatch lowers to one `ALTER TYPE ... ADD\n* VALUE` per appended member when the database's members are a strict,\n* order-preserving prefix of the contract's — any other change (rename,\n* removal, reorder, or the database holding members the contract lacks) is\n* refused with a NAMED diagnostic, never a silent no-op and never a\n* drop-and-recreate.\n*/\nfunction mapExtensionNodeIssue(issue) {\n\tconst asNode = (node) => node === void 0 ? void 0 : blindCast(node);\n\tconst expected = asNode(issue.expected);\n\tconst actual = asNode(issue.actual);\n\tif (expected !== void 0) {\n\t\tPostgresExtensionSchemaNode.assert(expected);\n\t\tconst expectedLocation = expected.location;\n\t\tif (actual === void 0) return ok([new CreateExtensionCall(expectedLocation.kind === \"searchPath\" ? void 0 : expectedLocation.schemaName, expected.name)]);\n\t\tPostgresExtensionSchemaNode.assert(actual);\n\t\tconst actualLocation = actual.location;\n\t\tif (expectedLocation.kind === \"searchPath\") {\n\t\t\tinvariant(actualLocation.kind === \"installed\", \"an extension left to the search path differs only from an installed extension\");\n\t\t\treturn notOk({\n\t\t\t\tkind: \"unsupportedOperation\",\n\t\t\t\tsummary: `Extension \"${actual.name}\" ${offSearchPathText(actualLocation)}. The contract declares it in the unbound namespace, so the planner does not move it.`,\n\t\t\t\twhy: searchPathFix(actualLocation)\n\t\t\t});\n\t\t}\n\t\treturn ok([new SetExtensionSchemaCall(expected.name, expectedLocation.schemaName)]);\n\t}\n\tinvariant(actual !== void 0, \"an extension issue carries a node on one side\");\n\tPostgresExtensionSchemaNode.assert(actual);\n\treturn ok([new DropExtensionCall(actual.location.kind === \"searchPath\" ? void 0 : actual.location.schemaName, actual.name)]);\n}\nfunction mapNativeEnumNodeIssue(issue, ctx) {\n\tconst ddlSchemaName = issueSchemaName(issue);\n\tif (ddlSchemaName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Enum issue has no schema in its path: ${issue.path.join(\"/\")}`));\n\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst expected = blindCast(issue.expected);\n\t\treturn ok([new CreateNativeEnumTypeCall(schemaName, expected.typeName, expected.members)]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropNativeEnumTypeCall(schemaName, blindCast(issue.actual).typeName)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tif (isNativeEnumSuffixAppend(actual.members, expected.members)) return ok(expected.members.slice(actual.members.length).map((value) => new AddNativeEnumValueCall(schemaName, expected.typeName, value)));\n\treturn notOk(nodeConflict(\"unsupportedOperation\", nativeEnumMemberChangeRefusal({\n\t\tddlSchemaName,\n\t\ttypeName: expected.typeName,\n\t\texpectedMembers: expected.members,\n\t\tactualMembers: actual.members\n\t})));\n}\nfunction mapTableNodeIssue(issue, schemaName, ddlSchemaName) {\n\tif (issueOutcome(issue) === \"not-found\") return ok(buildCreateTableCallsFromNode(schemaName, ddlSchemaName, blindCast(issue.expected)));\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropTableCall(schemaName, blindCast(issue.actual).name)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tif (expected.rlsEnabled && !actual.rlsEnabled) return ok([new EnableRowLevelSecurityCall(ddlSchemaName, expected.name)]);\n\tif (!expected.rlsEnabled && actual.rlsEnabled) return ok([new DisableRowLevelSecurityCall(ddlSchemaName, expected.name)]);\n\treturn notOk(nodeConflict(\"unsupportedOperation\", `unhandled table-attribute drift on \"${expected.name}\": table not-equal with no rlsEnabled delta (a second table attribute drifted)`));\n}\nfunction mapColumnNodeIssue(issue, schemaName, tableName, dataTypes) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst column = blindCast(issue.expected);\n\t\treturn ok([new AddColumnCall(schemaName, tableName, renderColumnDdl(column.name, column), dataTypes)]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropColumnCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\tconst calls = [];\n\tif (!sqlColumnTypesEqual(expected, actual)) calls.push(new AlterColumnTypeCall({\n\t\tschemaName,\n\t\ttableName,\n\t\tcolumnName: expected.name,\n\t\ttype: renderColumnAlterType(expected),\n\t\t...expected.catalogText !== void 0 ? { raw: true } : {},\n\t\tdataTypes,\n\t\townsAutoincrementSequence: hasAutoincrementDefault(actual),\n\t\toperationClass: liveColumnWidensSafely(expected, actual) ? \"widening\" : \"destructive\"\n\t}));\n\tif (expected.nullable !== actual.nullable) calls.push(expected.nullable ? new DropNotNullCall(schemaName, tableName, expected.name) : new SetNotNullCall(schemaName, tableName, expected.name));\n\treturn ok(calls);\n}\nfunction mapColumnDefaultNodeIssue(issue, schemaName, tableName, columnName, types) {\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropDefaultCall(schemaName, tableName, columnName)]);\n\tif (issue.expected === void 0) return ok([]);\n\tconst column = buildSetDefaultColumn(columnName, blindCast(issue.expected), types);\n\tif (column === void 0) return ok([]);\n\treturn ok([new SetDefaultCall(schemaName, tableName, column, issueOutcome(issue) === \"not-equal\" ? \"widening\" : \"additive\")]);\n}\n/** A missing primary key is added. A changed or removed key is planned only by `primaryKeyChangeStrategy`, which also handles the foreign keys that depend on it; one that reaches this mapper is refused. */\nfunction mapPrimaryKeyNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) !== \"not-found\") return notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n\tconst pk = blindCast(issue.expected);\n\treturn ok([new AddPrimaryKeyCall(schemaName, tableName, pk.name ?? defaultPrimaryKeyName(tableName), [...pk.columns])]);\n}\nfunction mapForeignKeyNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") return ok([new AddForeignKeyCall(schemaName, tableName, fkSpecFromNode(blindCast(issue.expected), tableName))]);\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst fk = blindCast(issue.actual);\n\t\treturn ok([new DropConstraintCall(schemaName, tableName, fk.name ?? defaultForeignKeyName(tableName, fk.columns), \"foreignKey\")]);\n\t}\n\tconst expected = blindCast(issue.expected);\n\tconst actual = blindCast(issue.actual);\n\treturn ok([new DropConstraintCall(schemaName, tableName, actual.name ?? defaultForeignKeyName(tableName, actual.columns), \"foreignKey\"), new AddForeignKeyCall(schemaName, tableName, fkSpecFromNode(expected, tableName))]);\n}\nfunction mapUniqueNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst unique = blindCast(issue.expected);\n\t\treturn ok([new AddUniqueCall(schemaName, tableName, unique.name ?? defaultUniqueName(tableName, unique.columns), [...unique.columns])]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") {\n\t\tconst unique = blindCast(issue.actual);\n\t\treturn ok([new DropConstraintCall(schemaName, tableName, unique.name ?? defaultUniqueName(tableName, unique.columns), \"unique\")]);\n\t}\n\treturn notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n}\n/**\n* The CreateIndexCall for a name-identified index node: the node's own name\n* verbatim, its element list (column tuple or opaque expression), and the\n* unique/type/options/where attributes carried through.\n*/\nfunction createIndexCallFromNode(index, schemaName, tableName) {\n\tconst extras = {};\n\tif (index.type !== void 0) extras.type = index.type;\n\tif (index.options !== void 0) extras.options = index.options;\n\tif (index.where !== void 0) extras.where = index.where;\n\tif (index.unique) extras.unique = true;\n\treturn new CreateIndexCall(schemaName, tableName, index.name, index.columns !== void 0 ? { columns: [...index.columns] } : { expression: index.expression ?? \"\" }, extras);\n}\nfunction mapIndexNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") return ok([createIndexCallFromNode(blindCast(issue.expected), schemaName, tableName)]);\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropIndexCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\treturn notOk(nodeConflict(\"indexIncompatible\", issue.path.join(\"/\")));\n}\n/**\n* The index treatment: a missing check is added, an undeclared live check is\n* dropped, and a paired divergence is a conflict. `not-equal` is reachable only\n* for an exact-named expected check — a wire-named one compares by name, so a\n* changed predicate re-suffixes the name and arrives as missing + extra\n* instead.\n*/\nfunction mapCheckNodeIssue(issue, schemaName, tableName) {\n\tif (issueOutcome(issue) === \"not-found\") {\n\t\tconst check = blindCast(issue.expected);\n\t\treturn ok([new AddCheckConstraintCall(schemaName, tableName, check.name, check.expression)]);\n\t}\n\tif (issueOutcome(issue) === \"not-expected\") return ok([new DropCheckConstraintCall(schemaName, tableName, blindCast(issue.actual).name)]);\n\treturn notOk(nodeConflict(\"unsupportedOperation\", issue.path.join(\"/\")));\n}\n/**\n* Maps one node-typed diff issue to its migration call(s), dispatching on the\n* node's `nodeKind` and the issue's presence-derived `issueOutcome`, reading\n* nodes and resolving column DDL from `codecRef` via `column-ddl-rendering.ts`.\n*/\nfunction mapNodeIssueToCall(issue, ctx) {\n\tconst node = issueNode(issue);\n\tif (node === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Issue carries neither an expected nor an actual node: ${issue.path.join(\"/\")}`));\n\tif (node.nodeKind === PostgresSchemaNodeKind.namespace) {\n\t\tif (issueOutcome(issue) !== \"not-found\") return notOk(nodeConflict(\"unsupportedOperation\", `Unexpected namespace drift: ${issue.path.join(\"/\")}`));\n\t\treturn ok([new CreateSchemaCall(blindCast(issue.expected).schemaName)]);\n\t}\n\tif (node.nodeKind === PostgresSchemaNodeKind.nativeEnum) return mapNativeEnumNodeIssue(issue, ctx);\n\tif (node.nodeKind === PostgresSchemaNodeKind.extension) return mapExtensionNodeIssue(issue);\n\tconst ddlSchemaName = issueSchemaName(issue);\n\tconst tableName = issueTableName(issue);\n\tif (ddlSchemaName === void 0 || tableName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Issue has no schema/table in its path: ${issue.path.join(\"/\")}`));\n\tconst schemaName = emissionSchemaName(ctx, ddlSchemaName);\n\tswitch (node.nodeKind) {\n\t\tcase PostgresSchemaNodeKind.table: return mapTableNodeIssue(issue, schemaName, ddlSchemaName);\n\t\tcase RelationalSchemaNodeKind.column: return mapColumnNodeIssue(issue, schemaName, tableName, ctx.dataTypes);\n\t\tcase RelationalSchemaNodeKind.columnDefault: {\n\t\t\tconst columnName = issueColumnName(issue);\n\t\t\tif (columnName === void 0) return notOk(nodeConflict(\"unsupportedOperation\", `Default issue has no column in its path: ${issue.path.join(\"/\")}`));\n\t\t\treturn mapColumnDefaultNodeIssue(issue, schemaName, tableName, columnName, ctx.types);\n\t\t}\n\t\tcase RelationalSchemaNodeKind.primaryKey: return mapPrimaryKeyNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.foreignKey: return mapForeignKeyNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.unique: return mapUniqueNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.index: return mapIndexNodeIssue(issue, schemaName, tableName);\n\t\tcase RelationalSchemaNodeKind.check: return mapCheckNodeIssue(issue, schemaName, tableName);\n\t\tdefault: return notOk(nodeConflict(\"unsupportedOperation\", `Unhandled node kind: ${node.nodeKind}`));\n\t}\n}\n/**\n* Runs the ordered strategy list over the node-typed diff issues, maps\n* leftover issues via {@link mapNodeIssueToCall}, applies operation-class\n* policy gating, and buckets calls into the fixed DDL emission order (dep →\n* drop → table → column → recipe → alter → primaryKey → unique → index →\n* foreignKey).\n*/\nfunction planIssues(options) {\n\tconst policyProvided = options.policy !== void 0;\n\tconst policy = options.policy ?? DEFAULT_POLICY;\n\tconst schema = options.schema ?? emptySchemaIR();\n\tconst frameworkComponents = options.frameworkComponents ?? [];\n\tconst context = {\n\t\ttoContract: options.toContract,\n\t\tfromContract: options.fromContract,\n\t\tschemaName: options.schemaName,\n\t\tcodecHooks: options.codecHooks,\n\t\ttypes: options.types,\n\t\tschema,\n\t\tstartTree: options.startTree,\n\t\tendTree: options.endTree,\n\t\tallIssues: options.issues,\n\t\tforeignKeyDropAuthority: options.foreignKeyDropAuthority,\n\t\tpolicy,\n\t\tframeworkComponents,\n\t\tstatementColumns: options.statementColumns ?? {\n\t\t\tconvert: [],\n\t\t\tbackfill: []\n\t\t},\n\t\tdataTypes: stackDataTypes(frameworkComponents)\n\t};\n\tconst strategies = options.strategies ?? postgresPlannerStrategies;\n\tlet remaining = options.issues;\n\tconst recipeCalls = [];\n\tconst bucketablePatternCalls = [];\n\tconst conflicts = [];\n\tfor (const strategy of strategies) {\n\t\tconst result = strategy(remaining, context);\n\t\tif (result.kind === \"match\") {\n\t\t\tremaining = result.issues;\n\t\t\tconflicts.push(...result.conflicts ?? []);\n\t\t\tif (result.recipe) recipeCalls.push(...result.calls);\n\t\t\telse bucketablePatternCalls.push(...result.calls);\n\t\t}\n\t}\n\tconst sorted = orderIssuesByDependencies(remaining);\n\tconst defaultCalls = [];\n\tfor (const issue of sorted) {\n\t\tconst result = mapNodeIssueToCall(issue, context);\n\t\tif (result.ok) defaultCalls.push(...result.value);\n\t\telse conflicts.push(result.failure);\n\t}\n\tconst allowed = policy.allowedOperationClasses;\n\tlet gatedDefault = defaultCalls;\n\tlet gatedRecipe = recipeCalls;\n\tlet gatedBucketable = bucketablePatternCalls;\n\tif (policyProvided) {\n\t\tconst keepIfAllowed = (bucket) => (call) => {\n\t\t\tif (allowed.includes(call.operationClass)) {\n\t\t\t\tbucket.push(call);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconflicts.push(conflictForDisallowedCall(call, allowed));\n\t\t};\n\t\tconst gatedDefaultBucket = [];\n\t\tconst gatedRecipeBucket = [];\n\t\tconst gatedBucketableBucket = [];\n\t\tdefaultCalls.forEach(keepIfAllowed(gatedDefaultBucket));\n\t\trecipeCalls.forEach(keepIfAllowed(gatedRecipeBucket));\n\t\tbucketablePatternCalls.forEach(keepIfAllowed(gatedBucketableBucket));\n\t\tgatedDefault = gatedDefaultBucket;\n\t\tgatedRecipe = gatedRecipeBucket;\n\t\tgatedBucketable = gatedBucketableBucket;\n\t}\n\tif (conflicts.length > 0) return notOk(conflicts);\n\tconst combinedBucketable = [...gatedDefault, ...gatedBucketable];\n\tconst byCategory = (cat) => combinedBucketable.filter((c) => classifyCall(c) === cat);\n\treturn ok({ calls: [\n\t\t...byCategory(\"dep\").sort((a, b) => depRank(a) - depRank(b)),\n\t\t...byCategory(\"drop\").sort((a, b) => dropRank(a) - dropRank(b)),\n\t\t...byCategory(\"dropType\"),\n\t\t...byCategory(\"table\"),\n\t\t...byCategory(\"dropSchema\"),\n\t\t...byCategory(\"column\"),\n\t\t...gatedRecipe,\n\t\t...byCategory(\"alter\"),\n\t\t...byCategory(\"primaryKey\"),\n\t\t...byCategory(\"unique\"),\n\t\t...byCategory(\"index\"),\n\t\t...byCategory(\"foreignKey\"),\n\t\t...byCategory(\"rlsEnable\")\n\t] });\n}\n//#endregion\n//#region src/core/migrations/control-policy.ts\n/**\n* Factory calls that create a whole, previously-absent top-level storage\n* object. Used to decide whether `tolerated` permits a call (it only allows\n* creating absent objects, never modifying existing ones).\n*\n* Deliberately an explicit, closed set rather than a `factoryName`\n* create/alter/drop classification: it answers exactly one yes/no question\n* and is fail-closed. Any call not listed here — including future or\n* extension-contributed factories — is treated as NOT object-creation, so it\n* is suppressed under `tolerated` rather than permissively emitted.\n*\n* Lists the creation factories that actually reach the call-side resolver\n* (`resolvePostgresCallControlPolicySubject`) — today only RLS policy\n* creation, from `planPostgresSchemaDiff`. Every other whole-object create\n* (table, schema, native enum, and RLS enablement) is constructed inside\n* `planIssues` and graded on the node side by\n* `resolvePostgresNodeIssueCreationFactoryName`, so none of them are listed\n* here.\n*/\nconst OBJECT_CREATION_FACTORIES = /* @__PURE__ */ new Set([\"createRlsPolicy\"]);\nfunction createsNewTopLevelObject(call) {\n\treturn OBJECT_CREATION_FACTORIES.has(call.factoryName);\n}\nfunction ddlSchemaNameForNamespace(contract, namespaceId) {\n\tconst namespace = contract.storage.namespaces[namespaceId];\n\treturn isPostgresSchema(namespace) ? namespace.ddlSchemaName(contract.storage) : namespaceId;\n}\n/**\n* Resolve the namespace a declared storage entity lives in by walking every\n* namespace for one whose `entries` map actually contains the coordinate —\n* a table by its name, a native enum by its physical type name (see\n* {@link postgresNodeStorageCoordinate}). When `ddlSchemaName` is given, the\n* match must also land in that DDL schema (disambiguates same-named entities\n* declared under different namespaces); when omitted, the first namespace\n* that declares the entity wins. Falls back to {@link UNBOUND_NAMESPACE_ID}\n* when no namespace declares it — e.g. an extra/dropped entity the contract\n* doesn't claim at all.\n*/\nfunction resolveNamespaceIdForEntity(contract, coordinate, ddlSchemaName) {\n\tfor (const namespaceId of Object.keys(contract.storage.namespaces)) {\n\t\tif (!entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t})) continue;\n\t\tif (ddlSchemaName === void 0 || ddlSchemaNameForNamespace(contract, namespaceId) === ddlSchemaName) return namespaceId;\n\t}\n\treturn UNBOUND_NAMESPACE_ID;\n}\nfunction resolveNamespaceIdForTable(contract, tableName, ddlSchemaName) {\n\treturn resolveNamespaceIdForEntity(contract, {\n\t\tentityKind: \"table\",\n\t\tentityName: tableName\n\t}, ddlSchemaName);\n}\nfunction resolveNamespaceIdForDdlSchema(contract, ddlSchemaName) {\n\tfor (const namespaceId of Object.keys(contract.storage.namespaces)) {\n\t\tconst ns = contract.storage.namespaces[namespaceId];\n\t\tif (isPostgresSchema(ns) && ns.ddlSchemaName(contract.storage) === ddlSchemaName) return namespaceId;\n\t\tif (namespaceId === ddlSchemaName) return namespaceId;\n\t}\n\treturn UNBOUND_NAMESPACE_ID;\n}\nfunction postgresCallFields(call) {\n\treturn {\n\t\t...ifDefined(\"schemaName\", \"schemaName\" in call ? call.schemaName : void 0),\n\t\t...ifDefined(\"tableName\", \"tableName\" in call ? call.tableName : void 0),\n\t\t...ifDefined(\"columnName\", columnNameOfCall(call))\n\t};\n}\nfunction formatSuppressionSubjectLabel(subject, contract) {\n\tif (subject === void 0) return \"unknown\";\n\tconst ddlSchema = ddlSchemaNameForNamespace(contract, subject.namespaceId);\n\tif (subject.entityKind !== void 0 && subject.entityName !== void 0) {\n\t\tconst entityLabel = `${subject.entityKind} \"${ddlSchema}.${subject.entityName}\"`;\n\t\treturn subject.rlsPolicy !== void 0 ? `RLS policy \"${subject.rlsPolicy}\" on ${entityLabel}` : entityLabel;\n\t}\n\treturn `namespace \"${ddlSchema}\"`;\n}\nfunction postgresSuppressionSummary(subjectLabel, subject, policy) {\n\tconst namespace = subject?.namespaceId ?? \"unknown\";\n\tconst declared = subject?.explicitNodeControlPolicy;\n\tif (policy === \"external\" && declared === \"managed\") return `control policy suppressed: ${subjectLabel} — namespace '${namespace}' has effective control 'external' but declared 'managed'`;\n\treturn `control policy suppressed: ${subjectLabel} — namespace '${namespace}' has effective control '${policy}'${declared ? ` but declared '${declared}'` : \"\"}`;\n}\n/**\n* Render one family {@link SuppressionRecord} into a target `SqlPlannerConflict`.\n* The family decides *that* a subject is suppressed and hands over the raw\n* coordinate + policy; the label, message, and location are rendered here,\n* driven entirely by the subject's own `(entityKind, entityName)` coordinate\n* — no target-owned table-vs-enum vocabulary.\n*/\nfunction renderPostgresSuppression(record, contract) {\n\tconst subject = record.subject;\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: postgresSuppressionSummary(formatSuppressionSubjectLabel(subject, contract), subject, record.policy),\n\t\tlocation: {\n\t\t\t...ifDefined(\"namespaceId\", subject?.namespaceId),\n\t\t\t...ifDefined(\"entityKind\", subject?.entityKind),\n\t\t\t...ifDefined(\"entityName\", subject?.entityName),\n\t\t\t...ifDefined(\"column\", subject?.column),\n\t\t\t...ifDefined(\"rlsPolicy\", subject?.rlsPolicy)\n\t\t},\n\t\tmeta: {\n\t\t\tcontrolPolicy: record.policy,\n\t\t\t...ifDefined(\"factoryName\", record.factoryName),\n\t\t\t...ifDefined(\"rlsPolicy\", subject?.rlsPolicy),\n\t\t\t...ifDefined(\"declaredControlPolicy\", subject?.explicitNodeControlPolicy)\n\t\t}\n\t};\n}\nfunction resolvePostgresCallControlPolicySubject(call, contract) {\n\tconst callFields = postgresCallFields(call);\n\tconst createsNewObject = createsNewTopLevelObject(call);\n\tif (call.factoryName === \"createSchema\" && callFields.schemaName) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),\n\t\tcreatesNewObject\n\t};\n\tif (callFields.tableName) {\n\t\tconst namespaceId = resolveNamespaceIdForTable(contract, callFields.tableName, callFields.schemaName);\n\t\tconst tableControlPolicy = entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: callFields.tableName\n\t\t})?.control;\n\t\treturn {\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: callFields.tableName,\n\t\t\t...ifDefined(\"column\", callFields.columnName),\n\t\t\t...ifDefined(\"explicitNodeControlPolicy\", tableControlPolicy),\n\t\t\tcreatesNewObject\n\t\t};\n\t}\n\tif (callFields.schemaName) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, callFields.schemaName),\n\t\tcreatesNewObject\n\t};\n}\n/**\n* Node kinds whose *absence* is the creation of a whole, top-level Postgres\n* object: a namespace, a table, or a native enum. Used by\n* {@link resolvePostgresNodeIssueCreationFactoryName} to decide whether a\n* `tolerated` subject permits the issue to flow into the planner\n* (create-if-absent) and to seed the suppressed-subject warning's\n* `factoryName` when the planner is skipped. RLS policy creation is not\n* listed here — policy issues never reach this issue-based partition (they\n* are routed to `planPostgresSchemaDiff` and gated via the call-based\n* {@link resolvePostgresCallControlPolicySubject} instead).\n*/\nconst POSTGRES_NODE_CREATION_FACTORY = Object.freeze({\n\t[PostgresSchemaNodeKind.namespace]: \"createSchema\",\n\t[PostgresSchemaNodeKind.table]: \"createTable\",\n\t[PostgresSchemaNodeKind.nativeEnum]: \"createNativeEnumType\",\n\t[PostgresSchemaNodeKind.extension]: \"createExtension\"\n});\n/**\n* A table `not-equal` issue whose `rlsEnabled` flips OFF→ON (expected on,\n* actual off) is enablement toward `ENABLE ROW LEVEL SECURITY`. It is\n* creation-class on the node side because `isEnablementCreationIssue` and\n* {@link resolvePostgresNodeIssueCreationFactoryName} treat this OFF→ON delta\n* as a creation: enabling RLS establishes the fail-closed guard the declared\n* policy set attaches to, the same grant `tolerated` extends to creating the\n* policies themselves. The opposite direction (`DISABLE`) is a modification\n* and stays managed-only. Keying on the actual delta (not just the expected\n* bit) keeps this correct if a second table attribute ever joins\n* `isEqualTo`: a not-equal with no `rlsEnabled` delta is not enablement, so\n* it is not admitted as creation-class here.\n*/\nfunction isEnablementCreationIssue(issue) {\n\tif (issueOutcome(issue) !== \"not-equal\") return false;\n\tconst { expected, actual } = issue;\n\treturn expected !== void 0 && actual !== void 0 && PostgresTableSchemaNode.is(expected) && PostgresTableSchemaNode.is(actual) && expected.rlsEnabled === true && actual.rlsEnabled === false;\n}\nfunction resolvePostgresNodeIssueCreationFactoryName(issue) {\n\tif (isEnablementCreationIssue(issue)) return \"enableRowLevelSecurity\";\n\tif (issueOutcome(issue) !== \"not-found\") return void 0;\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn POSTGRES_NODE_CREATION_FACTORY[node.nodeKind];\n}\n/**\n* Resolves the control-policy subject for a node-typed {@link SchemaDiffIssue}\n* (the issue-side mirror of `resolvePostgresCallControlPolicySubject`).\n* Storage entities resolve off their node coordinate; a sub-entity issue\n* resolves off the enclosing table read from the issue path; an unclaimed\n* extra falls back to the unbound coordinate. A role always resolves\n* `'external'` — roles are referenced, never owned.\n*/\nfunction resolvePostgresNodeIssueControlPolicySubject(issue, contract) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\tif (node.nodeKind === PostgresSchemaNodeKind.namespace) return {\n\t\tnamespaceId: resolveNamespaceIdForDdlSchema(contract, blindCast(node).schemaName),\n\t\tcreatesNewObject: issueOutcome(issue) === \"not-found\"\n\t};\n\tif (node.nodeKind === PostgresSchemaNodeKind.role) {\n\t\tconst roleName = issue.path[1];\n\t\treturn {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\texplicitNodeControlPolicy: (roleName === void 0 ? void 0 : entityAt(contract.storage, {\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentityKind: \"role\",\n\t\t\t\tentityName: roleName\n\t\t\t}))?.control ?? \"external\",\n\t\t\tcreatesNewObject: false\n\t\t};\n\t}\n\tconst coordinate = postgresNodeStorageCoordinate(node);\n\tif (coordinate !== void 0) {\n\t\tconst namespaceId = resolveNamespaceIdForEntity(contract, coordinate, node.nodeKind === PostgresSchemaNodeKind.extension ? void 0 : issue.path[1]);\n\t\tconst entityControl = entityAt(contract.storage, {\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t})?.control;\n\t\treturn {\n\t\t\tnamespaceId,\n\t\t\t...coordinate,\n\t\t\t...ifDefined(\"column\", issueColumnName(issue)),\n\t\t\t...ifDefined(\"explicitNodeControlPolicy\", entityControl),\n\t\t\tcreatesNewObject: resolvePostgresNodeIssueCreationFactoryName(issue) !== void 0\n\t\t};\n\t}\n\tconst tableName = issue.path[2];\n\tif (tableName === void 0) return void 0;\n\tconst ddlSchemaName = issue.path[1];\n\tconst namespaceId = resolveNamespaceIdForTable(contract, tableName, ddlSchemaName);\n\tconst table = entityAt(contract.storage, {\n\t\tnamespaceId,\n\t\tentityKind: \"table\",\n\t\tentityName: tableName\n\t});\n\treturn {\n\t\tnamespaceId,\n\t\tentityKind: \"table\",\n\t\tentityName: tableName,\n\t\t...ifDefined(\"column\", issueColumnName(issue)),\n\t\t...ifDefined(\"explicitNodeControlPolicy\", table?.control),\n\t\tcreatesNewObject: resolvePostgresNodeIssueCreationFactoryName(issue) !== void 0\n\t};\n}\n//#endregion\nexport { resolvePostgresNodeIssueCreationFactoryName as a, issueNode as c, postgresPlannerStrategies as d, tableAt as f, resolvePostgresNodeIssueControlPolicySubject as i, issueSchemaName as l, resolveNamespaceIdForDdlSchema as n, coalesceSubtreeIssues as o, postgresNodeStorageCoordinate as p, resolvePostgresCallControlPolicySubject as r, conflictForDisallowedCall as s, renderPostgresSuppression as t, planIssues as u };\n\n//# sourceMappingURL=control-policy-Crcjg7Vz.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,8BAA8B,MAAM;CAC5C,IAAI,wBA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AS,SAAS,SAAS;IACrF,aAAa;IACb,YAAY;IACZ,YAAY;GACb,CAAC,EAAA,EAAI,WAAW;GAChB,kBAAkB;EACnB;CACD;CACA,MAAM,aAAa,8BAA8B,IAAI;CACrD,IAAI,eAAe,KAAK,GAAG;EAC1B,MAAM,cAAc,4BAA4B,UAAU,YAAY,KAAK,aAAa,uBAAuB,YAAY,KAAK,IAAI,MAAM,KAAK,EAAE;EACjJ,MAAM,gBAAgB,SAAS,SAAS,SAAS;GAChD;GACA,GAAG;EACJ,CAAC,CAAC,EAAE;EACJ,OAAO;GACN;GACA,GAAG;GACH,GAAG,UAAU,UAAU,gBAAgB,KAAK,CAAC;GAC7C,GAAG,UAAU,6BAA6B,aAAa;GACvD,kBAAkB,4CAA4C,KAAK,MAAM,KAAK;EAC/E;CACD;CACA,MAAM,YAAY,MAAM,KAAK;CAC7B,IAAI,cAAc,KAAK,GAAG,OAAO,KAAK;CACtC,MAAM,gBAAgB,MAAM,KAAK;CACjC,MAAM,cAAc,2BAA2B,UAAU,WAAW,aAAa;CACjF,MAAM,QAAQ,SAAS,SAAS,SAAS;EACxC;EACA,YAAY;EACZ,YAAY;CACb,CAAC;CACD,OAAO;EACN;EACA,YAAY;EACZ,YAAY;EACZ,GAAG,UAAU,UAAU,gBAAgB,KAAK,CAAC;EAC7C,GAAG,UAAU,6BAA6B,OAAO,OAAO;EACxD,kBAAkB,4CAA4C,KAAK,MAAM,KAAK;CAC/E;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"diff-database-schema-CVmwyjFf-DSWPpd4M.mjs","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/diff-database-schema-CVmwyjFf.mjs"],"sourcesContent":["import { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { i as fullTextIndexDefinitionOf, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-MMcQF3_0.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-CIfq1AjC.mjs\";\nimport { t as postgresAccessMethodOf } from \"./index-types-CiM75RsF.mjs\";\nimport { t as postgresResolveDefault } from \"./default-normalizer-BqK6XxdC.mjs\";\nimport { c as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, o as PostgresSchemaNodeKind, r as PostgresExtensionSchemaNode, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-OQRI_GIM.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from \"./postgres-role-schema-node-yFPLQ6U0.mjs\";\nimport { n as renderFullTextIndexDocument } from \"./full-text-search-document-B5VCeQFz.mjs\";\nimport { r as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-C2KTxEX3.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-Crcjg7Vz.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\n//#region src/core/migrations/contract-to-postgres-database-schema-node.ts\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep() {\n\treturn {\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t};\n}\nfunction tableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\tdatabaseStep(),\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.namespace,\n\t\t\tid: namespaceId\n\t\t},\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t}\n\t];\n}\nfunction roleDependsOn(role) {\n\treturn [databaseStep(), {\n\t\tnodeKind: PostgresSchemaNodeKind.role,\n\t\tid: role\n\t}];\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(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction toPolicyNode(policy, namespaceId) {\n\treturn new PostgresPolicySchemaNode({\n\t\tnaming: namingOf(policy.name, policy.prefix),\n\t\ttableName: policy.tableName,\n\t\tnamespaceId,\n\t\toperation: policy.operation,\n\t\troles: [...policy.roles],\n\t\tusing: policy.using,\n\t\twithCheck: policy.withCheck,\n\t\tpermissive: policy.permissive,\n\t\tdependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]\n\t});\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*/\nfunction contractToPostgresDatabaseSchemaNode(contract, options) {\n\tif (contract === null) return new PostgresDatabaseSchemaNode({\n\t\tnamespaces: {},\n\t\troles: [],\n\t\textensions: [],\n\t\texistingSchemas: [],\n\t\tpgVersion: \"\"\n\t});\n\tconst namespaces = {};\n\tconst roles = [];\n\tconst extensions = [];\n\tconst ownedSchemas = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) {\n\t\tif (!isPostgresSchema(ns)) continue;\n\t\tfor (const role of Object.values(ns.role)) roles.push(new PostgresRoleSchemaNode({\n\t\t\tname: role.name,\n\t\t\tnamespaceId: role.namespaceId\n\t\t}));\n\t\tfor (const extension of Object.values(ns.extension)) extensions.push(new PostgresExtensionSchemaNode({\n\t\t\tname: extension.name,\n\t\t\tlocation: ns.id === UNBOUND_NAMESPACE_ID ? { kind: \"searchPath\" } : {\n\t\t\t\tkind: \"declared\",\n\t\t\t\tschemaName: resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id)\n\t\t\t},\n\t\t\tcontrol: extension.control\n\t\t}));\n\t\tif (ns.id === UNBOUND_NAMESPACE_ID) {\n\t\t\tif (!Object.entries(ns.entries).some(([entriesKey, slot]) => entriesKey !== \"role\" && entriesKey !== \"extension\" && Object.keys(slot).length > 0)) continue;\n\t\t}\n\t\tconst ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n\t\townedSchemas.push(ddlSchema);\n\t\tconst sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const policy of Object.values(ns.policy)) {\n\t\t\tconst list = policiesByTable.get(policy.tableName) ?? [];\n\t\t\tlist.push(toPolicyNode(policy, ddlSchema));\n\t\t\tpoliciesByTable.set(policy.tableName, list);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableName of Object.keys(ns.table)) {\n\t\t\tconst sqlTable = sqlTables[tableName];\n\t\t\tif (sqlTable === void 0) continue;\n\t\t\tconst foreignKeys = sqlTable.foreignKeys.map((fk) => {\n\t\t\t\tconst resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);\n\t\t\t\treturn new SqlForeignKeyIR({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t\t\tresolvedReferencedNamespace,\n\t\t\t\t\tdependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name),\n\t\t\t\t...ifDefined(\"annotations\", u.annotations),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, u.columns)\n\t\t\t}));\n\t\t\tconst indexes = sqlTable.indexes.map((i) => {\n\t\t\t\tconst fullText = fullTextIndexDefinitionOf(i);\n\t\t\t\tif (fullText !== void 0) return new SqlIndexIR({\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: postgresAccessMethodOf(FULL_TEXT_INDEX_TYPE),\n\t\t\t\t\toptions: void 0,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\texpression: renderFullTextIndexDocument(fullText),\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, fullText.weightGroups.flat())\n\t\t\t\t});\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, i.columns ?? Object.keys(sqlTable.columns))\n\t\t\t\t};\n\t\t\t\treturn new SqlIndexIR(i.expression !== void 0 ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: i.expression\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: i.columns ?? []\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({\n\t\t\t\tcolumns: sqlTable.primaryKey.columns,\n\t\t\t\t...ifDefined(\"name\", sqlTable.primaryKey.name),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)\n\t\t\t}) : void 0;\n\t\t\ttables[tableName] = new PostgresTableSchemaNode({\n\t\t\t\tname: sqlTable.name,\n\t\t\t\tcolumns: sqlTable.columns,\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\t...ifDefined(\"annotations\", sqlTable.annotations),\n\t\t\t\t...ifDefined(\"checks\", sqlTable.checks),\n\t\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\t\trlsEnabled: Object.hasOwn(ns.rls, tableName)\n\t\t\t});\n\t\t}\n\t\tfor (const [tableName, tablePolicies] of policiesByTable) {\n\t\t\tif (!(tableName in tables)) {\n\t\t\t\tconst policyName = tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`, { meta: {\n\t\t\t\t\tpolicyName,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-missing\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tif (!Object.hasOwn(ns.rls, tableName)) {\n\t\t\t\tconst policyLabel = tablePolicies[0]?.prefix ?? tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyLabel}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`, { meta: {\n\t\t\t\t\tpolicyName: policyLabel,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-not-rls-controlled\"\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tnamespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlSchema,\n\t\t\ttables,\n\t\t\tnativeEnums: Object.values(ns.entries.native_enum ?? {}).map((entity) => new PostgresNativeEnumSchemaNode({\n\t\t\t\ttypeName: entity.typeName,\n\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\tmembers: entity.members,\n\t\t\t\t...ifDefined(\"control\", entity.control)\n\t\t\t}))\n\t\t});\n\t}\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles,\n\t\textensions,\n\t\texistingSchemas: ownedSchemas,\n\t\tpgVersion: \"\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/diff-database-schema.ts\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) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\nfunction nodeNamespaceId(node) {\n\tif (!Object.hasOwn(node, \"namespaceId\")) return void 0;\n\treturn blindCast(node).namespaceId;\n}\n/**\n* The installed extension a `not-expected` issue reports, if it reports one. An extension the contract does not declare is never this contract's to report or drop: Postgres always has `plpgsql`, hosts preinstall many more, and a sibling contract space may declare it. Only a plan drops one, and only one its origin contract declared.\n*/\nfunction undeclaredExtensionName(issue) {\n\tif (issueOutcome(issue) !== \"not-expected\" || issue.actual === void 0) return void 0;\n\tconst node = blindCast(issue.actual);\n\treturn PostgresExtensionSchemaNode.is(node) ? node.name : void 0;\n}\nfunction ownedSchemaNames(expected) {\n\tconst policyNamespaces = Object.values(expected.namespaces).flatMap((ns) => Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)));\n\treturn /* @__PURE__ */ new Set([...policyNamespaces, ...expected.existingSchemas]);\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(expected) {\n\tconst namespaces = Object.fromEntries(Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0));\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...expected.roles],\n\t\textensions: [...expected.extensions],\n\t\texistingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== void 0),\n\t\tpgVersion: expected.pgVersion\n\t});\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(issue, contract) {\n\treturn resolvePostgresNodeIssueControlPolicySubject(blindCast(issue), contract)?.explicitNodeControlPolicy;\n}\n/**\n* The Postgres full-tree node diff for the family verify verdict: derive\n* the expected tree (resolved leaf values, 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*/\nfunction diffPostgresSchema(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.schema);\n\tconst actual = input.schema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\tissues: diffSchemas(expected, actual).filter((issue) => {\n\t\t\tif (undeclaredExtensionName(issue) !== void 0) return false;\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t}),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n\t\tnamespacePairs: Object.values(expected.namespaces).map((ns) => ({ actual: actual.namespaces[ns.schemaName] }))\n\t};\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(expected, actual) {\n\tconst namespaces = { ...actual.namespaces };\n\tlet padded = false;\n\tfor (const schemaName of Object.keys(expected.namespaces)) if (namespaces[schemaName] === void 0) {\n\t\tnamespaces[schemaName] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName,\n\t\t\ttables: {}\n\t\t});\n\t\tpadded = true;\n\t}\n\tif (!padded) return actual;\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...actual.roles],\n\t\textensions: [...actual.extensions],\n\t\texistingSchemas: [...actual.existingSchemas],\n\t\tpgVersion: actual.pgVersion\n\t});\n}\n/**\n* The Postgres planner's diff input: the SAME tree-building\n* `diffPostgresSchema` uses (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*/\nfunction buildPostgresPlanDiff(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.actualSchema);\n\tconst actual = input.actualSchema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst paddedActual = padActualNamespaces(expected, actual);\n\tconst originSchemas = input.originSchemas ?? [];\n\tconst originExtensions = new Set(input.originExtensions ?? []);\n\tconst relationalOwned = /* @__PURE__ */ new Set([...ownedSchemaNames(expected), ...originSchemas]);\n\tconst structuralOwned = /* @__PURE__ */ new Set([...ownedSchemaNames(fullExpected), ...originSchemas]);\n\treturn {\n\t\texpected,\n\t\tactual: paddedActual,\n\t\tissues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {\n\t\t\tconst extensionName = undeclaredExtensionName(issue);\n\t\t\tif (extensionName !== void 0) return originExtensions.has(extensionName);\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t})\n\t};\n}\n//#endregion\nexport { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };\n\n//# sourceMappingURL=diff-database-schema-CVmwyjFf.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,eAAe;CACvB,OAAO;EACN,UAAU,uBAAuB;EACjC,IAAI;CACL;AACD;AACA,SAAS,eAAe,aAAa,WAAW;CAC/C,OAAO;EACN,aAAa;EACb;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;EACA;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;CACD;AACD;AACA,SAAS,cAAc,MAAM;CAC5B,OAAO,CAAC,aAAa,GAAG;EACvB,UAAU,uBAAuB;EACjC,IAAI;CACL,CAAC;AACF;;;;;;;AAOA,SAAS,gBAAgB,aAAa,WAAW,SAAS;CACzD,OAAO,QAAQ,KAAK,WAAW,CAAC,GAAG,eAAe,aAAa,SAAS,GAAG;EAC1E,UAAU,yBAAyB;EACnC,IAAI,UAAU;CACf,CAAC,CAAC;AACH;AACA,SAAS,aAAa,QAAQ,aAAa;CAC1C,OAAO,IAAI,yBAAyB;EACnC,QAAQ,SAAS,OAAO,MAAM,OAAO,MAAM;EAC3C,WAAW,OAAO;EAClB;EACA,WAAW,OAAO;EAClB,OAAO,CAAC,GAAG,OAAO,KAAK;EACvB,OAAO,OAAO;EACd,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,WAAW,CAAC,eAAe,aAAa,OAAO,SAAS,GAAG,GAAG,OAAO,MAAM,IAAI,aAAa,CAAC;CAC9F,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,qCAAqC,UAAU,SAAS;CAChE,IAAI,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I,IAAI,MAAM,oBAAoB,CAAC,CAAC;CAC7D,MAAM,kCAAkC,IAAI,IAAI,CAAC,GAAG,iBAAiB,QAAQ,GAAG,GAAG,aAAa,CAAC;CACjG,MAAM,kCAAkC,IAAI,IAAI,CAAC,GAAG,iBAAiB,YAAY,GAAG,GAAG,aAAa,CAAC;CACrG,OAAO;EACN;EACA,QAAQ;EACR,QAAQ,UAAU,YAAY,UAAU,YAAY,CAAC,CAAC,CAAC,QAAQ,UAAU;GACxE,MAAM,gBAAgB,wBAAwB,KAAK;GACnD,IAAI,kBAAkB,KAAK,GAAG,OAAO,iBAAiB,IAAI,aAAa;GACvE,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,KAAK,GAAG,OAAO;GACxC,QAAQ,gBAAgB,eAAe,kBAAkB,gBAAA,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"infer-psl-contract-DgQutzGt-C1wN72ZC.mjs","names":["readColumnDefault"],"sources":["../../../../3-targets/postgres/1-target/dist/infer-psl-contract-DgQutzGt.mjs"],"sourcesContent":["import { T as PG_TEXT_CODEC_ID } from \"./codec-ids-2htdtS66.mjs\";\nimport { u as postgresError } from \"./errors-DxWL0CMX.mjs\";\nimport { S as pgJsonb, t as createPostgresBuiltinDataTypeLookup, x as pgJson } from \"./data-types-DgYRia-g.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-CKHtbfmn.mjs\";\nimport \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as createPostgresBuiltinCodecLookup } from \"./codec-registry-FvoD6sJj.mjs\";\nimport \"./full-text-index-definition-MMcQF3_0.mjs\";\nimport { t as POLICY_BLOCK_KEYWORDS } from \"./authoring-4dCWsSXg.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-cvFP1EFS.mjs\";\nimport { n as readPostgresDefault } from \"./default-normalizer-BqK6XxdC.mjs\";\nimport { codecForRef, readContractValue } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { coordinateKey, elementCoordinates } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { getAuthoringTypeConstructor, instantiateAuthoringTypeConstructor, validateAuthoringHelperArguments } from \"@internal/framework-components/authoring\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from \"@internal/framework-components/psl-ast\";\nimport { NAME_THE_PSL_SOURCE_LOSES, isPslIdentifier } from \"@internal/psl-parser\";\nimport { printSqlExpressionLiteral, sqlTextsReadBack, storedSqlText } from \"@internal/sql-contract/sql-expression\";\nimport { composeCheckWirePrefix, computeCheckContentHash, computeIndexContentHash, formatWireName, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { inferColumnTypes, inferredTypeConstructors, mapDefault, toEnumMemberName } from \"@internal/family-sql/psl-build\";\nimport { readReportedDefault } from \"@internal/family-sql/control\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { isColumnDefault } from \"@internal/contract/types\";\nimport { buildChildRelationField, deriveRelationFieldName, inferRelations, toEnumName, toFieldName, toModelName } from \"@internal/family-sql/psl-infer\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/psl-literals.ts\nconst SYNTHETIC_SPAN = {\n\tstart: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t},\n\tend: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t}\n};\nfunction buildSimpleConstraintFieldAttribute(name, constraintName) {\n\tif (constraintName === void 0) return buildAttribute(\"field\", name, []);\n\treturn buildAttribute(\"field\", name, [namedArg(\"map\", `\"${escapePslString(constraintName)}\"`)]);\n}\nfunction parseDefaultAttributeString(attributeText) {\n\treturn buildAttribute(\"field\", \"default\", [positionalArg(attributeText.replace(/^@default\\(/, \"\").replace(/\\)$/, \"\"))]);\n}\nfunction buildMapAttribute(target, mapName) {\n\treturn buildAttribute(target, \"map\", [positionalArg(`\"${escapePslString(mapName)}\"`)]);\n}\nfunction buildAttribute(target, name, args) {\n\treturn {\n\t\tkind: \"attribute\",\n\t\ttarget,\n\t\tname,\n\t\targs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction positionalArg(value) {\n\treturn {\n\t\tkind: \"positional\",\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction namedArg(name, value) {\n\treturn {\n\t\tkind: \"named\",\n\t\tname,\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n/** A type call argument, by name when it has one. */\nfunction typeArgument(argument) {\n\treturn argument.name === void 0 ? positionalArg(argument.text) : namedArg(argument.name, argument.text);\n}\n//#endregion\n//#region src/core/psl-build/extension-block.ts\n/** One `extension <name> {}` block. */\nfunction buildExtensionBlock(name) {\n\treturn {\n\t\tkind: \"extension\",\n\t\tkeyword: \"extension\",\n\t\tname,\n\t\tparameters: {},\n\t\tblockAttributes: [],\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-default-codec.ts\n/**\n* The codec reference `contract emit` builds for a column of `pslType`: the codec its type constructor names, with the type parameters the values of the call's arguments give. Infer writes each argument only when its literal reads back as that value. An enum column's default is a member name, which is text either way, so it reads through the text codec.\n*/\nfunction inferredCodecRef(context, pslType, isEnum) {\n\tif (isEnum) return { codecId: PG_TEXT_CODEC_ID };\n\tconst descriptor = getAuthoringTypeConstructor(context.authoringContributions, pslType.path);\n\tif (descriptor === void 0) return void 0;\n\tconst args = pslType.values ?? [];\n\tvalidateAuthoringHelperArguments(pslType.path.join(\".\"), descriptor.args, args);\n\tconst { codecId, typeParams } = instantiateAuthoringTypeConstructor(descriptor, args);\n\treturn {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t};\n}\n/**\n* The default checks for `context`. A default the codec refuses has no PSL literal, so the raw\n* expression prints instead of a schema `contract emit` would reject. A column whose codec cannot be\n* built with its type parameters is treated the same way. An `InternalError` is a bug, not a\n* refusal, so it passes through.\n*\n* A data type says which values its column takes, not that every codec of it accepts each one: the\n* temporal codecs represent types that cast from text but refuse `infinity`, which PostgreSQL stores\n* and reports verbatim.\n*/\nfunction inferredColumnDefaults(context) {\n\treturn {\n\t\tcodecOf(pslType, isEnum) {\n\t\t\ttry {\n\t\t\t\tconst ref = inferredCodecRef(context, pslType, isEnum);\n\t\t\t\treturn ref === void 0 ? void 0 : context.codecLookup.descriptorFor(ref.codecId);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\ttypeParamsOf(pslType, isEnum) {\n\t\t\ttry {\n\t\t\t\treturn inferredCodecRef(context, pslType, isEnum)?.typeParams;\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\treadsBack(value, pslType, isEnum, isList) {\n\t\t\tconst values = isList && Array.isArray(value) ? value : [value];\n\t\t\ttry {\n\t\t\t\tconst ref = inferredCodecRef(context, pslType, isEnum);\n\t\t\t\tif (ref === void 0) return false;\n\t\t\t\tconst codec = codecForRef(context.codecLookup, ref);\n\t\t\t\tif (codec === void 0) return false;\n\t\t\t\tfor (const element of values) readContractValue(codec, blindCast(element), ref.typeParams);\n\t\t\t\treturn true;\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t};\n}\n/** For a table whose columns have no literal default, such as a many-to-many junction table. */\nconst noColumnDefaults = {\n\tcodecOf: () => void 0,\n\ttypeParamsOf: () => void 0,\n\treadsBack: () => false\n};\n//#endregion\n//#region src/core/psl-build/unique-name.ts\n/** `desiredName`, or it with the lowest number from 2 up that makes it unused. */\nfunction createUniqueFieldName(desiredName, usedFieldNames) {\n\tif (!usedFieldNames.has(desiredName)) return desiredName;\n\tlet counter = 2;\n\twhile (usedFieldNames.has(`${desiredName}${counter}`)) counter++;\n\treturn `${desiredName}${counter}`;\n}\n//#endregion\n//#region src/core/psl-build/native-enum-block.ts\n/** One `native_enum <name> { … }` block, with `@@map` when the type name differs from the block name. */\nfunction buildNativeEnumBlock(name, typeName, values) {\n\tconst usedMemberNames = /* @__PURE__ */ new Set([NAME_THE_PSL_SOURCE_LOSES]);\n\treturn {\n\t\tkind: \"native_enum\",\n\t\tkeyword: \"native_enum\",\n\t\tname,\n\t\tparameters: Object.fromEntries(values.map((value) => {\n\t\t\tconst memberName = createUniqueFieldName(toEnumMemberName(value), usedMemberNames);\n\t\t\tusedMemberNames.add(memberName);\n\t\t\treturn [memberName, {\n\t\t\t\texpression: JSON.stringify(value),\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}];\n\t\t})),\n\t\tblockAttributes: name === typeName ? [] : [{\n\t\t\tname: \"map\",\n\t\t\targs: [{\n\t\t\t\tkind: \"positional\",\n\t\t\t\tvalue: `\"${escapePslString(typeName)}\"`,\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t}],\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-names.ts\nfunction buildFieldNamesByTable(tables) {\n\tconst fieldNamesByTable = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst assignmentOrder = [...Object.values(table.columns).map((column, index) => {\n\t\t\tconst { name, map } = toFieldName(column.name);\n\t\t\treturn {\n\t\t\t\tcolumnName: column.name,\n\t\t\t\tdesiredFieldName: name,\n\t\t\t\tfieldMap: map,\n\t\t\t\tindex\n\t\t\t};\n\t\t})].sort((left, right) => {\n\t\t\tconst mapComparison = Number(left.fieldMap !== void 0) - Number(right.fieldMap !== void 0);\n\t\t\tif (mapComparison !== 0) return mapComparison;\n\t\t\treturn left.index - right.index;\n\t\t});\n\t\tconst usedFieldNames = /* @__PURE__ */ new Set();\n\t\tconst tableFieldNames = /* @__PURE__ */ new Map();\n\t\tfor (const column of assignmentOrder) {\n\t\t\tconst fieldName = createUniqueFieldName(column.desiredFieldName, usedFieldNames);\n\t\t\tusedFieldNames.add(fieldName);\n\t\t\ttableFieldNames.set(column.columnName, {\n\t\t\t\tfieldName,\n\t\t\t\tfieldMap: column.fieldMap\n\t\t\t});\n\t\t}\n\t\tfieldNamesByTable.set(table.name, tableFieldNames);\n\t}\n\treturn fieldNamesByTable;\n}\nfunction resolveColumnFieldName(fieldNamesByTable, tableName, columnName) {\n\treturn fieldNamesByTable.get(tableName)?.get(columnName)?.fieldName ?? toFieldName(columnName).name;\n}\nfunction buildTopLevelNameMap(sources, normalize, kind, sourceKind) {\n\tconst results = /* @__PURE__ */ new Map();\n\tconst normalizedToSources = /* @__PURE__ */ new Map();\n\tfor (const source of sources) {\n\t\tconst normalized = normalize(source);\n\t\tresults.set(source, normalized);\n\t\tnormalizedToSources.set(normalized.name, [...normalizedToSources.get(normalized.name) ?? [], source]);\n\t}\n\tconst duplicates = [...normalizedToSources.entries()].filter(([, conflictingSources]) => conflictingSources.length > 1);\n\tif (duplicates.length > 0) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `PSL ${kind} name collisions detected:\\n${duplicates.map(([normalizedName, conflictingSources]) => `- ${kind} \"${normalizedName}\" from ${sourceKind}s ${conflictingSources.map((source) => `\"${source}\"`).join(\", \")}`).join(\"\\n\")}`, { meta: {\n\t\tkind,\n\t\tnames: duplicates.map(([normalizedName]) => normalizedName)\n\t} });\n\treturn results;\n}\nfunction topologicalSort(models, tables, modelNameMap) {\n\tconst modelByName = /* @__PURE__ */ new Map();\n\tfor (const model of models) modelByName.set(model.name, model);\n\tconst deps = /* @__PURE__ */ new Map();\n\tconst tableToModel = /* @__PURE__ */ new Map();\n\tfor (const tableName of Object.keys(tables)) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name mapped for table \"${tableName}\"`);\n\t\ttableToModel.set(tableName, modelName);\n\t\tdeps.set(modelName, /* @__PURE__ */ new Set());\n\t}\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst modelName = tableToModel.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name recorded for table \"${tableName}\"`);\n\t\tconst modelDeps = deps.get(modelName);\n\t\tassertDefined(modelDeps, `topologicalSort: no dependency set recorded for model \"${modelName}\"`);\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst refModelName = tableToModel.get(fk.referencedTable);\n\t\t\tif (refModelName && refModelName !== modelName) modelDeps.add(refModelName);\n\t\t}\n\t}\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst nameDeps = deps.get(name);\n\t\tassertDefined(nameDeps, `topologicalSort: no dependency set recorded for model \"${name}\"`);\n\t\tconst sortedDeps = [...nameDeps].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = modelByName.get(name);\n\t\tassertDefined(model, `topologicalSort: no model block recorded for \"${name}\"`);\n\t\tresult.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/core/psl-infer/infer-enum-blocks.ts\nconst PSL_SCALAR_TYPE_NAMES = /* @__PURE__ */ new Set([\n\t\"String\",\n\t\"Boolean\",\n\t\"Int\",\n\t\"BigInt\",\n\t\"Float\",\n\t\"Decimal\",\n\t\"DateTime\",\n\t\"Json\",\n\t\"Bytes\"\n]);\n/**\n* Builds one `native_enum` extension-block AST node per introspected enum\n* definition. Block names go through the shared top-level transform\n* (`toEnumName`, intra-enum collisions throw like model collisions) and are\n* then reserved against the model names — an enum whose PSL name a model\n* already claims gets a numeric suffix, with `@@map` carrying the real type\n* name. Members print as explicit `member = \"value\"` pairs: the member name\n* is the sanitized value (deduplicated within the block), the JSON-encoded\n* value carries the truth verbatim.\n*/\nfunction buildNativeEnumBlocks(definitions, modelNames) {\n\tconst enumNames = buildTopLevelNameMap([...definitions.keys()].sort(), toEnumName, \"enum\", \"enum type\");\n\tconst usedTopLevelNames = new Set(PSL_SCALAR_TYPE_NAMES);\n\tfor (const result of modelNames.values()) usedTopLevelNames.add(result.name);\n\tconst enumNameMap = /* @__PURE__ */ new Map();\n\tconst enumBlocks = [];\n\tfor (const [typeName, result] of enumNames) {\n\t\tconst name = createUniqueFieldName(result.name, usedTopLevelNames);\n\t\tusedTopLevelNames.add(name);\n\t\tenumNameMap.set(typeName, name);\n\t\tenumBlocks.push(buildNativeEnumBlock(name, typeName, definitions.get(typeName) ?? []));\n\t}\n\treturn {\n\t\tenumNameMap,\n\t\tenumBlocks\n\t};\n}\n/**\n* The name of the adopted native enum `column` is typed by: the database reported its type as an\n* enum named in `enumTypeNames`, in `schemaName` when the output is wrapped in that schema's\n* namespace. Undefined for any other column.\n*/\nfunction adoptedEnumTypeName(column, enumTypeNames, schemaName) {\n\tconst reported = column.reportedType;\n\tif (reported?.kind !== \"enum\" || reported.name === void 0) return void 0;\n\tif (schemaName !== void 0 && reported.schema !== schemaName) return void 0;\n\treturn enumTypeNames.has(reported.name) ? reported.name : void 0;\n}\n//#endregion\n//#region src/core/psl-infer/infer-foreign-keys.ts\n/**\n* Coordinates every element a set of already-assembled contracts declare,\n* mapped to the {@link SqlDescribedContractSpace} that owns it and keyed by\n* the shared {@link coordinateKey} helper. `contract infer` uses this to omit\n* database elements a stack extension pack's contract space already\n* describes — reusing the same coordinate walk the contract-space aggregate\n* and cross-space collision check use (`elementCoordinates`), rather than a\n* bespoke per-entity-kind membership test — and, for a foreign key whose\n* referenced table an entry owns, to resolve the qualified cross-space\n* relation it describes.\n*/\nfunction describedContractOwners(describedContracts) {\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const entry of describedContracts) for (const coordinate of elementCoordinates(entry.contract.storage)) owners.set(coordinateKey(coordinate), entry);\n\treturn owners;\n}\nfunction resolveCrossSpaceTarget(owner, namespaceId, tableName) {\n\tconst domainNamespace = owner.contract.domain.namespaces[namespaceId];\n\tif (domainNamespace === void 0) return;\n\tfor (const [modelName, model] of Object.entries(domainNamespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tif (storage.namespaceId !== namespaceId || storage.table !== tableName) continue;\n\t\tconst fieldNamesByColumn = /* @__PURE__ */ new Map();\n\t\tfor (const [fieldName, fieldStorage] of Object.entries(storage.fields)) fieldNamesByColumn.set(fieldStorage.column, { fieldName });\n\t\treturn {\n\t\t\tspaceId: owner.spaceId,\n\t\t\tnamespaceId,\n\t\t\tmodelName,\n\t\t\tfieldNamesByColumn\n\t\t};\n\t}\n}\n/**\n* Classifies every foreign key on a surviving table into one of three cases.\n* A foreign key that carries a `referencedSchema` is checked against the\n* pack-owned coordinates first, so a pack-owned target wins even when a local\n* table happens to share its bare name; only foreign keys with no owned\n* coordinate fall through to the local/dangling distinction.\n*\n* - **Cross-space**: `referencedSchema` is set and a described contract owns\n* the coordinate `(referencedSchema, 'table', referencedTable)`. The\n* referenced table is absent from the tree (omitted because the pack\n* describes it, or never introspected — `contract infer` walks a single\n* namespace). Removed from `foreignKeys` (so `inferRelations` never falls\n* back to a bare, unqualified table name for it) and replaced with a\n* `RelationField` qualified with the owning pack's space id and namespace\n* id. `owners` holds only pack-declared coordinates, so an app's own table\n* (e.g. `public.users`) is never owned and cannot be captured here.\n* - **Local**: not a pack-owned coordinate, and the referenced table survived\n* introspection — left untouched, `inferRelations` handles it as before.\n* - **Dangling**: not a pack-owned coordinate, and the referenced table is\n* neither in the tree nor owned by any described contract. Removed from\n* `foreignKeys`, keeping the scalar column, rather than emitting a relation\n* to a model that was never defined.\n*\n* A pack that owns the referenced coordinate but declares no domain model\n* mapped to it is malformed; that case throws rather than degrading to a\n* silent drop, which would contradict the dangling definition above.\n*/\nfunction resolveForeignKeys(tables, owners) {\n\tconst resultTables = {};\n\tconst extraRelationsByTable = /* @__PURE__ */ new Map();\n\tconst crossSpaceFieldNamesByTable = /* @__PURE__ */ new Map();\n\tconst danglingForeignKeysByTable = /* @__PURE__ */ new Map();\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst keptForeignKeys = [];\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.referencedSchema !== void 0) {\n\t\t\t\tconst owner = owners.get(coordinateKey({\n\t\t\t\t\tnamespaceId: fk.referencedSchema,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: fk.referencedTable\n\t\t\t\t}));\n\t\t\t\tif (owner !== void 0) {\n\t\t\t\t\tconst target = resolveCrossSpaceTarget(owner, fk.referencedSchema, fk.referencedTable);\n\t\t\t\t\tif (target === void 0) throw postgresError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `contract infer: described contract space \"${owner.spaceId}\" owns storage coordinate \"${fk.referencedSchema}.${fk.referencedTable}\" but declares no domain model mapped to it. A pack that describes a table must also declare the domain model it maps to; this pack is malformed.`, { meta: {\n\t\t\t\t\t\tspaceId: owner.spaceId,\n\t\t\t\t\t\ttableName: fk.referencedTable\n\t\t\t\t\t} });\n\t\t\t\t\tif (!crossSpaceFieldNamesByTable.has(fk.referencedTable)) crossSpaceFieldNamesByTable.set(fk.referencedTable, target.fieldNamesByColumn);\n\t\t\t\t\tconst fieldName = deriveRelationFieldName(fk.columns, fk.referencedTable);\n\t\t\t\t\tconst optional = fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false);\n\t\t\t\t\tconst relationField = {\n\t\t\t\t\t\t...buildChildRelationField(fieldName, target.modelName, fk, optional, void 0, table),\n\t\t\t\t\t\ttypeNamespaceId: target.namespaceId,\n\t\t\t\t\t\ttypeContractSpaceId: target.spaceId\n\t\t\t\t\t};\n\t\t\t\t\tconst existingRelations = extraRelationsByTable.get(tableName);\n\t\t\t\t\tif (existingRelations) existingRelations.push(relationField);\n\t\t\t\t\telse extraRelationsByTable.set(tableName, [relationField]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tables[fk.referencedTable] !== void 0) keptForeignKeys.push(fk);\n\t\t\telse {\n\t\t\t\tconst dangling = {\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema,\n\t\t\t\t\treferencedTable: fk.referencedTable\n\t\t\t\t};\n\t\t\t\tconst existingDangling = danglingForeignKeysByTable.get(tableName);\n\t\t\t\tif (existingDangling) existingDangling.push(dangling);\n\t\t\t\telse danglingForeignKeysByTable.set(tableName, [dangling]);\n\t\t\t}\n\t\t}\n\t\tresultTables[tableName] = keptForeignKeys.length === table.foreignKeys.length ? table : new SqlTableIR({\n\t\t\t...table,\n\t\t\tforeignKeys: keptForeignKeys\n\t\t});\n\t}\n\treturn {\n\t\ttables: resultTables,\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t};\n}\n/**\n* Explains a foreign key `resolveForeignKeys` dropped as dangling: the\n* database enforces it, but its target lives outside the introspected\n* schema, so infer has no model to point a relation at. The suggested fix\n* targets the common cause — an unconfigured extension pack's schema\n* (e.g. Supabase's `auth`).\n*/\nfunction buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, tableName) {\n\treturn `Foreign key ${danglingForeignKeys.map((fk) => {\n\t\tconst fieldNames = fk.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, tableName, columnName));\n\t\tconst target = fk.referencedSchema !== void 0 ? `${fk.referencedSchema}.${fk.referencedTable}` : fk.referencedTable;\n\t\treturn `\"${fieldNames.join(\", \")}\" -> \"${target}\"`;\n\t}).join(\", \")} exists in the database, but its target schema is outside the introspected scope, so no relation field was generated. If the target schema is described by an extension pack, add it to extensions and re-run infer.`;\n}\n//#endregion\n//#region src/core/psl-build/index-attributes.ts\nfunction buildModelConstraintAttribute(name, fields, constraintName) {\n\tconst args = [positionalArg(`[${fields.join(\", \")}]`)];\n\tif (constraintName !== void 0) args.push(namedArg(\"map\", `\"${escapePslString(constraintName)}\"`));\n\treturn buildAttribute(\"model\", name, args);\n}\n/**\n* The naming of a live index, re-detected rather than trusted: wire when the\n* live name parses as a wire name AND that hash recomputes from the\n* introspected content; otherwise exact.\n*/\nfunction detectIndexNaming(index) {\n\tconst parsed = parseWireName(index.name);\n\tconst recomputed = computeIndexContentHash({\n\t\t...index.columns !== void 0 ? { columns: index.columns } : {},\n\t\t...index.expression !== void 0 ? { expression: index.expression } : {},\n\t\t...index.where !== void 0 ? { where: index.where } : {},\n\t\tunique: index.unique,\n\t\t...index.type !== void 0 ? { type: index.type } : {},\n\t\t...index.options !== void 0 ? { options: index.options } : {}\n\t});\n\treturn parsed !== void 0 && parsed.hash === recomputed ? {\n\t\tkind: \"wire\",\n\t\tprefix: parsed.prefix\n\t} : { kind: \"exact\" };\n}\nfunction namingArg(naming, exactName) {\n\treturn naming.kind === \"wire\" ? namedArg(\"name\", `\"${escapePslString(naming.prefix)}\"`) : namedArg(\"map\", `\"${escapePslString(exactName)}\"`);\n}\n/**\n* Emits one `@@index` attribute at full fidelity, named as `naming` says;\n* without it, the naming is re-detected from the live name and content.\n*/\nfunction buildIndexAttribute(index, fieldNames, naming = detectIndexNaming(index)) {\n\tconst args = [];\n\tif (fieldNames !== void 0) args.push(positionalArg(`[${fieldNames.join(\", \")}]`));\n\telse {\n\t\tassertDefined(index.expression, `buildIndexAttribute: index \"${index.name}\" carries neither columns nor expression; SqlIndexIR enforces exactly one`);\n\t\targs.push(namedArg(\"expression\", printSqlExpressionLiteral(index.expression)));\n\t}\n\targs.push(namingArg(naming, index.name));\n\tif (index.where !== void 0) args.push(namedArg(\"where\", printSqlExpressionLiteral(index.where)));\n\tif (index.unique) args.push(namedArg(\"unique\", \"true\"));\n\tif (index.type !== void 0 || index.options !== void 0) args.push(namedArg(\"type\", `\"${escapePslString(index.type ?? \"btree\")}\"`));\n\tif (index.options !== void 0) {\n\t\tconst entries = Object.entries(index.options ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, value]) => `${key}: \"${escapePslString(String(value))}\"`);\n\t\targs.push(namedArg(\"options\", `{ ${entries.join(\", \")} }`));\n\t}\n\treturn buildAttribute(\"model\", \"index\", args);\n}\n/**\n* Emits one `@@fullTextIndex` attribute. A weight group of one field is written as the bare field,\n* a larger group as a list, and the language only when it is not the default.\n*/\nfunction buildFullTextIndexAttribute(index, definition, fieldNameOf, naming) {\n\tconst args = [positionalArg(`[${definition.weightGroups.map((group) => {\n\t\tconst names = group.map(fieldNameOf);\n\t\treturn names.length === 1 ? names[0] ?? \"\" : `[${names.join(\", \")}]`;\n\t}).join(\", \")}]`), namingArg(naming, index.name)];\n\tif (definition.language !== \"english\") args.push(namedArg(\"language\", `\"${definition.language}\"`));\n\tif (index.where !== void 0) args.push(namedArg(\"where\", printSqlExpressionLiteral(index.where)));\n\treturn buildAttribute(\"model\", \"fullTextIndex\", args);\n}\n/**\n* Emits one `@@check` attribute, named as `naming` says. Without it, a live,\n* non-derived check is written in the `map:` form. Re-detecting `name:` is not\n* attempted there: the live expression is Postgres's own reprint, but a\n* wire-named check's hash was taken over the author's original text, so\n* recomputing the hash from the reprint would essentially never match. `map:`\n* plus the verbatim reprint is correct regardless — a reprint compared against\n* a later reprint of the same expression is stable, so the emitted contract\n* signs the live database with zero pending operations. `buildIntrospectedPolicyBlocks`\n* makes the same call for `@@map` on adopted RLS policies, for the same reason.\n*/\nfunction buildCheckAttribute(check, naming = { kind: \"exact\" }) {\n\treturn buildAttribute(\"model\", \"check\", [namedArg(\"expression\", printSqlExpressionLiteral(check.expression)), namingArg(naming, check.name)]);\n}\n//#endregion\n//#region src/core/psl-infer/infer-sql-text.ts\n/** Why `contract infer` skips an exact-named object whose SQL a `sql` literal would change. */\nconst SQL_DOES_NOT_READ_BACK = \"its SQL cannot be written as a sql literal that reads back unchanged. It is not in this schema, so migration plan will drop it. A sql literal written by hand holds different text, so migration plan then stops with a conflict for an index or check, or drops and recreates a policy. Either change the SQL in the database to the text of the literal, or add the object without map: or @@map so Prisma names it.\";\n/** The note on a model whose column default `contract infer` printed as a `sql` literal that reads back as different text. */\nfunction defaultDoesNotReadBackNote(column) {\n\treturn `// prisma: default of \"${column}\" holds text a sql literal cannot write back unchanged; check its string constants before applying a migration`;\n}\n/**\n* The index as `contract infer` prints it, or `undefined` when it is skipped. An exact-named index\n* is compared byte for byte, so its SQL must read back unchanged. A wire-named index is compared by\n* name, and its canonical SQL hashes to the same name, so it is printed with that text.\n*/\nfunction printableIndex(index) {\n\tif (sqlTextsReadBack([index.expression, index.where])) return index;\n\tconst expression = index.expression === void 0 ? void 0 : storedSqlText(index.expression);\n\tconst where = index.where === void 0 ? void 0 : storedSqlText(index.where);\n\tif (expression === void 0 && index.expression !== void 0) return void 0;\n\tif (where === void 0 && index.where !== void 0) return void 0;\n\tconst canonical = {\n\t\t...index,\n\t\t...expression !== void 0 ? { expression } : {},\n\t\t...where !== void 0 ? { where } : {}\n\t};\n\treturn detectIndexNaming(canonical).kind === \"wire\" ? canonical : void 0;\n}\n//#endregion\n//#region src/core/psl-infer/infer-model-blocks.ts\nfunction buildModel(table, columnTypes, enumNameOf, fieldNamesByTable, defaultMapping, defaultOf, columnDefaults, relationFields, danglingForeignKeys, rlsEnabled = false, policySkipNotes = []) {\n\tconst { name: modelName, map: mapName } = toModelName(table.name);\n\tconst fieldNameMap = fieldNamesByTable.get(table.name);\n\tconst pkColumns = new Set(table.primaryKey?.columns ?? []);\n\tconst isSinglePk = pkColumns.size === 1;\n\tconst singlePkConstraintName = isSinglePk ? table.primaryKey?.name : void 0;\n\tconst uniqueColumns = /* @__PURE__ */ new Map();\n\tfor (const unique of table.uniques) if (unique.columns.length === 1) {\n\t\tconst [columnName = \"\"] = unique.columns;\n\t\tconst existingConstraintName = uniqueColumns.get(columnName);\n\t\tif (!uniqueColumns.has(columnName) || existingConstraintName === void 0 && unique.name) uniqueColumns.set(columnName, unique.name);\n\t}\n\tconst derivedCheckNames = computeDerivedCheckNames(table);\n\tconst defaultNotes = [];\n\tconst fields = [];\n\tfor (const column of Object.values(table.columns)) fields.push(buildScalarField(column, table, columnTypes, enumNameOf, fieldNameMap, defaultMapping, defaultOf, columnDefaults, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames, () => defaultNotes.push(defaultDoesNotReadBackNote(column.name))));\n\tconst usedFieldNames = new Set(fields.map((field) => field.name));\n\tfor (const rel of relationFields) fields.push(buildRelationField(rel, table.name, fieldNamesByTable, usedFieldNames));\n\tconst modelAttributes = [];\n\tif (table.primaryKey && table.primaryKey.columns.length > 1) {\n\t\tconst pkFieldNames = table.primaryKey.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"id\", pkFieldNames, table.primaryKey.name));\n\t}\n\tfor (const unique of table.uniques) if (unique.columns.length > 1) {\n\t\tconst uniqueFieldNames = unique.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"unique\", uniqueFieldNames, unique.name));\n\t}\n\tconst sqlSkipNotes = [];\n\tconst skipNote = (kind, name) => sqlSkipNotes.push(`// prisma: skipped ${kind} \"${name}\": ${SQL_DOES_NOT_READ_BACK}`);\n\tfor (const index of table.indexes) {\n\t\tconst printable = printableIndex(index);\n\t\tif (printable === void 0) {\n\t\t\tskipNote(\"index\", index.name);\n\t\t\tcontinue;\n\t\t}\n\t\tconst indexFieldNames = printable.columns?.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildIndexAttribute(printable, indexFieldNames));\n\t}\n\tfor (const check of table.checks ?? []) {\n\t\tif (derivedCheckNames.has(check.name)) continue;\n\t\tif (!sqlTextsReadBack([check.expression])) {\n\t\t\tskipNote(\"check\", check.name);\n\t\t\tcontinue;\n\t\t}\n\t\tmodelAttributes.push(buildCheckAttribute(check));\n\t}\n\tif (mapName) modelAttributes.push(buildMapAttribute(\"model\", mapName));\n\tif (rlsEnabled) modelAttributes.push(buildAttribute(\"model\", \"rls\", []));\n\tconst warnings = [];\n\tif (!table.primaryKey) warnings.push(\"This table has no primary key in the database\");\n\tif (danglingForeignKeys.length > 0) warnings.push(buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, table.name));\n\tconst commentLines = [\n\t\t...warnings.length > 0 ? [`// WARNING: ${warnings.join(\" \")}`] : [],\n\t\t...policySkipNotes,\n\t\t...sqlSkipNotes,\n\t\t...defaultNotes\n\t];\n\tconst comment = commentLines.length > 0 ? commentLines.join(\"\\n\") : void 0;\n\treturn {\n\t\tkind: \"model\",\n\t\tname: modelName,\n\t\tfields,\n\t\tattributes: modelAttributes,\n\t\tspan: SYNTHETIC_SPAN,\n\t\t...comment !== void 0 ? { comment } : {}\n\t};\n}\n/**\n* The live check names that are derived: a live check's name matches `formatWireName(composeCheckWirePrefix(table, column, kind), computeCheckContentHash(expression))` for some column of the table and some candidate `postgresRenderCheckExpressions` would render for that column. Never by comparing expressions — the live body is a Postgres reprint, never the authored text. One set serves both the element nullability of list fields and `@@check` exclusion in `buildModel`, so the two decisions cannot drift apart.\n*\n* `membership` is unreachable here today: infer never emits domain enums (`enumType()` is not inferred), so no inferred column has member values and no membership check is ever derived. Inferring domain enums would mean threading the column's member values through here.\n*/\nfunction computeDerivedCheckNames(table) {\n\tconst liveCheckNames = new Set((table.checks ?? []).map((check) => check.name));\n\tconst derivedCheckNames = /* @__PURE__ */ new Set();\n\tfor (const column of Object.values(table.columns)) for (const candidate of postgresRenderCheckExpressions({\n\t\ttableName: table.name,\n\t\tcolumnName: column.name,\n\t\tmany: column.many === true ? { elementNullable: false } : false,\n\t\tmemberValues: void 0,\n\t\tvalueObject: void 0\n\t})) {\n\t\tconst derivedName = formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression));\n\t\tif (liveCheckNames.has(derivedName)) derivedCheckNames.add(derivedName);\n\t}\n\treturn derivedCheckNames;\n}\nfunction buildScalarField(column, table, columnTypes, enumNameOf, fieldNameMap, defaultMapping, defaultOf, columnDefaults, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames, noteDefaultThatDoesNotReadBack) {\n\tconst resolvedField = fieldNameMap?.get(column.name);\n\tconst fieldName = resolvedField?.fieldName ?? toFieldName(column.name).name;\n\tconst fieldMap = resolvedField?.fieldMap;\n\tconst enumPslName = enumNameOf(column);\n\tconst pslType = enumPslName === void 0 ? columnTypes(table.name, column.name) : {\n\t\tpath: [enumPslName],\n\t\targs: [],\n\t\texplicit: {\n\t\t\tpath: [enumPslName],\n\t\t\tvalues: []\n\t\t}\n\t};\n\tconst typeName = pslType.path.join(\".\");\n\tconst typeConstructor = enumPslName !== void 0 ? {\n\t\tkind: \"typeConstructor\",\n\t\tpath: [\"pg\", \"enum\"],\n\t\targs: [positionalArg(enumPslName)],\n\t\tspan: SYNTHETIC_SPAN\n\t} : pslType.args.length > 0 || pslType.path.length > 1 ? {\n\t\tkind: \"typeConstructor\",\n\t\tpath: pslType.path,\n\t\targs: pslType.args.map(typeArgument),\n\t\tspan: SYNTHETIC_SPAN\n\t} : void 0;\n\tconst attributes = [];\n\tconst isId = isSinglePk && pkColumns.has(column.name);\n\tif (isId) attributes.push(buildSimpleConstraintFieldAttribute(\"id\", singlePkConstraintName));\n\tconst isEnumColumn = enumPslName !== void 0;\n\tconst defaultAttribute = inferDefaultAttribute(column, defaultOf(table.name, column), {\n\t\t...defaultMapping,\n\t\t...ifDefined(\"columnCodec\", columnDefaults.codecOf(pslType.explicit, isEnumColumn)),\n\t\t...ifDefined(\"typeParams\", columnDefaults.typeParamsOf(pslType.explicit, isEnumColumn)),\n\t\tlist: column.many === true\n\t}, (value) => columnDefaults.readsBack(value, pslType.explicit, isEnumColumn, column.many === true), noteDefaultThatDoesNotReadBack);\n\tif (defaultAttribute !== void 0) attributes.push(parseDefaultAttributeString(defaultAttribute));\n\tif (uniqueColumns.has(column.name) && !isId) {\n\t\tconst uniqueConstraintName = uniqueColumns.get(column.name);\n\t\tattributes.push(buildSimpleConstraintFieldAttribute(\"unique\", uniqueConstraintName));\n\t}\n\tif (fieldMap !== void 0) attributes.push(buildMapAttribute(\"field\", fieldMap));\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName,\n\t\t...ifDefined(\"typeConstructor\", typeConstructor),\n\t\toptional: column.nullable,\n\t\tlist: column.many === true,\n\t\t...ifDefined(\"elementOptional\", column.many === true && !enforcesElementNotNull(table, column, derivedCheckNames) ? true : void 0),\n\t\tattributes,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction enforcesElementNotNull(table, column, derivedCheckNames) {\n\treturn postgresRenderCheckExpressions({\n\t\ttableName: table.name,\n\t\tcolumnName: column.name,\n\t\tmany: { elementNullable: false },\n\t\tmemberValues: void 0,\n\t\tvalueObject: void 0\n\t}).some((candidate) => candidate.kind === \"elementNotNull\" && derivedCheckNames.has(formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression))));\n}\n/**\n* A literal default prints as the PSL literal the column's data type takes. A literal that has no\n* such PSL literal prints as a `sql` tagged literal holding the expression Postgres reported.\n*/\nfunction inferDefaultAttribute(column, read, defaultMapping, readsBack, noteTextThatDoesNotReadBack) {\n\tif (column.default === void 0 && column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\") return \"@default(autoincrement())\";\n\tif (read === void 0) return void 0;\n\tif (read.kind === \"function\") return mappedAttribute(read, defaultMapping, noteTextThatDoesNotReadBack);\n\tif (column.many === true && !Array.isArray(read.value)) return void 0;\n\treturn literalOrRawAttribute(read, column, defaultMapping, readsBack, noteTextThatDoesNotReadBack);\n}\n/**\n* A literal no data type the column takes writes, or that the column's codec does not read back,\n* has no PSL literal, so the raw database default prints instead.\n*/\nfunction literalOrRawAttribute(columnDefault, column, defaultMapping, readsBack, noteTextThatDoesNotReadBack) {\n\tconst printed = columnDefault;\n\tconst result = printed.kind === \"literal\" && !readsBack(printed.value) ? void 0 : mapDefault(printed, defaultMapping);\n\tif (result !== void 0) return result.attribute;\n\treturn typeof column.default === \"string\" ? mappedAttribute({\n\t\tkind: \"function\",\n\t\texpression: column.default\n\t}, defaultMapping, noteTextThatDoesNotReadBack) : void 0;\n}\n/**\n* A default expression prints even when its `sql` literal reads back as different text: dropping it\n* would let the next plan drop the default. The caller notes it instead.\n*/\nfunction mappedAttribute(columnDefault, defaultMapping, noteTextThatDoesNotReadBack) {\n\tif (columnDefault.kind === \"function\" && !sqlTextsReadBack([columnDefault.expression])) noteTextThatDoesNotReadBack();\n\treturn mapDefault(columnDefault, defaultMapping)?.attribute;\n}\nfunction buildRelationField(rel, hostTableName, fieldNamesByTable, usedFieldNames) {\n\tconst fieldName = createUniqueFieldName(rel.fieldName, usedFieldNames);\n\tusedFieldNames.add(fieldName);\n\tconst args = [];\n\tif (rel.fields && rel.references) {\n\t\tif (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\t\targs.push(namedArg(\"fields\", `[${rel.fields.map((columnName) => resolveColumnFieldName(fieldNamesByTable, hostTableName, columnName)).join(\", \")}]`));\n\t\targs.push(namedArg(\"references\", `[${rel.references.map((columnName) => resolveColumnFieldName(fieldNamesByTable, rel.referencedTableName ?? \"\", columnName)).join(\", \")}]`));\n\t\tif (rel.onDelete) args.push(namedArg(\"onDelete\", rel.onDelete));\n\t\tif (rel.onUpdate) args.push(namedArg(\"onUpdate\", rel.onUpdate));\n\t\tif (rel.fkName) args.push(namedArg(\"map\", `\"${escapePslString(rel.fkName)}\"`));\n\t\tif (rel.index === false) args.push(namedArg(\"index\", \"false\"));\n\t\telse if (rel.index !== void 0) args.push(namedArg(\"index\", `\"${escapePslString(rel.index)}\"`));\n\t} else if (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\tconst attrs = args.length > 0 ? [buildAttribute(\"field\", \"relation\", args)] : [];\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName: rel.typeName,\n\t\t...ifDefined(\"typeNamespaceId\", rel.typeNamespaceId),\n\t\t...ifDefined(\"typeContractSpaceId\", rel.typeContractSpaceId),\n\t\toptional: rel.optional,\n\t\tlist: rel.list,\n\t\tattributes: attrs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-policy-blocks.ts\n/** Replaces invalid character runs with `_`; prepends `_` when the first character is invalid. */\nfunction sanitizePolicyHead(raw) {\n\tlet head = raw.replace(/[^\\p{L}\\p{N}_-]+/gu, \"_\");\n\tif (!/^[\\p{L}_]/u.test(head)) head = `_${head}`;\n\treturn head;\n}\n/**\n* Builds one `policy_<operation>` block per introspected policy. Every\n* adopted policy is exact-named: a reprinted body never reliably re-hashes to\n* the live suffix, so `@@map` always carries the physical name and the head\n* is only an identifier. A policy granting to a role whose name is not a\n* legal identifier cannot be authored at all — role references have no\n* `@@map` escape — so it is skipped with a note.\n*/\nfunction buildIntrospectedPolicyBlocks(policiesByTable, modelNameMap, reservedHeads = /* @__PURE__ */ new Set()) {\n\tconst all = [];\n\tfor (const [tableName, policies] of policiesByTable) for (const policy of policies) all.push({\n\t\tpolicy,\n\t\ttableName\n\t});\n\tall.sort((a, b) => {\n\t\tif (a.policy.name !== b.policy.name) return a.policy.name < b.policy.name ? -1 : 1;\n\t\tif (a.tableName !== b.tableName) return a.tableName < b.tableName ? -1 : 1;\n\t\treturn a.policy.operation < b.policy.operation ? -1 : a.policy.operation > b.policy.operation ? 1 : 0;\n\t});\n\tconst usedHeads = new Set(reservedHeads);\n\tconst blocks = [];\n\tconst skipNotesByTable = /* @__PURE__ */ new Map();\n\tfor (const { policy, tableName } of all) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `buildIntrospectedPolicyBlocks: policy \"${policy.name}\" targets table \"${tableName}\" with no emitted model; tables and policies come from the same introspection walk`);\n\t\tconst skipNote = (reason) => {\n\t\t\tconst notes = skipNotesByTable.get(tableName) ?? [];\n\t\t\tnotes.push(`// prisma: skipped policy \"${policy.name}\": ${reason}`);\n\t\t\tskipNotesByTable.set(tableName, notes);\n\t\t};\n\t\tconst badRole = policy.roles.find((role) => !isPslIdentifier(role));\n\t\tif (badRole !== void 0) {\n\t\t\tskipNote(`role \"${badRole}\" is not a valid PSL identifier and role references cannot be escaped`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!sqlTextsReadBack([policy.using, policy.withCheck])) {\n\t\t\tskipNote(SQL_DOES_NOT_READ_BACK);\n\t\t\tcontinue;\n\t\t}\n\t\tlet head = sanitizePolicyHead(parseWireName(policy.name)?.prefix ?? policy.name);\n\t\tif (usedHeads.has(head)) {\n\t\t\tlet n = 2;\n\t\t\twhile (usedHeads.has(`${head}_${n}`)) n += 1;\n\t\t\thead = `${head}_${n}`;\n\t\t}\n\t\tusedHeads.add(head);\n\t\tblocks.push({\n\t\t\tkind: \"policy\",\n\t\t\tkeyword: POLICY_BLOCK_KEYWORDS[policy.operation],\n\t\t\tname: head,\n\t\t\tparameters: {\n\t\t\t\ttarget: {\n\t\t\t\t\texpression: modelName,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\troles: {\n\t\t\t\t\texpression: `[${policy.roles.join(\", \")}]`,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\t...policy.using !== void 0 ? { using: {\n\t\t\t\t\texpression: printSqlExpressionLiteral(policy.using),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.withCheck !== void 0 ? { withCheck: {\n\t\t\t\t\texpression: printSqlExpressionLiteral(policy.withCheck),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.permissive ? {} : { permissive: {\n\t\t\t\t\texpression: \"false\",\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} }\n\t\t\t},\n\t\t\tblockAttributes: [{\n\t\t\t\tname: \"map\",\n\t\t\t\targs: [{\n\t\t\t\t\tkind: \"positional\",\n\t\t\t\t\tvalue: `\"${escapePslString(policy.name)}\"`,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t}],\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t});\n\t}\n\treturn {\n\t\tblocks,\n\t\tskipNotesByTable\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/json-exact-numbers.ts\nconst DECIMAL_PARTS_PATTERN = /^(-?)(\\d+)(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/;\n/** A numeral's value as `<sign><digits>e<exponent>`, with no leading or trailing zero digits. */\nfunction decimalValue(numeral) {\n\tconst parts = DECIMAL_PARTS_PATTERN.exec(numeral);\n\tif (parts === null) return void 0;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\", exponent = \"0\"] = parts;\n\tconst digits = `${whole}${fraction}`.replace(/^0+/, \"\");\n\tif (digits === \"\") return \"0\";\n\tconst significant = digits.replace(/0+$/, \"\");\n\treturn `${sign}${significant}e${Number(exponent) - fraction.length + digits.length - significant.length}`;\n}\nfunction keepsJsonNumber(value, source) {\n\tif (!Number.isFinite(value) || source === void 0) return false;\n\tconst written = decimalValue(source);\n\treturn written !== void 0 && written === decimalValue(String(value));\n}\n/**\n* Whether every number in the JSON text keeps its value once read into a JavaScript number. Postgres keeps every digit of a json number, and the JSON codecs read one into a JavaScript number, so a document holding `12345678901234567890` or `1e400` would print back as another document. `1.0` reads as `1`, the same value. Text that is not JSON is left to the codec.\n*/\nfunction jsonKeepsEveryNumber(text) {\n\tlet exact = true;\n\tconst reviver = (_key, value, context) => {\n\t\tif (typeof value === \"number\" && !keepsJsonNumber(value, context?.source)) exact = false;\n\t\treturn value;\n\t};\n\ttry {\n\t\tJSON.parse(text, reviver);\n\t} catch {\n\t\treturn true;\n\t}\n\treturn exact;\n}\n//#endregion\n//#region src/core/psl-infer/infer-read-defaults.ts\n/**\n* How `contract infer` reads the defaults the database reports: with the codec of the type constructor it prints for the column (`fromWire` of the literal's body, then `toDataTypeValue`), as `db verify` reads them with the contract column's codec. `contract infer` has no contract, so the constructor it prints stands in for one.\n*/\n/** For tables whose columns carry no default to read, such as a many-to-many junction table. */\nconst noInferredDefaults = () => void 0;\nfunction key(tableName, columnName) {\n\treturn JSON.stringify([tableName, columnName]);\n}\n/**\n* Reads each column's reported default. A function default, SQL NULL and a literal the codec reads are the default; a literal the codec cannot read, or one on a column whose constructor names no codec, is the raw expression as reported.\n*/\nasync function readInferredDefaults(schema, columnTypes, isEnumColumn, context) {\n\tconst read = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(schema.tables)) for (const column of Object.values(table.columns)) {\n\t\tconst columnDefault = await readColumnDefault(column, () => columnTypes(table.name, column.name), isEnumColumn(column), context);\n\t\tif (columnDefault !== void 0) read.set(key(table.name, column.name), columnDefault);\n\t}\n\treturn (tableName, column) => read.get(key(tableName, column.name));\n}\nasync function readColumnDefault(column, pslType, isEnum, context) {\n\tconst raw = column.default;\n\tif (typeof raw !== \"string\") return isColumnDefault(raw) ? raw : void 0;\n\treturn readDefaultWithCodec(raw, column.many === true, codecOf(pslType, isEnum, context));\n}\n/**\n* Reads one reported default, of a list column when `many`, with `codec`: a function default and SQL NULL as themselves, a literal the codec reads as its stored JSON, and anything else as the raw expression as reported.\n*/\nasync function readDefaultWithCodec(raw, many, codec) {\n\tconst reported = readPostgresDefault(raw, many);\n\tif (reported.kind === \"function\") return reported;\n\tif (reported.kind === \"null\") return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tconst rawExpression = {\n\t\tkind: \"function\",\n\t\texpression: raw.trim()\n\t};\n\tif (codec === void 0) return rawExpression;\n\tif (reported.literal.kind === \"list\" && reported.literal.elements.includes(null) && holdsNull(codec)) return rawExpression;\n\tif (JSON_TYPES.has(codec.dataType.id) && !bodiesOf(reported.literal).every(jsonBodyIsExact)) return rawExpression;\n\tif (!bodiesOf(reported.literal).every((body) => codecHoldsExactly(codec, body))) return rawExpression;\n\tconst read = await readReportedDefault(codec, reported.literal, raw);\n\treturn \"resolvedDefault\" in read ? read.resolvedDefault : rawExpression;\n}\n/**\n* Whether the codec of the type `contract infer` would write reads the column's reported default as a row value, with `fromWire`. A default that is not a literal, or a type that names no codec, has nothing to read. A `Date` codec reads a time with digits below a millisecond, dropping them, so such a default stays with it.\n*/\nfunction columnTypeReadsDefault(context) {\n\treturn async (_tableName, column, type) => {\n\t\tconst raw = column.default;\n\t\tif (typeof raw !== \"string\") return true;\n\t\tconst reported = readPostgresDefault(raw, column.many === true);\n\t\tif (reported.kind !== \"literal\") return true;\n\t\tconst codec = codecOf(() => type, false, context);\n\t\tif (codec === void 0) return true;\n\t\tfor (const body of bodiesOf(reported.literal)) {\n\t\t\tif (body === null) continue;\n\t\t\ttry {\n\t\t\t\tawait codec.fromWire(body, {});\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t};\n}\n/**\n* Whether the codec's application value holds `body` exactly, as `contract emit` asks of a written default: the codec's `fromDataTypeValue` refuses a value it cannot hold exactly, such as a `Date` codec a time with digits below a millisecond. A body the data type does not read as text is left to the codec's wire reading.\n*/\nfunction codecHoldsExactly(codec, body) {\n\tif (typeof body !== \"string\") return true;\n\tlet value;\n\ttry {\n\t\tvalue = codec.dataType.valueFrom(body, {});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn true;\n\t}\n\ttry {\n\t\tcodec.fromDataTypeValue(value);\n\t\treturn true;\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn false;\n\t}\n}\nconst JSON_TYPES = /* @__PURE__ */ new Set([pgJson.id, pgJsonb.id]);\nfunction bodiesOf(literal) {\n\treturn literal.kind === \"value\" ? [literal.body] : literal.elements;\n}\nfunction jsonBodyIsExact(body) {\n\treturn typeof body !== \"string\" || jsonKeepsEveryNumber(body);\n}\n/**\n* Whether the codec's type has a value null, as a JSON type does. A list element that is SQL NULL would then print as that value, which reads back as something else, so such a list keeps its raw expression.\n*/\nfunction holdsNull(codec) {\n\ttry {\n\t\tcodec.dataType.fromContract(null, {});\n\t\treturn true;\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn false;\n\t}\n}\nfunction codecOf(pslType, isEnum, context) {\n\ttry {\n\t\tconst ref = inferredCodecRef(context, isEnum ? { path: [] } : pslType().explicit, isEnum);\n\t\treturn ref === void 0 ? void 0 : codecForRef(context.codecLookup, ref);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n//#endregion\n//#region src/core/psl-infer/postgres-default-mapping.ts\nfunction createPostgresDefaultMapping() {\n\tconst codecLookup = createPostgresBuiltinCodecLookup();\n\treturn { dataTypes: {\n\t\tentries: postgresDataTypeEntries(),\n\t\tlookup: createPostgresBuiltinDataTypeLookup(),\n\t\tdataTypeOfCodec: (codecId) => codecLookup.descriptorFor(codecId)?.dataType\n\t} };\n}\n//#endregion\n//#region src/core/psl-infer/infer-psl-contract.ts\n/**\n* Infers a PSL AST (for `printPsl`) from an introspected Postgres schema tree.\n*\n* Target-owned inference: it walks the `PostgresDatabaseSchemaNode` tree and\n* owns the Postgres dialect knowledge — native enums and the default map.\n* It reads each reported default with the codec of the type constructor it prints for the column (`readInferredDefaults`). A column's type is the SQL family's: the constructor marked\n* `inferred` for the data type that claims the type the database reported.\n* Relation inference, name transforms, and generic default mapping are\n* shape-neutral utilities imported from the SQL family as well.\n*\n* The tree's tables (across its namespaces — `contract infer` introspects a\n* single live namespace) are gathered into the model set and emitted in one\n* bucket, alongside native-enum and RLS policy blocks. That bucket is named\n* after the introspected schema when the content needs a `namespace { … }`\n* wrap, and is the flat `UNSPECIFIED_PSL_NAMESPACE_ID` bucket otherwise. This\n* entry point emits nothing else, so its output is always exactly one bucket\n* and byte-identical to the prior flat inference. {@link buildPslDocumentAst}\n* can emit a second, always-flat bucket for content that must stay top-level\n* even under a wrap; no caller asks for one yet.\n*\n* `describedContracts` — the stack's extension packs' already-assembled\n* contracts, each paired with its space id — is consulted while gathering\n* tables: a table whose coordinate `(schemaName, 'table', tableName)` one of\n* those contracts already declares is omitted, before the duplicate-name\n* check below and before relation inference, so it cannot spuriously\n* collide with an app table and never contributes a bare relation field. A\n* surviving table's foreign key into an omitted, pack-owned table is not\n* dropped: {@link resolveForeignKeys} rewrites it into a relation qualified\n* with the pack's space id (`<spaceId>:<namespaceId>.<Model>`) instead.\n*/\nasync function inferPostgresPslContract(tree, context, describedContracts) {\n\tconst namespaces = Object.values(tree.namespaces);\n\tconst owners = describedContractOwners(describedContracts ?? []);\n\tconst enumDefinitions = /* @__PURE__ */ new Map();\n\tconst enumNamespaceNames = /* @__PURE__ */ new Set();\n\tfor (const namespace of namespaces) for (const { typeName, members } of namespace.nativeEnums) {\n\t\tif (owners.get(coordinateKey({\n\t\t\tnamespaceId: namespace.schemaName,\n\t\t\tentityKind: \"native_enum\",\n\t\t\tentityName: typeName\n\t\t})) !== void 0) continue;\n\t\tenumDefinitions.set(typeName, members);\n\t\tenumNamespaceNames.add(namespace.schemaName);\n\t}\n\tconst tables = {};\n\tconst introspectedTables = [];\n\tconst tableNamespaceNames = /* @__PURE__ */ new Set();\n\tconst rlsEnabledTables = /* @__PURE__ */ new Set();\n\tconst policiesByTable = /* @__PURE__ */ new Map();\n\tfor (const namespace of namespaces) for (const [tableName, table] of Object.entries(namespace.tables)) {\n\t\tif (owners.has(coordinateKey({\n\t\t\tnamespaceId: namespace.schemaName,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t}))) continue;\n\t\tif (tables[tableName] !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: duplicate table name \"${tableName}\" across schemas is not yet supported (single-namespace PSL inference emits one flat bucket; multi-namespace \\`namespace { … }\\` output is a later slice).`, { meta: { tableName } });\n\t\tfor (const column of Object.values(table.columns)) {\n\t\t\tconst reported = column.reportedType;\n\t\t\tconst owningSpaceId = reported?.kind === \"enum\" && reported.schema !== void 0 && reported.name !== void 0 ? owners.get(coordinateKey({\n\t\t\t\tnamespaceId: reported.schema,\n\t\t\t\tentityKind: \"native_enum\",\n\t\t\t\tentityName: reported.name\n\t\t\t}))?.spaceId : void 0;\n\t\t\tif (owningSpaceId !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: column \"${tableName}\".\"${column.name}\" is typed by native enum type \"${column.typeText}\", which extension pack space \"${owningSpaceId}\" already describes. A cross-space enum-typed column has no authorable PSL form yet; describe the table in that pack's contract or retype the column before re-running contract infer.`, { meta: {\n\t\t\t\ttableName,\n\t\t\t\tcolumnName: column.name\n\t\t\t} });\n\t\t}\n\t\ttables[tableName] = new SqlTableIR(table);\n\t\tintrospectedTables.push({\n\t\t\tschemaName: namespace.schemaName,\n\t\t\ttableName,\n\t\t\tcolumns: Object.values(table.columns)\n\t\t});\n\t\ttableNamespaceNames.add(namespace.schemaName);\n\t\tif (table.rlsEnabled) rlsEnabledTables.add(tableName);\n\t\tif (table.policies.length > 0) policiesByTable.set(tableName, table.policies);\n\t}\n\tlet wrapNamespaceName;\n\tif (enumDefinitions.size > 0 || policiesByTable.size > 0) {\n\t\tconst contentNamespaces = /* @__PURE__ */ new Set([...enumNamespaceNames, ...tableNamespaceNames]);\n\t\tif (contentNamespaces.size > 1) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: adopting native enums or RLS policies with content across multiple schemas is not yet supported (single-namespace PSL inference emits one \\`namespace { … }\\` block; multi-namespace output is a later slice). Schemas: ${[...contentNamespaces].sort().join(\", \")}.`, { meta: { schemas: [...contentNamespaces].sort() } });\n\t\twrapNamespaceName = [...contentNamespaces][0];\n\t}\n\tconst { tables: resolvedTables, extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = resolveForeignKeys(tables, owners);\n\tconst schemaIR = new SqlSchemaIR({ tables: resolvedTables });\n\tconst enumInfo = { definitions: enumDefinitions };\n\tconst isEnumColumn = (column) => adoptedEnumTypeName(column, enumInfo.definitions, wrapNamespaceName) !== void 0;\n\tconst columnTypes = await inferColumnTypes({\n\t\ttables: introspectedTables,\n\t\tconstructors: inferredTypeConstructors({\n\t\t\tauthoringTypes: context.authoringContributions.type,\n\t\t\tcodecLookup: context.codecLookup,\n\t\t\tdataTypeLookup: context.dataTypes.lookup\n\t\t}),\n\t\tauthoringTypes: context.authoringContributions.type,\n\t\tdataTypes: context.dataTypes,\n\t\tisEnumColumn,\n\t\treadsDefault: columnTypeReadsDefault(context)\n\t});\n\treturn buildPslDocumentAst(schemaIR, {\n\t\tcolumnTypes,\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tdefaultOf: await readInferredDefaults(schemaIR, columnTypes, isEnumColumn, context),\n\t\tcolumnDefaults: inferredColumnDefaults(context),\n\t\t...enumDefinitions.size > 0 ? { enumInfo } : {}\n\t}, {\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t}, wrapNamespaceName, {\n\t\trlsEnabledTables,\n\t\tpoliciesByTable\n\t}, [], inferredExtensionBlocks(tree, describedContracts ?? []));\n}\n/** Postgres installs it in every database, so a contract never declares it. */\nconst ALWAYS_INSTALLED_EXTENSION = \"plpgsql\";\n/**\n* One `extension` block per installed extension, keyed by the schema that holds its objects. An extension a composed pack declares is that pack's to declare, in whatever namespace it chose, since an extension's name is unique in the database.\n*/\nfunction inferredExtensionBlocks(tree, describedContracts) {\n\tconst packExtensions = new Set(describedContracts.flatMap(({ contract }) => Object.values(contract.storage.namespaces).flatMap((namespace) => Object.keys(namespace.entries[\"extension\"] ?? {}))));\n\tconst blocksBySchema = /* @__PURE__ */ new Map();\n\tfor (const extension of tree.extensions) {\n\t\tif (extension.name === ALWAYS_INSTALLED_EXTENSION || packExtensions.has(extension.name)) continue;\n\t\tif (!isPslIdentifier(extension.name)) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: extension \"${extension.name}\" is installed, and its name cannot be written as a PSL block name. Declare it in a TypeScript contract with extension(\"${extension.name}\").`, { meta: { extensionName: extension.name } });\n\t\tinvariant(extension.location.kind === \"installed\", `contract infer reads extension \"${extension.name}\" from the database, so it has an installed schema`);\n\t\tconst { schemaName } = extension.location;\n\t\tconst blocks = blocksBySchema.get(schemaName) ?? [];\n\t\tblocks.push(buildExtensionBlock(extension.name));\n\t\tblocksBySchema.set(schemaName, blocks);\n\t}\n\treturn blocksBySchema;\n}\n/**\n* Builds the PSL document for one introspected schema.\n*\n* `namespaceName` wraps the output in `namespace <name> { … }`; omit it for\n* flat output. `topLevelExtensionBlocks` are declarations that must stay\n* top-level even when a wrap applies, such as a recovered domain enum — a\n* family `enum` inside a namespace is a hard diagnostic. They land in their\n* own always-flat bucket when a wrap applies, and in the single flat bucket\n* when none does; either way they print unwrapped.\n*\n* Their names are reserved before the policy blocks are built, so a policy\n* renames itself out of the way. Against the rest of the top-level scope — the\n* models, the native enums, PSL's scalar type names, and the other blocks in\n* the list — a clash throws instead: a block's name is its contract key\n* (`entries.valueSet[name]`, with no `@@map` escape), so it cannot be rewritten\n* here.\n*/\nfunction buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName, rlsExtras, topLevelExtensionBlocks = [], extensionBlocksBySchema = /* @__PURE__ */ new Map()) {\n\tconst { columnTypes, defaultMapping, defaultOf } = options;\n\tconst { extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = foreignKeyExtras;\n\tconst modelNames = buildTopLevelNameMap(Object.keys(schemaIR.tables), toModelName, \"model\", \"table\");\n\tconst modelNameMap = new Map([...modelNames].map(([tableName, result]) => [tableName, result.name]));\n\tconst { enumNameMap: bareEnumNameMap, enumBlocks } = buildNativeEnumBlocks(options.enumInfo?.definitions ?? /* @__PURE__ */ new Map(), modelNames);\n\tconst enumNameOf = (column) => {\n\t\tconst typeName = adoptedEnumTypeName(column, bareEnumNameMap, namespaceName);\n\t\treturn typeName === void 0 ? void 0 : bareEnumNameMap.get(typeName);\n\t};\n\tconst fieldNamesByTable = new Map([...crossSpaceFieldNamesByTable, ...buildFieldNamesByTable(schemaIR.tables)]);\n\tconst { relationsByTable } = inferRelations(schemaIR.tables, modelNameMap);\n\tconst policyEmission = buildIntrospectedPolicyBlocks(rlsExtras?.policiesByTable ?? /* @__PURE__ */ new Map(), modelNameMap, /* @__PURE__ */ new Set([\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values(),\n\t\t...topLevelExtensionBlocks.map((block) => block.name)\n\t]));\n\tconst claimedTopLevelNames = /* @__PURE__ */ new Set([\n\t\t...PSL_SCALAR_TYPE_NAMES,\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values()\n\t]);\n\tfor (const block of topLevelExtensionBlocks) {\n\t\tif (claimedTopLevelNames.has(block.name)) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `contract infer: recovered ${block.keyword} \"${block.name}\" collides with a model, a native enum, a PSL scalar type, or another recovered declaration of the same name. Rename the recovered declaration, or exclude it.`, { meta: {\n\t\t\tkind: block.keyword,\n\t\t\tname: block.name\n\t\t} });\n\t\tclaimedTopLevelNames.add(block.name);\n\t}\n\tconst models = [];\n\tfor (const table of Object.values(schemaIR.tables)) models.push(buildModel(table, columnTypes, enumNameOf, fieldNamesByTable, defaultMapping, defaultOf, options.columnDefaults, [...relationsByTable.get(table.name) ?? [], ...extraRelationsByTable.get(table.name) ?? []], danglingForeignKeysByTable.get(table.name) ?? [], rlsExtras?.rlsEnabledTables.has(table.name) ?? false, policyEmission.skipNotesByTable.get(table.name) ?? []));\n\tconst sortedModels = topologicalSort(models, schemaIR.tables, modelNameMap);\n\tconst separateTopLevelBucket = namespaceName !== void 0 && namespaceName !== UNSPECIFIED_PSL_NAMESPACE_ID && topLevelExtensionBlocks.length > 0;\n\tconst namespaces = [];\n\tif (separateTopLevelBucket) namespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries([], [], topLevelExtensionBlocks),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\tconst mainSchema = namespaceName ?? \"public\";\n\tnamespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: namespaceName ?? UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries(sortedModels, [], [\n\t\t\t...separateTopLevelBucket ? [] : topLevelExtensionBlocks,\n\t\t\t...extensionBlocksBySchema.get(mainSchema) ?? [],\n\t\t\t...enumBlocks,\n\t\t\t...policyEmission.blocks\n\t\t]),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\tfor (const [schemaName, blocks] of extensionBlocksBySchema) {\n\t\tif (schemaName === mainSchema) continue;\n\t\tnamespaces.push(makePslNamespace({\n\t\t\tkind: \"namespace\",\n\t\t\tname: schemaName,\n\t\t\tentries: makePslNamespaceEntries([], [], blocks),\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t}));\n\t}\n\treturn {\n\t\tkind: \"document\",\n\t\tsourceId: \"<sql-schema-ir>\",\n\t\tnamespaces,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\nexport { positionalArg as _, buildCheckAttribute as a, buildModelConstraintAttribute as c, buildExtensionBlock as d, SYNTHETIC_SPAN as f, parseDefaultAttributeString as g, namedArg as h, noInferredDefaults as i, buildNativeEnumBlock as l, buildMapAttribute as m, inferPostgresPslContract as n, buildFullTextIndexAttribute as o, buildAttribute as p, createPostgresDefaultMapping as r, buildIndexAttribute as s, buildPslDocumentAst as t, noColumnDefaults as u, typeArgument as v };\n\n//# sourceMappingURL=infer-psl-contract-DgQutzGt.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,iBAAiB;CACtB,OAAO;EACN,QAAQ;EACR,MAAM;EACN,QAAQ;CACT;CACA,KAAK;EACJ,QAAQ;EACR,MAAM;EACN,QAAQ;CACT;AACD;AACA,SAAS,oCAAoC,MAAM,gBAAgB;CAClE,IAAI,mBAAmB,KAAK,GAAG,OAAO,eAAe,SAAS,MAAM,CAAC,CAAC;CACtE,OAAO,eAAe,SAAS,MAAM,CAAC,SAAS,OAAO,IAAI,gBAAgB,cAAc,EAAE,EAAE,CAAC,CAAC;AAC/F;AACA,SAAS,4BAA4B,eAAe;CACnD,OAAO,eAAe,SAAS,WAAW,CAAC,cAAc,cAAc,QAAQ,eAAe,EAAE,CAAC,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAC,CAAC;AACvH;AACA,SAAS,kBAAkB,QAAQ,SAAS;CAC3C,OAAO,eAAe,QAAQ,OAAO,CAAC,cAAc,IAAI,gBAAgB,OAAO,EAAE,EAAE,CAAC,CAAC;AACtF;AACA,SAAS,eAAe,QAAQ,MAAM,MAAM;CAC3C,OAAO;EACN,MAAM;EACN;EACA;EACA;EACA,MAAM;CACP;AACD;AACA,SAAS,cAAc,OAAO;CAC7B,OAAO;EACN,MAAM;EACN;EACA,MAAM;CACP;AACD;AACA,SAAS,SAAS,MAAM,OAAO;CAC9B,OAAO;EACN,MAAM;EACN;EACA;EACA,MAAM;CACP;AACD;;AAEA,SAAS,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