@prisma/orm-target-postgres 8.0.0-rc.16-dev.5 → 8.0.0-rc.16-dev.7

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 (192) hide show
  1. package/dist/{adapter-BB0VVFW2.d.mts → adapter-BXHPMNAg.d.mts} +3 -3
  2. package/dist/{adapter-BB0VVFW2.d.mts.map → adapter-BXHPMNAg.d.mts.map} +1 -1
  3. package/dist/{adapter-RtS8vD8U-m4U_WTpQ.mjs → adapter-RtS8vD8U-CkJSaICZ.mjs} +5 -5
  4. package/dist/{adapter-RtS8vD8U-m4U_WTpQ.mjs.map → adapter-RtS8vD8U-CkJSaICZ.mjs.map} +1 -1
  5. package/dist/adapter.d.mts +7 -7
  6. package/dist/adapter.mjs +5 -5
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__control.d.mts +2 -2
  10. package/dist/adapter__control.mjs +6 -6
  11. package/dist/adapter__runtime.d.mts +1 -1
  12. package/dist/adapter__runtime.mjs +4 -4
  13. package/dist/adapter__sql-renderer.d.mts +1 -1
  14. package/dist/adapter__sql-renderer.mjs +1 -1
  15. package/dist/adapter__types.d.mts +3 -3
  16. package/dist/{authoring-vHbPLrW4-BsHR7gUE.mjs → authoring-_2G2lsLt-VmVbrMPn.mjs} +5 -5
  17. package/dist/{authoring-vHbPLrW4-BsHR7gUE.mjs.map → authoring-_2G2lsLt-VmVbrMPn.mjs.map} +1 -1
  18. package/dist/{check-expressions-Dlt334zg-CV5Vkh3G.mjs → check-expressions-BaFrBceq-ChgvazEN.mjs} +14 -12
  19. package/dist/check-expressions-BaFrBceq-ChgvazEN.mjs.map +1 -0
  20. package/dist/{check-expressions-CBIgoKhV-D7oTR8lp.d.mts → check-expressions-CtTzM58x-CsWFEeul.d.mts} +6 -5
  21. package/dist/check-expressions-CtTzM58x-CsWFEeul.d.mts.map +1 -0
  22. package/dist/{codec-descriptor-CZAGhM_O-DK9auM7J.mjs → codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs} +3 -2
  23. package/dist/codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs.map +1 -0
  24. package/dist/{codec-helpers-D015Pvwa-DR7WMloQ.mjs → codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs} +244 -3
  25. package/dist/codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs.map +1 -0
  26. package/dist/{codec-registry-nSGjxm-H-BeUu5zV2.mjs → codec-registry-CKBDkxX7-Kw84Or3s.mjs} +5 -5
  27. package/dist/{codec-registry-nSGjxm-H-BeUu5zV2.mjs.map → codec-registry-CKBDkxX7-Kw84Or3s.mjs.map} +1 -1
  28. package/dist/{codec-type-map-DftCqvHU-BYkGKRZI.d.mts → codec-type-map-DueQFJ3a-DKLtMn3R.d.mts} +3 -3
  29. package/dist/{codec-type-map-DftCqvHU-BYkGKRZI.d.mts.map → codec-type-map-DueQFJ3a-DKLtMn3R.d.mts.map} +1 -1
  30. package/dist/codec-types-CY3pawL3.d.mts +2 -0
  31. package/dist/{codec-types-CHtW4cn_-ryYZXjOb.d.mts → codec-types-CYsrudBM-DcYPKpS1.d.mts} +4 -4
  32. package/dist/{codec-types-CHtW4cn_-ryYZXjOb.d.mts.map → codec-types-CYsrudBM-DcYPKpS1.d.mts.map} +1 -1
  33. package/dist/{codecs-DelwJv6h-CFbyTJIJ.mjs → codecs-BK3J4C0n-B8EnUXZf.mjs} +49 -37
  34. package/dist/codecs-BK3J4C0n-B8EnUXZf.mjs.map +1 -0
  35. package/dist/{codecs-Djhvng3f.d.mts → codecs-ChjCJY5k.d.mts} +2 -2
  36. package/dist/{codecs-Djhvng3f.d.mts.map → codecs-ChjCJY5k.d.mts.map} +1 -1
  37. package/dist/{codecs-CvG9lv7r-9RlHwf9Y.d.mts → codecs-y1gOMMt--DKWhYGN5.d.mts} +8 -2
  38. package/dist/codecs-y1gOMMt--DKWhYGN5.d.mts.map +1 -0
  39. package/dist/{contract-free-DaK6wmmo.mjs → contract-free-BMKFjlIG.mjs} +3 -3
  40. package/dist/{contract-free-DaK6wmmo.mjs.map → contract-free-BMKFjlIG.mjs.map} +1 -1
  41. package/dist/{control-CHqdVXHC.d.mts → control-D2JNE1Tz.d.mts} +3 -3
  42. package/dist/{control-CHqdVXHC.d.mts.map → control-D2JNE1Tz.d.mts.map} +1 -1
  43. package/dist/{control-YKrabf1Q.mjs → control-Ltn8Dzpi.mjs} +11 -11
  44. package/dist/{control-YKrabf1Q.mjs.map → control-Ltn8Dzpi.mjs.map} +1 -1
  45. package/dist/{control-adapter-Co30P4lH-B5euUoQ4.mjs → control-adapter-Co30P4lH-CpxXk5cz.mjs} +6 -6
  46. package/dist/{control-adapter-Co30P4lH-B5euUoQ4.mjs.map → control-adapter-Co30P4lH-CpxXk5cz.mjs.map} +1 -1
  47. package/dist/{control-policy-bwcdB78Y-DgRaWAzu.mjs → control-policy-DMOu5nnt-DslefUx9.mjs} +11 -10
  48. package/dist/control-policy-DMOu5nnt-DslefUx9.mjs.map +1 -0
  49. package/dist/{data-type-entries-DgKLUrqt-TKDikzti.mjs → data-type-entries-DoR61yeO-BB2cY7rI.mjs} +3 -3
  50. package/dist/{data-type-entries-DgKLUrqt-TKDikzti.mjs.map → data-type-entries-DoR61yeO-BB2cY7rI.mjs.map} +1 -1
  51. package/dist/{data-types-E1wms1_i.d.mts → data-types-BDkZIUMI.d.mts} +4 -2
  52. package/dist/{data-types-E1wms1_i.d.mts.map → data-types-BDkZIUMI.d.mts.map} +1 -1
  53. package/dist/{data-types-k3Ebk3kj-DWk3nh_k.mjs → data-types-DRkmmE9S-C5Q9oH4Q.mjs} +13 -4
  54. package/dist/data-types-DRkmmE9S-C5Q9oH4Q.mjs.map +1 -0
  55. package/dist/{ddl-C_vTj7b5-vyGLBKLo.mjs → ddl-D5hYRCTf-DRSajCVT.mjs} +3 -3
  56. package/dist/{ddl-C_vTj7b5-vyGLBKLo.mjs.map → ddl-D5hYRCTf-DRSajCVT.mjs.map} +1 -1
  57. package/dist/{default-normalizer-CrMBHF0W-BaUR4Ec8.mjs → default-normalizer-Bf_Fhv4v-CugGfLAe.mjs} +12 -7
  58. package/dist/default-normalizer-Bf_Fhv4v-CugGfLAe.mjs.map +1 -0
  59. package/dist/{descriptor-meta-ARufwwWW-DMQsPNAl.mjs → descriptor-meta-ARufwwWW-ChZm5Hg5.mjs} +3 -3
  60. package/dist/{descriptor-meta-ARufwwWW-DMQsPNAl.mjs.map → descriptor-meta-ARufwwWW-ChZm5Hg5.mjs.map} +1 -1
  61. package/dist/{descriptor-meta-BgOMP4hF-CfUJsgjc.mjs → descriptor-meta-WHc6Kv-m-BLzsaP0M.mjs} +8 -8
  62. package/dist/{descriptor-meta-BgOMP4hF-CfUJsgjc.mjs.map → descriptor-meta-WHc6Kv-m-BLzsaP0M.mjs.map} +1 -1
  63. package/dist/{descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs → descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs} +3 -3
  64. package/dist/{descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs.map → descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs.map} +1 -1
  65. package/dist/{diff-database-schema-zc7d2uxC-BVe8D7vG.mjs → diff-database-schema-DgAMDjHF-YATlptWC.mjs} +6 -6
  66. package/dist/{diff-database-schema-zc7d2uxC-BVe8D7vG.mjs.map → diff-database-schema-DgAMDjHF-YATlptWC.mjs.map} +1 -1
  67. package/dist/{full-text-D5pW25-Y.d.mts → full-text-CCqTEQ9y.d.mts} +2 -2
  68. package/dist/{full-text-D5pW25-Y.d.mts.map → full-text-CCqTEQ9y.d.mts.map} +1 -1
  69. package/dist/{full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs → full-text-index-expression-Bfp_xWhy-DtbLdkzv.mjs} +3 -3
  70. package/dist/{full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs.map → full-text-index-expression-Bfp_xWhy-DtbLdkzv.mjs.map} +1 -1
  71. package/dist/{full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts → full-text-parsers-DrS_1B-x-BcAnBoQP.d.mts} +3 -3
  72. package/dist/{full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts.map → full-text-parsers-DrS_1B-x-BcAnBoQP.d.mts.map} +1 -1
  73. package/dist/{infer-psl-contract-B5yExD61-Cmye68li.mjs → infer-psl-contract-D-3st5lU-DKQhhsut.mjs} +7 -7
  74. package/dist/{infer-psl-contract-B5yExD61-Cmye68li.mjs.map → infer-psl-contract-D-3st5lU-DKQhhsut.mjs.map} +1 -1
  75. package/dist/{issue-planner-pmBrIrEN.d.mts → issue-planner-DWRClmiP.d.mts} +2 -2
  76. package/dist/{issue-planner-pmBrIrEN.d.mts.map → issue-planner-DWRClmiP.d.mts.map} +1 -1
  77. package/dist/{migration-D189kh3f.d.mts → migration--J8vKZ8z.d.mts} +3 -3
  78. package/dist/{migration-D189kh3f.d.mts.map → migration--J8vKZ8z.d.mts.map} +1 -1
  79. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  80. package/dist/{op-factory-call-CqKUB1XP-CsEGx4Jd.d.mts → op-factory-call-BFnGNPJD-5vgAjFpd.d.mts} +44 -14
  81. package/dist/op-factory-call-BFnGNPJD-5vgAjFpd.d.mts.map +1 -0
  82. package/dist/{op-factory-call-DdXVWQlV-DzfLhTkh.mjs → op-factory-call-BbTtrII--CbCFZfSd.mjs} +124 -28
  83. package/dist/op-factory-call-BbTtrII--CbCFZfSd.mjs.map +1 -0
  84. package/dist/op-factory-call-CsuauFRs.d.mts +1 -0
  85. package/dist/{operation-types-Be5rdu14.d.mts → operation-types-CjJY7prP.d.mts} +2 -2
  86. package/dist/{operation-types-Be5rdu14.d.mts.map → operation-types-CjJY7prP.d.mts.map} +1 -1
  87. package/dist/{pack-DHV9zslZ.d.mts → pack-Bq9yq-OS.d.mts} +4 -4
  88. package/dist/{pack-DHV9zslZ.d.mts.map → pack-Bq9yq-OS.d.mts.map} +1 -1
  89. package/dist/{planner-CvUO8Zpn.d.mts → planner-B9c5vxQo.d.mts} +15 -8
  90. package/dist/planner-B9c5vxQo.d.mts.map +1 -0
  91. package/dist/{planner-ZmK0aNuY-Cak-8zwa.mjs → planner-_mo_t-l3-DPAQVG1x.mjs} +117 -23
  92. package/dist/planner-_mo_t-l3-DPAQVG1x.mjs.map +1 -0
  93. package/dist/{planner-ddl-builders-DRProi99-D0K5ZiD0.mjs → planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs} +3 -3
  94. package/dist/{planner-ddl-builders-DRProi99-D0K5ZiD0.mjs.map → planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs.map} +1 -1
  95. package/dist/{planner-identity-values-C1eV916m-D0p3EfYc.mjs → planner-identity-values-CRS2cQ6v-DakZeIQj.mjs} +3 -3
  96. package/dist/{planner-identity-values-C1eV916m-D0p3EfYc.mjs.map → planner-identity-values-CRS2cQ6v-DakZeIQj.mjs.map} +1 -1
  97. package/dist/{planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs → planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs} +4 -4
  98. package/dist/{planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs.map → planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs.map} +1 -1
  99. package/dist/planner-produced-postgres-migration-BqcWgPjb.d.mts +1 -0
  100. package/dist/{planner-produced-postgres-migration-DT3i_p3G-CyQUv3ac.d.mts → planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts} +3 -3
  101. package/dist/planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts.map +1 -0
  102. package/dist/{planner-sql-checks-rqOH8naU-B6xOE5lC.mjs → planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs} +3 -3
  103. package/dist/{planner-sql-checks-rqOH8naU-B6xOE5lC.mjs.map → planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs.map} +1 -1
  104. package/dist/{postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs → postgres-contract-view-CL-YTH_3-Diah6i2a.mjs} +6 -6
  105. package/dist/{postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs.map → postgres-contract-view-CL-YTH_3-Diah6i2a.mjs.map} +1 -1
  106. package/dist/{postgres-migration-e8UybR1y-C_m4i1jp.d.mts → postgres-migration-DVY2ALDJ-DTWECas_.d.mts} +36 -4
  107. package/dist/postgres-migration-DVY2ALDJ-DTWECas_.d.mts.map +1 -0
  108. package/dist/postgres-migration-DmczQSHT-DsWlow8L.mjs +1075 -0
  109. package/dist/postgres-migration-DmczQSHT-DsWlow8L.mjs.map +1 -0
  110. package/dist/{postgres-schema-AlEVkXXS-ZfXWYddl.mjs → postgres-schema-COkaqci7-C6JpiSha.mjs} +6 -6
  111. package/dist/postgres-schema-COkaqci7-C6JpiSha.mjs.map +1 -0
  112. package/dist/{prisma7-binding-GebhdAGS.mjs → prisma7-binding-CAzQh1rQ.mjs} +7 -7
  113. package/dist/{prisma7-binding-GebhdAGS.mjs.map → prisma7-binding-CAzQh1rQ.mjs.map} +1 -1
  114. package/dist/{prisma7-binding-FvF1AZxQ.d.mts → prisma7-binding-Dm34z6Fq.d.mts} +4 -4
  115. package/dist/{prisma7-binding-FvF1AZxQ.d.mts.map → prisma7-binding-Dm34z6Fq.d.mts.map} +1 -1
  116. package/dist/{render-ops-D2vJApKB-B281fzmn.mjs → render-ops-DaCy6StH-BgzbTE_9.mjs} +16 -9
  117. package/dist/render-ops-DaCy6StH-BgzbTE_9.mjs.map +1 -0
  118. package/dist/{resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs → resolve-ddl-schema-DD69Bwve-e-BpAfFa.mjs} +3 -3
  119. package/dist/{resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs.map → resolve-ddl-schema-DD69Bwve-e-BpAfFa.mjs.map} +1 -1
  120. package/dist/{runtime-aejvKbMy.d.mts → runtime-CNTEAZIz.d.mts} +2 -2
  121. package/dist/{runtime-aejvKbMy.d.mts.map → runtime-CNTEAZIz.d.mts.map} +1 -1
  122. package/dist/{sql-renderer-DT4IEOVi-CE0YIu9V.mjs → sql-renderer-DT4IEOVi-CBE8uTub.mjs} +2 -2
  123. package/dist/{sql-renderer-DT4IEOVi-CE0YIu9V.mjs.map → sql-renderer-DT4IEOVi-CBE8uTub.mjs.map} +1 -1
  124. package/dist/{sql-renderer-B1ZLRgUw.d.mts → sql-renderer-hQ3HTY-B.d.mts} +2 -2
  125. package/dist/{sql-renderer-B1ZLRgUw.d.mts.map → sql-renderer-hQ3HTY-B.d.mts.map} +1 -1
  126. package/dist/target.d.mts +21 -21
  127. package/dist/target.mjs +27 -27
  128. package/dist/target__codec-descriptor.mjs +1 -1
  129. package/dist/target__codec-types.d.mts +3 -3
  130. package/dist/target__codecs.d.mts +2 -2
  131. package/dist/target__codecs.mjs +2 -2
  132. package/dist/target__contract-free.mjs +3 -3
  133. package/dist/target__control.mjs +3 -3
  134. package/dist/target__data-types.d.mts +1 -1
  135. package/dist/target__data-types.mjs +2 -2
  136. package/dist/target__default-normalizer.mjs +1 -1
  137. package/dist/target__diff-database-schema.mjs +1 -1
  138. package/dist/target__full-text.d.mts +2 -2
  139. package/dist/target__issue-planner.d.mts +1 -1
  140. package/dist/target__issue-planner.mjs +1 -1
  141. package/dist/target__migration.d.mts +2 -2
  142. package/dist/target__migration.mjs +2 -2
  143. package/dist/target__op-factory-call.d.mts +3 -3
  144. package/dist/target__op-factory-call.mjs +2 -2
  145. package/dist/target__operation-types.d.mts +1 -1
  146. package/dist/target__pack.d.mts +1 -1
  147. package/dist/target__pack.mjs +1 -1
  148. package/dist/target__planner-ddl-builders.mjs +1 -1
  149. package/dist/target__planner-identity-values.mjs +1 -1
  150. package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
  151. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  152. package/dist/target__planner-sql-checks.mjs +1 -1
  153. package/dist/target__planner.d.mts +1 -1
  154. package/dist/target__planner.mjs +2 -2
  155. package/dist/target__prisma7-binding.d.mts +1 -1
  156. package/dist/target__prisma7-binding.mjs +1 -1
  157. package/dist/target__render-ops.mjs +1 -1
  158. package/dist/target__runtime.mjs +3 -3
  159. package/dist/target__runtime.mjs.map +1 -1
  160. package/dist/target__schema-ir-annotations.mjs +1 -1
  161. package/dist/target__sql-utils.mjs +1 -1
  162. package/dist/target__types.d.mts +2 -2
  163. package/dist/target__types.mjs +2 -2
  164. package/dist/{types-D799eppJ.d.mts → types-BP1e5MBV.d.mts} +2 -2
  165. package/dist/{types-D799eppJ.d.mts.map → types-BP1e5MBV.d.mts.map} +1 -1
  166. package/dist/{types-D6lgKhE5-Cu48rrw9.d.mts → types-D6lgKhE5-DYkeCAjr.d.mts} +2 -2
  167. package/dist/{types-D6lgKhE5-Cu48rrw9.d.mts.map → types-D6lgKhE5-DYkeCAjr.d.mts.map} +1 -1
  168. package/dist/types-Dnrjripb.d.mts +2 -0
  169. package/package.json +9 -9
  170. package/dist/check-expressions-CBIgoKhV-D7oTR8lp.d.mts.map +0 -1
  171. package/dist/check-expressions-Dlt334zg-CV5Vkh3G.mjs.map +0 -1
  172. package/dist/codec-descriptor-CZAGhM_O-DK9auM7J.mjs.map +0 -1
  173. package/dist/codec-helpers-D015Pvwa-DR7WMloQ.mjs.map +0 -1
  174. package/dist/codec-types-DQUtpepT.d.mts +0 -2
  175. package/dist/codecs-CvG9lv7r-9RlHwf9Y.d.mts.map +0 -1
  176. package/dist/codecs-DelwJv6h-CFbyTJIJ.mjs.map +0 -1
  177. package/dist/control-policy-bwcdB78Y-DgRaWAzu.mjs.map +0 -1
  178. package/dist/data-types-k3Ebk3kj-DWk3nh_k.mjs.map +0 -1
  179. package/dist/default-normalizer-CrMBHF0W-BaUR4Ec8.mjs.map +0 -1
  180. package/dist/op-factory-call-CqKUB1XP-CsEGx4Jd.d.mts.map +0 -1
  181. package/dist/op-factory-call-D5UJ7cDi.d.mts +0 -1
  182. package/dist/op-factory-call-DdXVWQlV-DzfLhTkh.mjs.map +0 -1
  183. package/dist/planner-CvUO8Zpn.d.mts.map +0 -1
  184. package/dist/planner-ZmK0aNuY-Cak-8zwa.mjs.map +0 -1
  185. package/dist/planner-produced-postgres-migration-BI_aepPp.d.mts +0 -1
  186. package/dist/planner-produced-postgres-migration-DT3i_p3G-CyQUv3ac.d.mts.map +0 -1
  187. package/dist/postgres-migration-UVh2xeV0-DW8V_8aj.mjs +0 -596
  188. package/dist/postgres-migration-UVh2xeV0-DW8V_8aj.mjs.map +0 -1
  189. package/dist/postgres-migration-e8UybR1y-C_m4i1jp.d.mts.map +0 -1
  190. package/dist/postgres-schema-AlEVkXXS-ZfXWYddl.mjs.map +0 -1
  191. package/dist/render-ops-D2vJApKB-B281fzmn.mjs.map +0 -1
  192. package/dist/types-CdJszzhP.d.mts +0 -2
@@ -1,20 +1,69 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { d as isPostgresSchema, i as PostgresRlsPolicy } from "./postgres-schema-AlEVkXXS-ZfXWYddl.mjs";
2
+ import { d as isPostgresSchema, i as PostgresRlsPolicy } from "./postgres-schema-COkaqci7-C6JpiSha.mjs";
3
3
  import { r as PostgresTableSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
4
4
  import { n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
5
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs";
6
- import { B as renameTableStatement, C as DropNativeEnumTypeCall, E as DropTableCall, M as RenameTableCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, j as RenamePostgresRlsPolicyCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from "./op-factory-call-DdXVWQlV-DzfLhTkh.mjs";
7
- import { a as planIssues, c as renderPostgresSuppression, d as resolvePostgresNodeIssueControlPolicySubject, f as resolvePostgresNodeIssueCreationFactoryName, i as issueSchemaName, l as resolveNamespaceIdForDdlSchema, n as conflictForDisallowedCall, o as postgresNodeStorageCoordinate, r as issueNode, s as postgresPlannerStrategies, t as coalesceSubtreeIssues, u as resolvePostgresCallControlPolicySubject } from "./control-policy-bwcdB78Y-DgRaWAzu.mjs";
8
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-zc7d2uxC-BVe8D7vG.mjs";
9
- import { a as plannedConstraintNameRenames, i as pairIndexRenames, n as emissionSchemaForNamespace, r as pairCheckRenames } from "./postgres-migration-UVh2xeV0-DW8V_8aj.mjs";
10
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs";
5
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DD69Bwve-e-BpAfFa.mjs";
6
+ import { A as RenameConstraintCall, C as DropNativeEnumTypeCall, E as DropTableCall, M as RenamePostgresRlsPolicyCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from "./op-factory-call-BbTtrII--CbCFZfSd.mjs";
7
+ import { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from "./default-constraint-names-CtcRXhV8-nz3ff6b8.mjs";
8
+ import { a as planIssues, c as renderPostgresSuppression, d as resolvePostgresNodeIssueControlPolicySubject, f as resolvePostgresNodeIssueCreationFactoryName, i as issueSchemaName, l as resolveNamespaceIdForDdlSchema, n as conflictForDisallowedCall, o as postgresNodeStorageCoordinate, r as issueNode, s as postgresPlannerStrategies, t as coalesceSubtreeIssues, u as resolvePostgresCallControlPolicySubject } from "./control-policy-DMOu5nnt-DslefUx9.mjs";
9
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-DgAMDjHF-YATlptWC.mjs";
10
+ import { a as postgresColumnRenameCall, c as postgresSchemaTables, d as renderRenameTableCall, i as pairIndexRenames, l as postgresTableRenameCall, n as createWorkingSchema, o as postgresContractToSchema, r as pairCheckRenames, u as renameTableByHandStatements } from "./postgres-migration-DmczQSHT-DsWlow8L.mjs";
11
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs";
11
12
  import { blindCast } from "@prisma/orm-framework/utils/casts";
12
13
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
13
14
  import { issueOutcome } from "@prisma/orm-framework/components/control";
14
15
  import { namingOf, parseWireName } from "@prisma/orm-family-sql/schema-ir/naming";
15
16
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
16
- import { controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, sqlTypeLookupsOf } from "@prisma/orm-family-sql/family/control";
17
- //#region ../../../3-targets/3-targets/postgres/dist/planner-ZmK0aNuY.mjs
17
+ import { controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, planStatements, plannerFailure, sqlTypeLookupsOf } from "@prisma/orm-family-sql/family/control";
18
+ import { ok } from "@prisma/orm-framework/utils/result";
19
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-_mo_t-l3.mjs
20
+ /** The constraint of `nextNodes` the diff pairs with `node` and finds unchanged. */
21
+ function unchangedIn(node, nextNodes) {
22
+ return nextNodes.find((next) => next.id === node.id && next.isEqualTo(node));
23
+ }
24
+ /**
25
+ * The renames of the primary key, unique constraints and foreign keys of one table that the end tree keeps otherwise unchanged but names differently. A constraint's name is its stated name, or the one the planner derives from its table; a start tree read from the database states every name. A constraint whose start and end names differ is renamed to the end name. The diff never compares constraint names, so without these the database keeps the old name. A database may already have the new name, as when Prisma 7 created it and the contract only now states it; the rename's postcheck then holds before it runs, and the runner skips it.
26
+ */
27
+ function constraintNameRenames(input) {
28
+ const { schemaName, from, to, previous, next } = input;
29
+ const rename = (kind, oldName, unchanged, derivedName) => {
30
+ if (unchanged === void 0) return [];
31
+ const newName = unchanged.name ?? derivedName;
32
+ return oldName === newName ? [] : [new RenameConstraintCall(schemaName, to, kind, oldName, newName)];
33
+ };
34
+ const primaryKey = previous.primaryKey === void 0 ? [] : rename("primaryKey", previous.primaryKey.name ?? defaultPrimaryKeyName(from), unchangedIn(previous.primaryKey, next.primaryKey === void 0 ? [] : [next.primaryKey]), defaultPrimaryKeyName(to));
35
+ const uniques = previous.uniques.flatMap((unique) => rename("unique", unique.name ?? defaultUniqueName(from, unique.columns), unchangedIn(unique, next.uniques), defaultUniqueName(to, unique.columns)));
36
+ const foreignKeys = previous.foreignKeys.flatMap((fk) => rename("foreignKey", fk.name ?? defaultForeignKeyName(from, fk.columns), unchangedIn(fk, next.foreignKeys), defaultForeignKeyName(to, fk.columns)));
37
+ return [
38
+ ...primaryKey,
39
+ ...uniques,
40
+ ...foreignKeys
41
+ ];
42
+ }
43
+ /**
44
+ * The constraint renames of a plan: {@link constraintNameRenames} for every table the start tree and the end contract both have, with the start tree as the plan's rename statements left it. The start tree comes from the start contract for `migration plan` and from the database for `db update`, so a database Prisma 8 created under derived names is renamed too once the contract states other names.
45
+ */
46
+ function plannedConstraintNameRenames(options) {
47
+ if (!options.policy.allowedOperationClasses.includes("widening")) return [];
48
+ PostgresDatabaseSchemaNode.assert(options.schema);
49
+ const startTablesBySchema = new Map(Object.values(options.schema.namespaces).map((namespace) => [namespace.schemaName, namespace.tables]));
50
+ const contract = options.contract;
51
+ const end = postgresContractToSchema(contract, options.frameworkComponents);
52
+ return Object.values(end.namespaces).flatMap((namespace) => {
53
+ const startTables = startTablesBySchema.get(namespace.schemaName) ?? {};
54
+ const schemaName = resolveNamespaceIdForDdlSchema(contract, namespace.schemaName) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : namespace.schemaName;
55
+ return Object.entries(namespace.tables).flatMap(([tableName, next]) => {
56
+ const previous = startTables[tableName];
57
+ return previous === void 0 ? [] : constraintNameRenames({
58
+ schemaName,
59
+ from: tableName,
60
+ to: tableName,
61
+ previous,
62
+ next
63
+ });
64
+ });
65
+ });
66
+ }
18
67
  /**
19
68
  * Resolves the live-database schema name for a given namespace
20
69
  * coordinate. Mirrors `resolveDdlSchemaForNamespace` in
@@ -144,9 +193,12 @@ var PostgresMigrationPlanner = class {
144
193
  const policyResult = this.ensureAdditivePolicy(options.policy);
145
194
  if (policyResult) return policyResult;
146
195
  PostgresDatabaseSchemaNode.assert(options.schema);
196
+ const statements = this.planStatements(options, options.schema);
197
+ if (!statements.ok) return plannerFailure([statements.failure]);
198
+ const { schema } = statements.value;
147
199
  const { issues: rawIssues } = buildPostgresPlanDiff({
148
200
  contract: options.contract,
149
- actualSchema: options.schema,
201
+ actualSchema: schema,
150
202
  frameworkComponents: options.frameworkComponents
151
203
  });
152
204
  const policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue));
@@ -156,7 +208,7 @@ var PostgresMigrationPlanner = class {
156
208
  const gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== "not-expected");
157
209
  const schemaIssues = [...verifyPostgresNamespacePresence({
158
210
  contract: options.contract,
159
- schema: options.schema
211
+ schema
160
212
  }), ...gated];
161
213
  const indexRenames = pairIndexRenames(options, schemaIssues);
162
214
  const checkRenames = pairCheckRenames(options, schemaIssues);
@@ -165,7 +217,7 @@ var PostgresMigrationPlanner = class {
165
217
  const codecHooks = extractCodecControlHooks(options.frameworkComponents);
166
218
  const types = sqlTypeLookupsOf(options.frameworkComponents);
167
219
  const storageTypes = options.contract.storage.types ?? {};
168
- const relationalSchema = relationalNamespaceNode(options.schema, schemaName);
220
+ const relationalSchema = relationalNamespaceNode(schema, schemaName);
169
221
  const issuePartition = partitionIssuesByControlPolicy({
170
222
  issues: plannableIssues,
171
223
  contract: options.contract,
@@ -179,8 +231,8 @@ var PostgresMigrationPlanner = class {
179
231
  return node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;
180
232
  },
181
233
  namespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),
182
- renameByHandStatements: (rename) => [renameTableStatement(emissionSchemaForNamespace(options.contract, rename.namespaceId), rename.from, rename.to)],
183
- renameTableCall: (rename) => new RenameTableCall(rename.namespaceId ?? UNBOUND_NAMESPACE_ID, rename.from, rename.to).renderTypeScript(),
234
+ renameByHandStatements: (rename) => renameTableByHandStatements(options.contract, rename),
235
+ renameTableCall: renderRenameTableCall,
184
236
  contract: options.contract,
185
237
  defaultNamespaceId: DEFAULT_NAMESPACE_ID
186
238
  });
@@ -203,16 +255,22 @@ var PostgresMigrationPlanner = class {
203
255
  const renamePartition = partitionPostgresCallsByControlPolicy([
204
256
  ...indexRenames.calls,
205
257
  ...checkRenames.calls,
206
- ...plannedConstraintNameRenames(options)
258
+ ...plannedConstraintNameRenames({
259
+ ...options,
260
+ schema
261
+ })
207
262
  ], options.contract);
208
263
  const schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);
209
264
  const fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(planFieldEventOperations({
210
265
  priorContract: options.fromContract,
211
266
  newContract: options.contract,
212
- codecHooks
267
+ codecHooks,
268
+ tableRenames: statements.value.tableRenames,
269
+ columnRenames: statements.value.columnRenames
213
270
  })), options.contract);
214
271
  const ordered = movePolicyDropsBeforeBlockedDdl(result.value.calls, schemaDiffPartition.kept);
215
272
  const calls = [
273
+ ...statements.value.calls,
216
274
  ...ordered.structural,
217
275
  ...renamePartition.kept,
218
276
  ...ordered.policyCalls,
@@ -234,9 +292,10 @@ var PostgresMigrationPlanner = class {
234
292
  return Object.freeze({
235
293
  kind: "success",
236
294
  plan: new TypeScriptRenderablePostgresMigration(calls, {
237
- from: options.fromContract?.storage.storageHash ?? null,
295
+ from: options.origin?.storageHash ?? null,
238
296
  to: options.contract.storage.storageHash
239
297
  }, options.spaceId, options.snapshotsImportPath, this.#lowerer),
298
+ appliedStatements: statements.value.appliedStatements,
240
299
  ...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}
241
300
  });
242
301
  }
@@ -246,7 +305,7 @@ var PostgresMigrationPlanner = class {
246
305
  * `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a
247
306
  * `not-equal` finding (an exact-named policy whose content drifted)
248
307
  * becomes drop + create, or a disallowed-call conflict when the policy
249
- * forbids the destructive drop. It
308
+ * forbids the drop, which is `widening`. It
250
309
  * does not re-diff — it consumes exactly the policy-node subset of the
251
310
  * shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE
252
311
  * ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`
@@ -264,12 +323,11 @@ var PostgresMigrationPlanner = class {
264
323
  * The pairing runs only when the policy allows `widening` (rename's
265
324
  * class). Without it (db-init's additive-only set), pairing degrades
266
325
  * deliberately to the additive half: the new name is CREATEd and the old
267
- * policy survives live until a widening/destructive-allowed plan runs —
326
+ * policy survives live until a plan that allows `widening` runs —
268
327
  * emitting an ungated widening rename would only fail at the runner's
269
328
  * class re-enforcement.
270
329
  */
271
330
  planPostgresSchemaDiff(options, filteredDiffIssues) {
272
- const allowsDestructive = options.policy.allowedOperationClasses.includes("destructive");
273
331
  const allowsWidening = options.policy.allowedOperationClasses.includes("widening");
274
332
  const missing = [];
275
333
  const extra = [];
@@ -359,7 +417,7 @@ var PostgresMigrationPlanner = class {
359
417
  if (renamedMissing.has(finding)) continue;
360
418
  calls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));
361
419
  }
362
- if (allowsDestructive) for (const finding of extra) {
420
+ if (allowsWidening) for (const finding of extra) {
363
421
  if (renamedExtras.has(finding)) continue;
364
422
  calls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));
365
423
  }
@@ -369,6 +427,42 @@ var PostgresMigrationPlanner = class {
369
427
  suppressions
370
428
  };
371
429
  }
430
+ /**
431
+ * Plans the statements against a working copy of `schema`, in order, so each rename's companions
432
+ * are computed against the schema the earlier statements left. The diff then runs on that schema.
433
+ */
434
+ planStatements(options, schema) {
435
+ const working = createWorkingSchema(schema);
436
+ const planned = planStatements({
437
+ statements: options.statements,
438
+ fromContract: options.fromContract,
439
+ contract: options.contract,
440
+ policy: options.policy,
441
+ target: {
442
+ tables: () => postgresSchemaTables(working.current, options.contract),
443
+ renameTableCall: (rename) => postgresTableRenameCall({
444
+ previous: working.current,
445
+ contract: options.contract,
446
+ rename,
447
+ frameworkComponents: options.frameworkComponents
448
+ }),
449
+ renameColumnCall: (rename) => postgresColumnRenameCall({
450
+ previous: working.current,
451
+ contract: options.contract,
452
+ rename,
453
+ frameworkComponents: options.frameworkComponents
454
+ }),
455
+ apply: (call) => working.apply(call),
456
+ renderTableRename: renderRenameTableCall,
457
+ tableRenameByHand: (rename) => renameTableByHandStatements(options.contract, rename)
458
+ }
459
+ });
460
+ if (!planned.ok) return planned;
461
+ return ok({
462
+ ...planned.value,
463
+ schema: working.current
464
+ });
465
+ }
372
466
  ensureAdditivePolicy(policy) {
373
467
  if (!policy.allowedOperationClasses.includes("additive")) return plannerFailure([{
374
468
  kind: "unsupportedOperation",
@@ -505,7 +599,7 @@ function gradePolicyReplacement(replacement, contract, allowedOperationClasses)
505
599
  createsNewObject: false
506
600
  }
507
601
  };
508
- if (!allowedOperationClasses.includes("destructive")) return {
602
+ if (!allowedOperationClasses.includes("widening")) return {
509
603
  disposition: "conflict",
510
604
  conflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)
511
605
  };
@@ -535,4 +629,4 @@ function policyNodeToContractPolicy(node) {
535
629
  //#endregion
536
630
  export { createPostgresMigrationPlanner as t };
537
631
 
538
- //# sourceMappingURL=planner-ZmK0aNuY-Cak-8zwa.mjs.map
632
+ //# sourceMappingURL=planner-_mo_t-l3-DPAQVG1x.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-_mo_t-l3-DPAQVG1x.mjs","names":["#lowerer"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-_mo_t-l3.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { _ as PostgresRlsPolicy, r as isPostgresSchema } from \"./postgres-schema-COkaqci7.mjs\";\nimport { t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-DD69Bwve.mjs\";\nimport { t as buildPostgresPlanDiff } from \"./diff-database-schema-DgAMDjHF.mjs\";\nimport { a as resolvePostgresNodeIssueCreationFactoryName, c as issueNode, d as postgresPlannerStrategies, f as postgresNodeStorageCoordinate, i as resolvePostgresNodeIssueControlPolicySubject, l as issueSchemaName, n as resolveNamespaceIdForDdlSchema, o as coalesceSubtreeIssues, r as resolvePostgresCallControlPolicySubject, s as conflictForDisallowedCall, t as renderPostgresSuppression, u as planIssues } from \"./control-policy-DMOu5nnt.mjs\";\nimport { A as RenameConstraintCall, C as DropNativeEnumTypeCall, E as DropTableCall, M as RenamePostgresRlsPolicyCall, O as RawSqlCall, T as DropPostgresRlsPolicyCall, l as AlterColumnTypeCall, p as CreatePostgresRlsPolicyCall, y as DropColumnCall } from \"./op-factory-call-BbTtrII-.mjs\";\nimport { n as defaultPrimaryKeyName, r as defaultUniqueName, t as defaultForeignKeyName } from \"./default-constraint-names-CtcRXhV8.mjs\";\nimport { a as renderRenameTableCall, c as pairCheckRenames, i as renameTableByHandStatements, l as pairIndexRenames, n as postgresColumnRenameCall, o as createWorkingSchema, r as postgresTableRenameCall, s as postgresSchemaTables, u as postgresContractToSchema } from \"./postgres-migration-DmczQSHT.mjs\";\nimport { t as TypeScriptRenderablePostgresMigration } from \"./planner-produced-postgres-migration-BdWg8TP2.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { controlPolicyForCall, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, planStatements, plannerFailure, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { namingOf, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/constraint-name-renames.ts\n/** The constraint of `nextNodes` the diff pairs with `node` and finds unchanged. */\nfunction unchangedIn(node, nextNodes) {\n\treturn nextNodes.find((next) => next.id === node.id && next.isEqualTo(node));\n}\n/**\n* The renames of the primary key, unique constraints and foreign keys of one table that the end tree keeps otherwise unchanged but names differently. A constraint's name is its stated name, or the one the planner derives from its table; a start tree read from the database states every name. A constraint whose start and end names differ is renamed to the end name. The diff never compares constraint names, so without these the database keeps the old name. A database may already have the new name, as when Prisma 7 created it and the contract only now states it; the rename's postcheck then holds before it runs, and the runner skips it.\n*/\nfunction constraintNameRenames(input) {\n\tconst { schemaName, from, to, previous, next } = input;\n\tconst rename = (kind, oldName, unchanged, derivedName) => {\n\t\tif (unchanged === void 0) return [];\n\t\tconst newName = unchanged.name ?? derivedName;\n\t\treturn oldName === newName ? [] : [new RenameConstraintCall(schemaName, to, kind, oldName, newName)];\n\t};\n\tconst primaryKey = previous.primaryKey === void 0 ? [] : rename(\"primaryKey\", previous.primaryKey.name ?? defaultPrimaryKeyName(from), unchangedIn(previous.primaryKey, next.primaryKey === void 0 ? [] : [next.primaryKey]), defaultPrimaryKeyName(to));\n\tconst uniques = previous.uniques.flatMap((unique) => rename(\"unique\", unique.name ?? defaultUniqueName(from, unique.columns), unchangedIn(unique, next.uniques), defaultUniqueName(to, unique.columns)));\n\tconst foreignKeys = previous.foreignKeys.flatMap((fk) => rename(\"foreignKey\", fk.name ?? defaultForeignKeyName(from, fk.columns), unchangedIn(fk, next.foreignKeys), defaultForeignKeyName(to, fk.columns)));\n\treturn [\n\t\t...primaryKey,\n\t\t...uniques,\n\t\t...foreignKeys\n\t];\n}\n/**\n* The constraint renames of a plan: {@link constraintNameRenames} for every table the start tree and the end contract both have, with the start tree as the plan's rename statements left it. The start tree comes from the start contract for `migration plan` and from the database for `db update`, so a database Prisma 8 created under derived names is renamed too once the contract states other names.\n*/\nfunction plannedConstraintNameRenames(options) {\n\tif (!options.policy.allowedOperationClasses.includes(\"widening\")) return [];\n\tPostgresDatabaseSchemaNode.assert(options.schema);\n\tconst startTablesBySchema = new Map(Object.values(options.schema.namespaces).map((namespace) => [namespace.schemaName, namespace.tables]));\n\tconst contract = options.contract;\n\tconst end = postgresContractToSchema(contract, options.frameworkComponents);\n\treturn Object.values(end.namespaces).flatMap((namespace) => {\n\t\tconst startTables = startTablesBySchema.get(namespace.schemaName) ?? {};\n\t\tconst schemaName = resolveNamespaceIdForDdlSchema(contract, namespace.schemaName) === UNBOUND_NAMESPACE_ID ? UNBOUND_NAMESPACE_ID : namespace.schemaName;\n\t\treturn Object.entries(namespace.tables).flatMap(([tableName, next]) => {\n\t\t\tconst previous = startTables[tableName];\n\t\t\treturn previous === void 0 ? [] : constraintNameRenames({\n\t\t\t\tschemaName,\n\t\t\t\tfrom: tableName,\n\t\t\t\tto: tableName,\n\t\t\t\tprevious,\n\t\t\t\tnext\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\n//#region src/core/migrations/verify-postgres-namespaces.ts\n/**\n* Resolves the live-database schema name for a given namespace\n* coordinate. Mirrors `resolveDdlSchemaForNamespace` in\n* `planner-strategies.ts` so the verifier's projection and the\n* planner's projection always agree — Postgres-aware namespaces (the\n* production path) dispatch to `ddlSchemaName(storage)`, and bare\n* object payloads (used by some tests) fall back to the coordinate\n* itself.\n*/\nfunction resolveDdlSchemaName(storage, namespaceId) {\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n/**\n* Reads the introspected list of schema names from the database-root schema\n* node. `existingSchemas` is database-level, so it lives on the\n* `PostgresDatabaseSchemaNode` root — not on the per-schema namespace nodes.\n*\n* Defaults to the always-present `public` schema when the node is not the\n* database root — a fresh Postgres database always carries `public` (unless an\n* operator dropped it manually), so any verifier path that runs without an\n* enriched introspection still suppresses the redundant `CREATE SCHEMA\n* \"public\"`.\n*\n* Production introspection (`PostgresControlAdapter.introspect`) is the\n* authoritative source: it queries `pg_namespace` and sets `existingSchemas`\n* on the returned root. Tests that want to assert against a richer initial\n* state construct a `PostgresDatabaseSchemaNode` explicitly.\n*/\nfunction existingSchemasFromSchema(schema) {\n\tif (PostgresDatabaseSchemaNode.is(schema)) return schema.existingSchemas;\n\treturn [DEFAULT_NAMESPACE_ID];\n}\n/**\n* Emits a `postgres-namespace` `not-found` diff issue for every\n* contract-declared Postgres namespace whose live container does not yet\n* exist. The planner prepends these (node-typed, synthesized) to the\n* relational diff issues so a multi-schema plan emits `CREATE SCHEMA`\n* before the tables that need it — a planner-only concern (verify already\n* rejects via the `not-found` table issues a missing schema already\n* produces), so this is not part of the shared diff.\n*\n* A namespace's live container is the schema returned by its\n* polymorphic `ddlSchemaName(storage)` method — named schemas resolve\n* to their own id; the unbound singleton returns `UNBOUND_NAMESPACE_ID`\n* and is skipped explicitly (late-bound namespaces have no fixed DDL\n* schema). Issues are emitted only when the resolved name is a real,\n* creatable schema (not the unbound sentinel) and is missing from the\n* introspected list. `public` is suppressed implicitly because the\n* introspection (or its sensible default) always carries it.\n*\n* Each emitted issue's path is `['database', ddlName]` — an ancestor of\n* every table path under that schema, so it must never be run through\n* `coalesceSubtreeIssues` alongside the table diff (it would swallow the\n* table-level `not-found` issues that drive `CREATE TABLE`); the planner\n* adds these AFTER coalescing the relational issues, and they are not\n* subject to sibling-space ownership scoping (mirrors the retired\n* coordinate walk, which prepended namespace issues after that filter).\n*/\nfunction verifyPostgresNamespacePresence(input) {\n\tconst { contract, schema } = input;\n\tconst existing = new Set(existingSchemasFromSchema(schema));\n\tconst issues = [];\n\tconst namespaceIds = Object.keys(contract.storage.namespaces).sort();\n\tfor (const namespaceId of namespaceIds) {\n\t\tif (namespaceId === UNBOUND_NAMESPACE_ID) continue;\n\t\tconst ddlName = resolveDdlSchemaName(contract.storage, namespaceId);\n\t\tif (ddlName === UNBOUND_NAMESPACE_ID) continue;\n\t\tif (existing.has(ddlName)) continue;\n\t\tconst namespace = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlName,\n\t\t\ttables: {}\n\t\t});\n\t\tissues.push({\n\t\t\tpath: [\"database\", ddlName],\n\t\t\texpected: namespace\n\t\t});\n\t}\n\treturn issues;\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction partitionPostgresCallsByControlPolicy(calls, contract) {\n\treturn partitionCallsByControlPolicy({\n\t\tcalls,\n\t\tcontract,\n\t\tresolveControlPolicySubject: (call) => resolvePostgresCallControlPolicySubject(call, contract),\n\t\tresolveFactoryName: (call) => call.factoryName\n\t});\n}\nfunction createPostgresMigrationPlanner(lowerer) {\n\treturn new PostgresMigrationPlanner(lowerer);\n}\n/**\n* Postgres migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the target contract against the live schema via the one\n* differ (`buildPostgresPlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the unified `postgresPlannerStrategies`\n* list: NOT-NULL backfill, type-change, nullable-tightening, codec-hook\n* storage types, component-declared dependency installs, and\n* shared-temp-default / empty-table-guarded NOT-NULL add-column. The same\n* strategy list runs for `migration plan`, `db update`, and `db init`;\n* behavior diverges purely on `policy.allowedOperationClasses` (the\n* data-safe strategies short-circuit when `'data'` is excluded). The issue\n* planner applies operation-class policy gates and emits a single\n* `PostgresOpFactoryCall[]` that drives both the runtime-ops view (via\n* `renderOps`) and the `renderTypeScript()` authoring surface. RLS policy\n* drift (the structural half of the same one-differ tree) is handled\n* separately via `planPostgresSchemaDiff`.\n*/\nvar PostgresMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(blindCast(options));\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderablePostgresMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst schemaName = options.schemaName ?? Object.keys(options.contract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tPostgresDatabaseSchemaNode.assert(options.schema);\n\t\tconst statements = this.planStatements(options, options.schema);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { schema } = statements.value;\n\t\tconst { issues: rawIssues } = buildPostgresPlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst policyDiffIssues = rawIssues.filter((issue) => isPolicyDiffIssue(issue));\n\t\tconst relationalDiffIssues = rawIssues.filter((issue) => !isPolicyDiffIssue(issue));\n\t\tconst strict = options.policy.allowedOperationClasses.includes(\"widening\") || options.policy.allowedOperationClasses.includes(\"destructive\");\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(relationalDiffIssues), options.ownership, options.contract);\n\t\tconst gated = strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\");\n\t\tconst schemaIssues = [...verifyPostgresNamespacePresence({\n\t\t\tcontract: options.contract,\n\t\t\tschema\n\t\t}), ...gated];\n\t\tconst indexRenames = pairIndexRenames(options, schemaIssues);\n\t\tconst checkRenames = pairCheckRenames(options, schemaIssues);\n\t\tconst renameConsumed = /* @__PURE__ */ new Set([...indexRenames.consumed, ...checkRenames.consumed]);\n\t\tconst plannableIssues = renameConsumed.size === 0 ? schemaIssues : schemaIssues.filter((issue) => !renameConsumed.has(issue));\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst types = sqlTypeLookupsOf(options.frameworkComponents);\n\t\tconst storageTypes = options.contract.storage.types ?? {};\n\t\tconst relationalSchema = relationalNamespaceNode(schema, schemaName);\n\t\tconst issuePartition = partitionIssuesByControlPolicy({\n\t\t\tissues: plannableIssues,\n\t\t\tcontract: options.contract,\n\t\t\tresolveControlPolicySubject: (issue) => resolvePostgresNodeIssueControlPolicySubject(issue, options.contract),\n\t\t\tresolveCreationFactoryName: resolvePostgresNodeIssueCreationFactoryName\n\t\t});\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node !== void 0 && PostgresTableSchemaNode.is(node) ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: (issue) => resolveNamespaceIdForDdlSchema(options.contract, issueSchemaName(issue) ?? schemaName),\n\t\t\trenameByHandStatements: (rename) => renameTableByHandStatements(options.contract, rename),\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst result = planIssues({\n\t\t\tissues: issuePartition.plannable,\n\t\t\ttoContract: options.contract,\n\t\t\tfromContract: options.fromContract,\n\t\t\tschemaName,\n\t\t\tcodecHooks,\n\t\t\ttypes,\n\t\t\tstorageTypes,\n\t\t\t...ifDefined(\"schema\", relationalSchema),\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstrategies: postgresPlannerStrategies\n\t\t});\n\t\tconst schemaDiff = this.planPostgresSchemaDiff(options, policyDiffIssues);\n\t\tif (!result.ok || schemaDiff.conflicts.length > 0) return plannerFailure([...result.ok ? [] : result.failure, ...schemaDiff.conflicts]);\n\t\tconst renamePartition = partitionPostgresCallsByControlPolicy([\n\t\t\t...indexRenames.calls,\n\t\t\t...checkRenames.calls,\n\t\t\t...plannedConstraintNameRenames({\n\t\t\t\t...options,\n\t\t\t\tschema\n\t\t\t})\n\t\t], options.contract);\n\t\tconst schemaDiffPartition = partitionPostgresCallsByControlPolicy(schemaDiff.calls, options.contract);\n\t\tconst fieldEventPartition = partitionPostgresCallsByControlPolicy(blindCast(planFieldEventOperations({\n\t\t\tpriorContract: options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames\n\t\t})), options.contract);\n\t\tconst ordered = movePolicyDropsBeforeBlockedDdl(result.value.calls, schemaDiffPartition.kept);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...ordered.structural,\n\t\t\t...renamePartition.kept,\n\t\t\t...ordered.policyCalls,\n\t\t\t...fieldEventPartition.kept\n\t\t];\n\t\tconst seenWarnings = /* @__PURE__ */ new Set();\n\t\tconst warnings = [\n\t\t\t...issuePartition.suppressions,\n\t\t\t...renamePartition.suppressions,\n\t\t\t...schemaDiff.suppressions,\n\t\t\t...schemaDiffPartition.suppressions,\n\t\t\t...fieldEventPartition.suppressions\n\t\t].map((record) => renderPostgresSuppression(record, options.contract)).filter((warning) => {\n\t\t\tconst key = JSON.stringify(warning);\n\t\t\tif (seenWarnings.has(key)) return false;\n\t\t\tseenWarnings.add(key);\n\t\t\treturn true;\n\t\t});\n\t\treturn Object.freeze({\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderablePostgresMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, this.#lowerer),\n\t\t\tappliedStatements: statements.value.appliedStatements,\n\t\t\t...warnings.length > 0 ? { warnings: Object.freeze(warnings) } : {}\n\t\t});\n\t}\n\t/**\n\t* Maps the RLS policy findings of the one combined tree diff\n\t* (`buildPostgresPlanDiff`, already ownership-filtered) into\n\t* `CREATE POLICY` / `DROP POLICY` / `ALTER POLICY … RENAME TO` ops — a\n\t* `not-equal` finding (an exact-named policy whose content drifted)\n\t* becomes drop + create, or a disallowed-call conflict when the policy\n\t* forbids the drop, which is `widening`. It\n\t* does not re-diff — it consumes exactly the policy-node subset of the\n\t* shared diff's issues. Enablement is NOT decided here: `ENABLE`/`DISABLE\n\t* ROW LEVEL SECURITY` derive from the table's marker-driven `rlsEnabled`\n\t* attribute diff on the relational side.\n\t*\n\t* Rename post-pass (the index pass's structure): hash pairing pairs a\n\t* `not-found` and a `not-expected` policy on the SAME table whose\n\t* wire-name content hashes match but prefixes differ (prefix-only rename);\n\t* content pairing then pairs remaining wire-named-missing policies against remaining\n\t* extras of any name shape by verbatim content (the node-owned `contentEquals` —\n\t* exact→wire adoption). Multi-candidate groups pair deterministically\n\t* by sorted name; leftovers proceed as create/drop; an exact-named\n\t* missing policy never content-pairs.\n\t*\n\t* The pairing runs only when the policy allows `widening` (rename's\n\t* class). Without it (db-init's additive-only set), pairing degrades\n\t* deliberately to the additive half: the new name is CREATEd and the old\n\t* policy survives live until a plan that allows `widening` runs —\n\t* emitting an ungated widening rename would only fail at the runner's\n\t* class re-enforcement.\n\t*/\n\tplanPostgresSchemaDiff(options, filteredDiffIssues) {\n\t\tconst allowsWidening = options.policy.allowedOperationClasses.includes(\"widening\");\n\t\tconst missing = [];\n\t\tconst extra = [];\n\t\tconst changed = [];\n\t\tfor (const issue of filteredDiffIssues) if (issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tchanged.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-found\") {\n\t\t\tconst expected = issue.expected;\n\t\t\tPostgresPolicySchemaNode.assert(expected);\n\t\t\tmissing.push({\n\t\t\t\tnode: expected,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, expected.namespaceId)\n\t\t\t});\n\t\t} else if (issueOutcome(issue) === \"not-expected\") {\n\t\t\tconst actual = issue.actual;\n\t\t\tPostgresPolicySchemaNode.assert(actual);\n\t\t\textra.push({\n\t\t\t\tnode: actual,\n\t\t\t\tschemaForTable: resolveDdlSchemaForNamespaceStorage(options.contract.storage, actual.namespaceId)\n\t\t\t});\n\t\t}\n\t\tconst calls = [];\n\t\tconst conflicts = [];\n\t\tconst suppressions = [];\n\t\tconst renamedExtras = /* @__PURE__ */ new Set();\n\t\tconst renamedMissing = /* @__PURE__ */ new Set();\n\t\tconst pairingKey = (finding, hash) => JSON.stringify([\n\t\t\tfinding.schemaForTable,\n\t\t\tfinding.node.tableName,\n\t\t\thash\n\t\t]);\n\t\tif (allowsWidening) {\n\t\t\tconst extrasByGroup = /* @__PURE__ */ new Map();\n\t\t\tfor (const finding of extra) {\n\t\t\t\tconst parsed = parseWireName(finding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst key = pairingKey(finding, parsed.hash);\n\t\t\t\tconst group = extrasByGroup.get(key) ?? [];\n\t\t\t\tgroup.push(finding);\n\t\t\t\textrasByGroup.set(key, group);\n\t\t\t}\n\t\t\tfor (const group of extrasByGroup.values()) group.sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tconst sortedMissing = [...missing].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tconst parsed = parseWireName(missingFinding.node.name);\n\t\t\t\tif (parsed === void 0) continue;\n\t\t\t\tconst candidate = extrasByGroup.get(pairingKey(missingFinding, parsed.hash))?.shift();\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t\tconst sortedExtras = [...extra].sort((a, b) => a.node.name < b.node.name ? -1 : a.node.name > b.node.name ? 1 : 0);\n\t\t\tfor (const missingFinding of sortedMissing) {\n\t\t\t\tif (renamedMissing.has(missingFinding)) continue;\n\t\t\t\tif (missingFinding.node.prefix === void 0) continue;\n\t\t\t\tconst candidate = sortedExtras.find((extraFinding) => !renamedExtras.has(extraFinding) && extraFinding.schemaForTable === missingFinding.schemaForTable && extraFinding.node.tableName === missingFinding.node.tableName && missingFinding.node.contentEquals(extraFinding.node));\n\t\t\t\tif (candidate === void 0) continue;\n\t\t\t\trenamedExtras.add(candidate);\n\t\t\t\trenamedMissing.add(missingFinding);\n\t\t\t\tcalls.push(new RenamePostgresRlsPolicyCall(missingFinding.schemaForTable, missingFinding.node.tableName, candidate.node.name, missingFinding.node.name));\n\t\t\t}\n\t\t}\n\t\tfor (const finding of changed) {\n\t\t\tconst replacement = {\n\t\t\t\tdrop: new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name),\n\t\t\t\tcreate: new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node))\n\t\t\t};\n\t\t\tconst graded = gradePolicyReplacement(replacement, options.contract, options.policy.allowedOperationClasses);\n\t\t\tif (graded.disposition === \"suppress\") {\n\t\t\t\tsuppressions.push(graded.record);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (graded.disposition === \"conflict\") {\n\t\t\t\tconflicts.push(graded.conflict);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcalls.push(replacement.drop);\n\t\t\tcalls.push(replacement.create);\n\t\t}\n\t\tfor (const finding of missing) {\n\t\t\tif (renamedMissing.has(finding)) continue;\n\t\t\tcalls.push(new CreatePostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, policyNodeToContractPolicy(finding.node)));\n\t\t}\n\t\tif (allowsWidening) for (const finding of extra) {\n\t\t\tif (renamedExtras.has(finding)) continue;\n\t\t\tcalls.push(new DropPostgresRlsPolicyCall(finding.schemaForTable, finding.node.tableName, finding.node.name));\n\t\t}\n\t\treturn {\n\t\t\tcalls,\n\t\t\tconflicts,\n\t\t\tsuppressions\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of `schema`, in order, so each rename's companions\n\t* are computed against the schema the earlier statements left. The diff then runs on that schema.\n\t*/\n\tplanStatements(options, schema) {\n\t\tconst working = createWorkingSchema(schema);\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => postgresSchemaTables(working.current, options.contract),\n\t\t\t\trenameTableCall: (rename) => postgresTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => postgresColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\trenderTableRename: renderRenameTableCall,\n\t\t\t\ttableRenameByHand: (rename) => renameTableByHandStatements(options.contract, rename)\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\n\t\t});\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n};\n/**\n* A diff issue whose node is an RLS policy — the structural half of the one\n* combined tree diff, routed to `planPostgresSchemaDiff` instead of\n* `planIssues`.\n*/\nfunction isPolicyDiffIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && PostgresPolicySchemaNode.is(node);\n}\n/**\n* Postgres refuses these statements while a policy uses the object they touch:\n* - dropping a column (2BP01) or changing its type (0A000);\n* - dropping a table that a policy on another table uses (2BP01); a table's own policies go with it;\n* - dropping a native enum type (2BP01);\n* - a destructive codec type operation (a `RawSqlCall` on a type), such as dropping or rebuilding\n* the type (2BP01) or changing a composite type's attribute type (0A000). Additive and widening\n* type operations, such as adding an enum value or renaming the type, go through.\n*\n* So every policy drop moves to just before the first structural call that a policy can block.\n* Without such a call, the policy calls keep their place after the structural calls.\n*/\nfunction movePolicyDropsBeforeBlockedDdl(structural, policyCalls) {\n\tconst firstBlockable = structural.findIndex(policyCanBlock);\n\tif (firstBlockable === -1) return {\n\t\tstructural,\n\t\tpolicyCalls\n\t};\n\tconst isPolicyDrop = (call) => call instanceof DropPostgresRlsPolicyCall;\n\treturn {\n\t\tstructural: [\n\t\t\t...structural.slice(0, firstBlockable),\n\t\t\t...policyCalls.filter(isPolicyDrop),\n\t\t\t...structural.slice(firstBlockable)\n\t\t],\n\t\tpolicyCalls: policyCalls.filter((call) => !isPolicyDrop(call))\n\t};\n}\nfunction policyCanBlock(call) {\n\tif (call instanceof RawSqlCall) return call.operationClass === \"destructive\" && call.op.target.details?.objectType === \"type\";\n\treturn call instanceof DropColumnCall || call instanceof AlterColumnTypeCall || call instanceof DropTableCall || call instanceof DropNativeEnumTypeCall;\n}\n/**\n* Drops a `not-expected` issue when it is a whole extra storage entity (a table\n* or a native enum) that some space in the composition owns. Each such node\n* yields its own storage coordinate (see {@link postgresNodeStorageCoordinate}),\n* so `declaresEntity` answers over the whole composition on one uniform\n* coordinate: a positive answer means a sibling owns this entity here — leave\n* it; a negative answer means a genuine orphan — drop it. A node with no storage\n* coordinate (a namespace, or a deeper column/constraint drift on an owned\n* table) is this space's own and is always kept. No oracle ⇒ keep everything.\n*/\nfunction retainUnownedExtras(issues, ownership, contract) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0) return true;\n\t\tconst coordinate = postgresNodeStorageCoordinate(node);\n\t\tif (coordinate === void 0) return true;\n\t\tconst ddlSchemaName = issueSchemaName(issue);\n\t\tif (ddlSchemaName === void 0) return true;\n\t\tconst namespaceId = resolveNamespaceIdForDdlSchema(contract, ddlSchemaName);\n\t\treturn !ownership.declaresEntity({\n\t\t\tnamespaceId,\n\t\t\t...coordinate\n\t\t});\n\t});\n}\n/**\n* Returns the one namespace node the relational strategy layer probes for\n* live-table existence and reads codec-hook context off — the namespace\n* matching the planner's resolved schema name, or the first namespace when\n* none matches. `undefined` when the tree has no namespaces, so the strategy\n* context uses its empty-schema default.\n*\n* The relational strategies key tables by bare name, so they can only probe one\n* namespace at a time; probing across every namespace at once is future work.\n*\n* Returns the real `PostgresNamespaceSchemaNode` reference rather than a\n* projection: `storageTypePlanCallStrategy` hands this same value to codec\n* `planTypeOperations` hooks as `schema`, and hooks read the Postgres-specific\n* `nativeEnums` field off it (via `PostgresNamespaceSchemaNode.is`) to decide\n* whether a native enum type already exists — a projection that only copies\n* `tables` would silently drop that signal. `StrategyContext.schema`'s\n* declared type (`SqlSchemaIR`, shared with SQLite's flat shape) doesn't\n* capture this, so the return is `blindCast` the same way `namespaceSchemaNodes`\n* in the family's relational walk already treats a namespace node as a\n* structurally-`SqlSchemaIR`-shaped value.\n*/\nfunction relationalNamespaceNode(schema, schemaName) {\n\tconst namespaceNodes = Object.values(schema.namespaces);\n\tconst namespaceNode = namespaceNodes.find((node) => node.schemaName === schemaName) ?? namespaceNodes[0];\n\tif (namespaceNode === void 0) return void 0;\n\treturn blindCast(namespaceNode);\n}\n/**\n* Grades a {@link PolicyReplacement} as one unit against the table's\n* control policy, BEFORE the pair becomes calls or a conflict. This runs\n* ahead of `partitionCallsByControlPolicy`, which later re-grades the\n* surviving calls per-call — a no-op here, since only managed units\n* survive this grading.\n*\n* A replacement is deliberately STRICTER than the shared\n* `callAllowedUnderControlPolicy` rule: `tolerated` permits whole-object\n* creation, but a replacement's create is the second half of a repair of\n* an existing object, not a new object — so ANY non-managed control\n* (external, observed, tolerated) suppresses the whole unit. Drift on an\n* object the plan does not manage is reported, never repaired; the\n* suppression subject names the drifted policy (`rlsPolicy`) so the\n* report says which policy drifted, matching the conflict path's\n* `location.rlsPolicy`.\n*/\nfunction gradePolicyReplacement(replacement, contract, allowedOperationClasses) {\n\tconst subject = resolvePostgresCallControlPolicySubject(replacement.drop, contract);\n\tconst controlPolicy = controlPolicyForCall(subject, contract.defaultControlPolicy);\n\tif (controlPolicy !== \"managed\") return {\n\t\tdisposition: \"suppress\",\n\t\trecord: {\n\t\t\tsubject: subject === void 0 ? void 0 : {\n\t\t\t\t...subject,\n\t\t\t\trlsPolicy: replacement.drop.policyName\n\t\t\t},\n\t\t\tpolicy: controlPolicy,\n\t\t\tfactoryName: void 0,\n\t\t\tcreatesNewObject: false\n\t\t}\n\t};\n\tif (!allowedOperationClasses.includes(\"widening\")) return {\n\t\tdisposition: \"conflict\",\n\t\tconflict: conflictForDisallowedCall(replacement.drop, allowedOperationClasses)\n\t};\n\treturn { disposition: \"plan\" };\n}\n/**\n* Rebuilds the `PostgresRlsPolicy` contract entity `CreatePostgresRlsPolicyCall`\n* carries (its `renderTypeScript`/`createRlsPolicy` paths serialize the whole\n* entity, `namespaceId` included). This reconstructs rather than looking the\n* original up in the contract on purpose: the diff node's `namespaceId` is the\n* *resolved DDL schema* (set when the expected tree was built), which is the\n* value the emitted op must carry; the contract-stored entity holds the raw,\n* pre-resolution coordinate, so a lookup would change the migration output.\n*/\nfunction policyNodeToContractPolicy(node) {\n\treturn new PostgresRlsPolicy({\n\t\tnaming: namingOf(node.name, node.prefix),\n\t\ttableName: node.tableName,\n\t\tnamespaceId: node.namespaceId,\n\t\toperation: node.operation,\n\t\troles: [...node.roles],\n\t\tusing: node.using,\n\t\twithCheck: node.withCheck,\n\t\tpermissive: node.permissive\n\t});\n}\n//#endregion\nexport { createPostgresMigrationPlanner as t };\n\n//# sourceMappingURL=planner-_mo_t-l3.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,YAAY,MAAM,WAAW;CACrC,OAAO,UAAU,MAAM,SAAS,KAAK,OAAO,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAC5E;;;;AAIA,SAAS,sBAAsB,OAAO;CACrC,MAAM,EAAE,YAAY,MAAM,IAAI,UAAU,SAAS;CACjD,MAAM,UAAU,MAAM,SAAS,WAAW,gBAAgB;EACzD,IAAI,cAAc,KAAK,GAAG,OAAO,CAAC;EAClC,MAAM,UAAU,UAAU,QAAQ;EAClC,OAAO,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,qBAAqB,YAAY,IAAI,MAAM,SAAS,OAAO,CAAC;CACpG;CACA,MAAM,aAAa,SAAS,eAAe,KAAK,IAAI,CAAC,IAAI,OAAO,cAAc,SAAS,WAAW,QAAQ,sBAAsB,IAAI,GAAG,YAAY,SAAS,YAAY,KAAK,eAAe,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,GAAG,sBAAsB,EAAE,CAAC;CACvP,MAAM,UAAU,SAA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OAAO,EAAE,aAAa,OAAO;AAC9B;;;;;;;;;;AAUA,SAAS,2BAA2B,MAAM;CACzC,OAAO,IAAI,kBAAkB;EAC5B,QAAQ,SAAS,KAAK,MAAM,KAAK,MAAM;EACvC,WAAW,KAAK;EAChB,aAAa,KAAK;EAClB,WAAW,KAAK;EAChB,OAAO,CAAC,GAAG,KAAK,KAAK;EACrB,OAAO,KAAK;EACZ,WAAW,KAAK;EAChB,YAAY,KAAK;CAClB,CAAC;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { t as escapeLiteral } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
2
- import { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, _ as pgInt8, b as pgJsonb, c as pgDate, g as pgInt4, h as pgInt2, v as pgInterval, y as pgJson } from "./data-types-k3Ebk3kj-DWk3nh_k.mjs";
2
+ import { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, _ as pgInt8, b as pgJsonb, c as pgDate, g as pgInt4, h as pgInt2, v as pgInterval, y as pgJson } from "./data-types-DRkmmE9S-C5Q9oH4Q.mjs";
3
3
  import { dataTypeParams, renderSqlTypeName, sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-DRProi99.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-Y0_96xpe.mjs
5
5
  const SMALL = {
6
6
  serialType: "SMALLSERIAL",
7
7
  sequenceType: "smallint"
@@ -120,4 +120,4 @@ function renderArrayLiteralDefault(elements, baseTypeName, dataType) {
120
120
  //#endregion
121
121
  export { renderDefaultLiteral as a, postgresDateTimeDdlText as i, buildColumnTypeSql as n, isPostgresDateTimeDataType as r, autoincrementWidth as t };
122
122
 
123
- //# sourceMappingURL=planner-ddl-builders-DRProi99-D0K5ZiD0.mjs.map
123
+ //# sourceMappingURL=planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-ddl-builders-DRProi99-D0K5ZiD0.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-DRProi99.mjs"],"sourcesContent":["import { t as escapeLiteral } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, _ as pgInt8, b as pgJsonb, c as pgDate, g as pgInt4, h as pgInt2, v as pgInterval, y as pgJson } from \"./data-types-k3Ebk3kj.mjs\";\nimport { dataTypeParams, renderSqlTypeName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/autoincrement-widths.ts\nconst SMALL = {\n\tserialType: \"SMALLSERIAL\",\n\tsequenceType: \"smallint\"\n};\nconst REGULAR = {\n\tserialType: \"SERIAL\",\n\tsequenceType: \"integer\"\n};\nconst BIG = {\n\tserialType: \"BIGSERIAL\",\n\tsequenceType: \"bigint\"\n};\nconst WIDTH_BY_COLUMN_TYPE = /* @__PURE__ */ new Map([\n\t[\"int2\", SMALL],\n\t[\"smallint\", SMALL],\n\t[\"int4\", REGULAR],\n\t[\"integer\", REGULAR],\n\t[\"int8\", BIG],\n\t[\"bigint\", BIG]\n]);\n/** The autoincrement width of a column of `columnType`; `undefined` for a column that is not a scalar smallint, integer or bigint. */\nfunction autoincrementWidth(columnType) {\n\treturn WIDTH_BY_COLUMN_TYPE.get(columnType.toLowerCase());\n}\nconst WIDTH_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[pgInt2.id, SMALL],\n\t[pgInt4.id, REGULAR],\n\t[pgInt8.id, BIG]\n]);\n/** The autoincrement width of a column whose data type is `dataTypeId`; `undefined` unless it is `pg/int2`, `pg/int4` or `pg/int8`. */\nfunction autoincrementWidthOfDataType(dataTypeId) {\n\treturn WIDTH_BY_DATA_TYPE.get(dataTypeId);\n}\n//#endregion\n//#region src/core/date-time-ddl-text.ts\nconst DATE_TIME_TYPES = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgInterval.id\n]);\nconst TYPES_WITH_A_YEAR = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id\n]);\n/** Whether a data type is one of this target's date and time types, whose defaults DDL writes as text. */\nfunction isPostgresDateTimeDataType(dataTypeId) {\n\treturn dataTypeId !== void 0 && DATE_TIME_TYPES.has(dataTypeId);\n}\n/**\n* The text DDL writes for a default of a date or time type, from its canonical form (ADR 254). A\n* year from 1 to 9999 stays as it is. PostgreSQL has no year 0 and reads no signed year, so a later\n* year loses its sign and leading zeros (`10000-01-01`) and a year at or before 0 is written as the\n* year before Christ (`0044-03-15 BC`). Every Postgres DDL path writes a date or time default\n* through this function.\n*/\nfunction postgresDateTimeDdlText(canonical, dataTypeId) {\n\tif (dataTypeId === void 0 || !TYPES_WITH_A_YEAR.has(dataTypeId)) return canonical;\n\tconst match = /^([+-]\\d{6}|\\d{4})(-.*)$/.exec(canonical);\n\tif (match === null) return canonical;\n\tconst [, yearDigits = \"\", rest = \"\"] = match;\n\tconst year = Number(yearDigits);\n\tif (year >= 1 && year <= 9999) return canonical;\n\tif (year > 9999) return `${year}${rest}`;\n\treturn `${String(1 - year).padStart(4, \"0\")}${rest} BC`;\n}\n//#endregion\n//#region src/core/migrations/planner-ddl-builders.ts\nconst JSON_DATA_TYPES = /* @__PURE__ */ new Set([pgJson.id, pgJsonb.id]);\n/**\n* Renders the SQL type for a column in DDL context: the name its codec's data type is written\n* with, and its parameters. A `typeRef` column is written as a column of the referenced type.\n*\n* @param allowPseudoTypes - When true (default), autoincrement integer columns\n* produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts\n* like ALTER COLUMN TYPE where pseudo-types are invalid.\n*/\nfunction buildColumnTypeSql(column, types, storageTypes = {}, allowPseudoTypes = true) {\n\tconst resolved = (column.typeRef === void 0 ? void 0 : storageTypes[column.typeRef]) ?? column;\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tif (allowPseudoTypes && isAutoincrement(column.default)) {\n\t\tconst width = autoincrementWidthOfDataType(dataType.id);\n\t\tif (width !== void 0) return width.serialType;\n\t}\n\tconst typeSql = renderSqlTypeName(dataType, dataTypeParams(dataType, resolved.typeParams));\n\treturn column.many ? `${typeSql}[]` : typeSql;\n}\nfunction isAutoincrement(columnDefault) {\n\treturn columnDefault?.kind === \"function\" && columnDefault.expression === \"autoincrement()\";\n}\nfunction renderDefaultLiteral(value, column) {\n\tif (column?.many && Array.isArray(value)) return renderArrayLiteralDefault(value, column.baseTypeName, column.dataType);\n\tif (column !== void 0 && JSON_DATA_TYPES.has(column.dataType) && typeof value === \"object\" && value !== null && !(value instanceof Date)) return `'${escapeLiteral(JSON.stringify(value))}'::${column.baseTypeName}`;\n\treturn renderScalarLiteral(value, column?.dataType);\n}\n/** A date or time value is written through the one function every DDL path uses for it. */\nfunction renderScalarLiteral(value, dataType) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(postgresDateTimeDdlText(value, dataType))}'`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\n/**\n* An `ARRAY[...]` of quoted elements has type `text[]`, which Postgres does not assign to a list of\n* numbers, decimals, timestamps or enums, so the constructor is cast to the list type. Each element\n* is the text Postgres reads for its type: an `int8` or `numeric` value as decimal text, a date or\n* time value in its type's canonical form. The cast is `baseTypeName` with `[]` appended unless it\n* already ends in `[]`; the name is not quoted here.\n*/\nfunction renderArrayLiteralDefault(elements, baseTypeName, dataType) {\n\tif (elements.length === 0) return \"'{}'\";\n\tconst rendered = `ARRAY[${elements.map((el) => renderScalarLiteral(el, dataType)).join(\", \")}]`;\n\tif (baseTypeName === \"\") return rendered;\n\treturn `${rendered}::${baseTypeName.endsWith(\"[]\") ? baseTypeName : `${baseTypeName}[]`}`;\n}\n//#endregion\nexport { autoincrementWidth as a, postgresDateTimeDdlText as i, renderDefaultLiteral as n, isPostgresDateTimeDataType as r, buildColumnTypeSql as t };\n\n//# sourceMappingURL=planner-ddl-builders-DRProi99.mjs.map"],"mappings":";;;;AAIA,MAAM,QAAQ;CACb,YAAY;CACZ,cAAc;AACf;AACA,MAAM,UAAU;CACf,YAAY;CACZ,cAAc;AACf;AACA,MAAM,MAAM;CACX,YAAY;CACZ,cAAc;AACf;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,QAAQ,KAAK;CACd,CAAC,YAAY,KAAK;CAClB,CAAC,QAAQ,OAAO;CAChB,CAAC,WAAW,OAAO;CACnB,CAAC,QAAQ,GAAG;CACZ,CAAC,UAAU,GAAG;AACf,CAAC;;AAED,SAAS,mBAAmB,YAAY;CACvC,OAAO,qBAAqB,IAAI,WAAW,YAAY,CAAC;AACzD;AACA,MAAM,qCAAqC,IAAI,IAAI;CAClD,CAAC,OAAO,IAAI,KAAK;CACjB,CAAC,OAAO,IAAI,OAAO;CACnB,CAAC,OAAO,IAAI,GAAG;AAChB,CAAC;;AAED,SAAS,6BAA6B,YAAY;CACjD,OAAO,mBAAmB,IAAI,UAAU;AACzC;AAGA,MAAM,kCAAkC,IAAI,IAAI;CAC/C,OAAO;CACP,OAAO;CACP,SAAS;CACT,YAAY;CACZ,cAAc;CACd,WAAW;AACZ,CAAC;AACD,MAAM,oCAAoC,IAAI,IAAI;CACjD,OAAO;CACP,YAAY;CACZ,cAAc;AACf,CAAC;;AAED,SAAS,2BAA2B,YAAY;CAC/C,OAAO,eAAe,KAAK,KAAK,gBAAgB,IAAI,UAAU;AAC/D;;;;;;;;AAQA,SAAS,wBAAwB,WAAW,YAAY;CACvD,IAAI,eAAe,KAAK,KAAK,CAAC,kBAAkB,IAAI,UAAU,GAAG,OAAO;CACxE,MAAM,QAAQ,2BAA2B,KAAK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,oBAAoB,OAAO,UAAU;CAC7C,IAAI,iBAAiB,MAAM,OAAO,IAAI,cAAc,MAAM,YAAY,CAAC,EAAE;CACzE,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,cAAc,wBAAwB,OAAO,QAAQ,CAAC,EAAE;CAClG,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,UAAU,MAAM,OAAO;CAC3B,OAAO,IAAI,cAAc,KAAK,UAAU,KAAK,CAAC,EAAE;AACjD;;;;;;;;AAQA,SAAS,0BAA0B,UAAU,cAAc,UAAU;CACpE,IAAI,SAAS,WAAW,GAAG,OAAO;CAClC,MAAM,WAAW,SAAS,SAAS,KAAK,OAAO,oBAAoB,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;CAC7F,IAAI,iBAAiB,IAAI,OAAO;CAChC,OAAO,GAAG,SAAS,IAAI,aAAa,SAAS,IAAI,IAAI,eAAe,GAAG,aAAa;AACrF"}
1
+ {"version":3,"file":"planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-ddl-builders-Y0_96xpe.mjs"],"sourcesContent":["import { t as escapeLiteral } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { A as pgTimestamptz, E as pgTime, M as pgTimetz, O as pgTimestamp, _ as pgInt8, b as pgJsonb, c as pgDate, g as pgInt4, h as pgInt2, v as pgInterval, y as pgJson } from \"./data-types-DRkmmE9S.mjs\";\nimport { dataTypeParams, renderSqlTypeName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/autoincrement-widths.ts\nconst SMALL = {\n\tserialType: \"SMALLSERIAL\",\n\tsequenceType: \"smallint\"\n};\nconst REGULAR = {\n\tserialType: \"SERIAL\",\n\tsequenceType: \"integer\"\n};\nconst BIG = {\n\tserialType: \"BIGSERIAL\",\n\tsequenceType: \"bigint\"\n};\nconst WIDTH_BY_COLUMN_TYPE = /* @__PURE__ */ new Map([\n\t[\"int2\", SMALL],\n\t[\"smallint\", SMALL],\n\t[\"int4\", REGULAR],\n\t[\"integer\", REGULAR],\n\t[\"int8\", BIG],\n\t[\"bigint\", BIG]\n]);\n/** The autoincrement width of a column of `columnType`; `undefined` for a column that is not a scalar smallint, integer or bigint. */\nfunction autoincrementWidth(columnType) {\n\treturn WIDTH_BY_COLUMN_TYPE.get(columnType.toLowerCase());\n}\nconst WIDTH_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[pgInt2.id, SMALL],\n\t[pgInt4.id, REGULAR],\n\t[pgInt8.id, BIG]\n]);\n/** The autoincrement width of a column whose data type is `dataTypeId`; `undefined` unless it is `pg/int2`, `pg/int4` or `pg/int8`. */\nfunction autoincrementWidthOfDataType(dataTypeId) {\n\treturn WIDTH_BY_DATA_TYPE.get(dataTypeId);\n}\n//#endregion\n//#region src/core/date-time-ddl-text.ts\nconst DATE_TIME_TYPES = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgInterval.id\n]);\nconst TYPES_WITH_A_YEAR = /* @__PURE__ */ new Set([\n\tpgDate.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id\n]);\n/** Whether a data type is one of this target's date and time types, whose defaults DDL writes as text. */\nfunction isPostgresDateTimeDataType(dataTypeId) {\n\treturn dataTypeId !== void 0 && DATE_TIME_TYPES.has(dataTypeId);\n}\n/**\n* The text DDL writes for a default of a date or time type, from its canonical form (ADR 254). A\n* year from 1 to 9999 stays as it is. PostgreSQL has no year 0 and reads no signed year, so a later\n* year loses its sign and leading zeros (`10000-01-01`) and a year at or before 0 is written as the\n* year before Christ (`0044-03-15 BC`). Every Postgres DDL path writes a date or time default\n* through this function.\n*/\nfunction postgresDateTimeDdlText(canonical, dataTypeId) {\n\tif (dataTypeId === void 0 || !TYPES_WITH_A_YEAR.has(dataTypeId)) return canonical;\n\tconst match = /^([+-]\\d{6}|\\d{4})(-.*)$/.exec(canonical);\n\tif (match === null) return canonical;\n\tconst [, yearDigits = \"\", rest = \"\"] = match;\n\tconst year = Number(yearDigits);\n\tif (year >= 1 && year <= 9999) return canonical;\n\tif (year > 9999) return `${year}${rest}`;\n\treturn `${String(1 - year).padStart(4, \"0\")}${rest} BC`;\n}\n//#endregion\n//#region src/core/migrations/planner-ddl-builders.ts\nconst JSON_DATA_TYPES = /* @__PURE__ */ new Set([pgJson.id, pgJsonb.id]);\n/**\n* Renders the SQL type for a column in DDL context: the name its codec's data type is written\n* with, and its parameters. A `typeRef` column is written as a column of the referenced type.\n*\n* @param allowPseudoTypes - When true (default), autoincrement integer columns\n* produce SERIAL/BIGSERIAL/SMALLSERIAL pseudo-types. Set to false for contexts\n* like ALTER COLUMN TYPE where pseudo-types are invalid.\n*/\nfunction buildColumnTypeSql(column, types, storageTypes = {}, allowPseudoTypes = true) {\n\tconst resolved = (column.typeRef === void 0 ? void 0 : storageTypes[column.typeRef]) ?? column;\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tif (allowPseudoTypes && isAutoincrement(column.default)) {\n\t\tconst width = autoincrementWidthOfDataType(dataType.id);\n\t\tif (width !== void 0) return width.serialType;\n\t}\n\tconst typeSql = renderSqlTypeName(dataType, dataTypeParams(dataType, resolved.typeParams));\n\treturn column.many ? `${typeSql}[]` : typeSql;\n}\nfunction isAutoincrement(columnDefault) {\n\treturn columnDefault?.kind === \"function\" && columnDefault.expression === \"autoincrement()\";\n}\nfunction renderDefaultLiteral(value, column) {\n\tif (column?.many && Array.isArray(value)) return renderArrayLiteralDefault(value, column.baseTypeName, column.dataType);\n\tif (column !== void 0 && JSON_DATA_TYPES.has(column.dataType) && typeof value === \"object\" && value !== null && !(value instanceof Date)) return `'${escapeLiteral(JSON.stringify(value))}'::${column.baseTypeName}`;\n\treturn renderScalarLiteral(value, column?.dataType);\n}\n/** A date or time value is written through the one function every DDL path uses for it. */\nfunction renderScalarLiteral(value, dataType) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(postgresDateTimeDdlText(value, dataType))}'`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\n/**\n* An `ARRAY[...]` of quoted elements has type `text[]`, which Postgres does not assign to a list of\n* numbers, decimals, timestamps or enums, so the constructor is cast to the list type. Each element\n* is the text Postgres reads for its type: an `int8` or `numeric` value as decimal text, a date or\n* time value in its type's canonical form. The cast is `baseTypeName` with `[]` appended unless it\n* already ends in `[]`; the name is not quoted here.\n*/\nfunction renderArrayLiteralDefault(elements, baseTypeName, dataType) {\n\tif (elements.length === 0) return \"'{}'\";\n\tconst rendered = `ARRAY[${elements.map((el) => renderScalarLiteral(el, dataType)).join(\", \")}]`;\n\tif (baseTypeName === \"\") return rendered;\n\treturn `${rendered}::${baseTypeName.endsWith(\"[]\") ? baseTypeName : `${baseTypeName}[]`}`;\n}\n//#endregion\nexport { autoincrementWidth as a, postgresDateTimeDdlText as i, renderDefaultLiteral as n, isPostgresDateTimeDataType as r, buildColumnTypeSql as t };\n\n//# sourceMappingURL=planner-ddl-builders-Y0_96xpe.mjs.map"],"mappings":";;;;AAIA,MAAM,QAAQ;CACb,YAAY;CACZ,cAAc;AACf;AACA,MAAM,UAAU;CACf,YAAY;CACZ,cAAc;AACf;AACA,MAAM,MAAM;CACX,YAAY;CACZ,cAAc;AACf;AACA,MAAM,uCAAuC,IAAI,IAAI;CACpD,CAAC,QAAQ,KAAK;CACd,CAAC,YAAY,KAAK;CAClB,CAAC,QAAQ,OAAO;CAChB,CAAC,WAAW,OAAO;CACnB,CAAC,QAAQ,GAAG;CACZ,CAAC,UAAU,GAAG;AACf,CAAC;;AAED,SAAS,mBAAmB,YAAY;CACvC,OAAO,qBAAqB,IAAI,WAAW,YAAY,CAA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GAAG,aAAa;AACrF"}
@@ -1,7 +1,7 @@
1
- import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from "./data-types-k3Ebk3kj-DWk3nh_k.mjs";
1
+ import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from "./data-types-DRkmmE9S-C5Q9oH4Q.mjs";
2
2
  import { sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-identity-values-C1eV916m.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-identity-values-CRS2cQ6v.mjs
5
5
  /**
6
6
  * Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.
7
7
  * Checks codec hooks first (extensions can provide type-specific identity values),
@@ -69,4 +69,4 @@ function buildBitIdentityValue(typeParams) {
69
69
  //#endregion
70
70
  export { resolveIdentityValue as n, buildBuiltinIdentityValue as t };
71
71
 
72
- //# sourceMappingURL=planner-identity-values-C1eV916m-D0p3EfYc.mjs.map
72
+ //# sourceMappingURL=planner-identity-values-CRS2cQ6v-DakZeIQj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-identity-values-C1eV916m-D0p3EfYc.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-identity-values-C1eV916m.mjs"],"sourcesContent":["import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from \"./data-types-k3Ebk3kj.mjs\";\nimport { sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-identity-values.ts\n/**\n* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.\n* Checks codec hooks first (extensions can provide type-specific identity values),\n* then falls back to the built-in map, keyed by the data type the column's codec represents.\n*/\nfunction resolveIdentityValue(column, codecHooks, types, storageTypes = {}) {\n\tconst referencedType = column.typeRef ? storageTypes[column.typeRef] : void 0;\n\tconst codecId = referencedType?.codecId ?? column.codecId;\n\tconst typeParams = referencedType?.typeParams ?? column.typeParams;\n\tif (column.many) return \"'{}'\";\n\tconst dataType = sqlDataTypeOfCodec(codecId, types).id;\n\tconst hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t});\n\tif (hookDefault !== void 0) return hookDefault;\n\treturn buildBuiltinIdentityValue(dataType, typeParams);\n}\nconst IDENTITY_VALUES = /* @__PURE__ */ new Map([\n\t[pgText.id, \"''\"],\n\t[pgChar.id, \"''\"],\n\t[pgVarchar.id, \"''\"],\n\t[pgInt2.id, \"0\"],\n\t[pgInt4.id, \"0\"],\n\t[pgInt8.id, \"0\"],\n\t[pgFloat4.id, \"0\"],\n\t[pgFloat8.id, \"0\"],\n\t[pgNumeric.id, \"0\"],\n\t[pgBool.id, \"false\"],\n\t[pgUuid.id, \"'00000000-0000-0000-0000-000000000000'\"],\n\t[pgJson.id, \"'{}'::json\"],\n\t[pgJsonb.id, \"'{}'::jsonb\"],\n\t[pgDate.id, \"'epoch'\"],\n\t[pgTimestamp.id, \"'epoch'\"],\n\t[pgTimestamptz.id, \"'epoch'\"],\n\t[pgTime.id, \"'00:00:00'\"],\n\t[pgTimetz.id, \"'00:00:00+00'\"],\n\t[pgInterval.id, \"'0'\"],\n\t[pgBytea.id, \"''::bytea\"],\n\t[pgVarbit.id, \"B''\"],\n\t[pgTextArray.id, \"'{}'\"]\n]);\n/**\n* Returns the built-in identity value (monoid neutral element) as a SQL literal for the given\n* data type — e.g. 0 for integers, '' for text, false for booleans.\n*\n* This is the planner's fallback when no codec hook provides a type-specific identity value.\n*\n* Returns null for other types (for example enums and extension-owned types without a\n* hook), which causes the planner to fall back to the empty-table precheck.\n*\n* @internal Exported for testing only.\n*/\nfunction buildBuiltinIdentityValue(dataType, typeParams) {\n\tif (dataType === pgBit.id) return buildBitIdentityValue(typeParams);\n\treturn IDENTITY_VALUES.get(dataType) ?? null;\n}\nfunction buildBitIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (length === void 0) return \"B'0'\";\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `B'${\"0\".repeat(length)}'`;\n}\n//#endregion\nexport { resolveIdentityValue as n, buildBuiltinIdentityValue as t };\n\n//# sourceMappingURL=planner-identity-values-C1eV916m.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,QAAQ,YAAY,OAAO,eAAe,CAAC,GAAG;CAC3E,MAAM,iBAAiB,OAAO,UAAU,aAAa,OAAO,WAAW,KAAK;CAC5E,MAAM,UAAU,gBAAgB,WAAW,OAAO;CAClD,MAAM,aAAa,gBAAgB,cAAc,OAAO;CACxD,IAAI,OAAO,MAAM,OAAO;CACxB,MAAM,WAAW,mBAAmB,SAAS,KAAK,CAAC,CAAC;CACpD,MAAM,cAAc,WAAW,IAAI,OAAO,CAAC,EAAE,uBAAuB;EACnE;EACA;EACA,GAAG,UAAU,cAAc,UAAU;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ets/3-targets/postgres/dist/planner-identity-values-CRS2cQ6v.mjs"],"sourcesContent":["import { A as pgTimestamptz, E as pgTime, F as pgUuid, I as pgVarbit, L as pgVarchar, M as pgTimetz, O as pgTimestamp, T as pgTextArray, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, n as pgBit, o as pgChar, p as pgFloat8, v as pgInterval, w as pgText, x as pgNumeric, y as pgJson } from \"./data-types-DRkmmE9S.mjs\";\nimport { sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/migrations/planner-identity-values.ts\n/**\n* Resolves the identity value (monoid neutral element) as a SQL literal for a column's type.\n* Checks codec hooks first (extensions can provide type-specific identity values),\n* then falls back to the built-in map, keyed by the data type the column's codec represents.\n*/\nfunction resolveIdentityValue(column, codecHooks, types, storageTypes = {}) {\n\tconst referencedType = column.typeRef ? storageTypes[column.typeRef] : void 0;\n\tconst codecId = referencedType?.codecId ?? column.codecId;\n\tconst typeParams = referencedType?.typeParams ?? column.typeParams;\n\tif (column.many) return \"'{}'\";\n\tconst dataType = sqlDataTypeOfCodec(codecId, types).id;\n\tconst hookDefault = codecHooks.get(codecId)?.resolveIdentityValue?.({\n\t\tdataType,\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams)\n\t});\n\tif (hookDefault !== void 0) return hookDefault;\n\treturn buildBuiltinIdentityValue(dataType, typeParams);\n}\nconst IDENTITY_VALUES = /* @__PURE__ */ new Map([\n\t[pgText.id, \"''\"],\n\t[pgChar.id, \"''\"],\n\t[pgVarchar.id, \"''\"],\n\t[pgInt2.id, \"0\"],\n\t[pgInt4.id, \"0\"],\n\t[pgInt8.id, \"0\"],\n\t[pgFloat4.id, \"0\"],\n\t[pgFloat8.id, \"0\"],\n\t[pgNumeric.id, \"0\"],\n\t[pgBool.id, \"false\"],\n\t[pgUuid.id, \"'00000000-0000-0000-0000-000000000000'\"],\n\t[pgJson.id, \"'{}'::json\"],\n\t[pgJsonb.id, \"'{}'::jsonb\"],\n\t[pgDate.id, \"'epoch'\"],\n\t[pgTimestamp.id, \"'epoch'\"],\n\t[pgTimestamptz.id, \"'epoch'\"],\n\t[pgTime.id, \"'00:00:00'\"],\n\t[pgTimetz.id, \"'00:00:00+00'\"],\n\t[pgInterval.id, \"'0'\"],\n\t[pgBytea.id, \"''::bytea\"],\n\t[pgVarbit.id, \"B''\"],\n\t[pgTextArray.id, \"'{}'\"]\n]);\n/**\n* Returns the built-in identity value (monoid neutral element) as a SQL literal for the given\n* data type — e.g. 0 for integers, '' for text, false for booleans.\n*\n* This is the planner's fallback when no codec hook provides a type-specific identity value.\n*\n* Returns null for other types (for example enums and extension-owned types without a\n* hook), which causes the planner to fall back to the empty-table precheck.\n*\n* @internal Exported for testing only.\n*/\nfunction buildBuiltinIdentityValue(dataType, typeParams) {\n\tif (dataType === pgBit.id) return buildBitIdentityValue(typeParams);\n\treturn IDENTITY_VALUES.get(dataType) ?? null;\n}\nfunction buildBitIdentityValue(typeParams) {\n\tconst length = typeParams?.[\"length\"];\n\tif (length === void 0) return \"B'0'\";\n\tif (typeof length !== \"number\" || !Number.isInteger(length) || length <= 0) return null;\n\treturn `B'${\"0\".repeat(length)}'`;\n}\n//#endregion\nexport { resolveIdentityValue as n, buildBuiltinIdentityValue as t };\n\n//# sourceMappingURL=planner-identity-values-CRS2cQ6v.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,qBAAqB,QAAQ,YAAY,OAAO,eAAe,CAAC,GAAG;CAC3E,MAAM,iBAAiB,OAAO,UAAU,aAAa,OAAO,WAAW,KAAK;CAC5E,MAAM,UAAU,gBAAgB,WAAW,OAAO;CAClD,MAAM,aAAa,gBAAgB,cAAc,OAAO;CACxD,IAAI,OAAO,MAAM,OAAO;CACxB,MAAM,WAAW,mBAAmB,SAAS,KAAK,CAAC,CAAC;CACpD,MAAM,cAAc,WAAW,IAAI,OAAO,CAAC,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
1
- import { t as PostgresMigration } from "./postgres-migration-UVh2xeV0-DW8V_8aj.mjs";
2
- import { t as renderOps } from "./render-ops-D2vJApKB-B281fzmn.mjs";
1
+ import { t as PostgresMigration } from "./postgres-migration-DmczQSHT-DsWlow8L.mjs";
2
+ import { t as renderOps } from "./render-ops-DaCy6StH-BgzbTE_9.mjs";
3
3
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BAWQ6iqr.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BdWg8TP2.mjs
5
5
  var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
6
6
  #calls;
7
7
  #meta;
@@ -44,4 +44,4 @@ var TypeScriptRenderablePostgresMigration = class extends PostgresMigration {
44
44
  //#endregion
45
45
  export { TypeScriptRenderablePostgresMigration as t };
46
46
 
47
- //# sourceMappingURL=planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs.map
47
+ //# sourceMappingURL=planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BAWQ6iqr.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-UVh2xeV0.mjs\";\nimport { t as renderOps } from \"./render-ops-D2vJApKB.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BAWQ6iqr.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#lowerer","#operationsCache"],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-BdWg8TP2.mjs"],"sourcesContent":["import { t as PostgresMigration } from \"./postgres-migration-DmczQSHT.mjs\";\nimport { t as renderOps } from \"./render-ops-DaCy6StH.mjs\";\nimport { t as renderCallsToTypeScript } from \"./render-typescript-Dqp1Spgn.mjs\";\n//#region src/core/migrations/planner-produced-postgres-migration.ts\nvar TypeScriptRenderablePostgresMigration = class extends PostgresMigration {\n\t#calls;\n\t#meta;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from the planner options so the runner keys the marker row by\n\t* the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderablePostgresMigration as t };\n\n//# sourceMappingURL=planner-produced-postgres-migration-BdWg8TP2.mjs.map"],"mappings":";;;;AAIA,IAAI,wCAAwC,cAAc,kBAAkB;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA,YAAY,OAAO,MAAM,SAAS,qBAAqB,SAAS;EAC/D,MAAM;EACN,KAAKA,SAAS;EACd,KAAKC,QAAQ;EACb,KAAKC,WAAW;EAChB,KAAKC,uBAAuB;EAC5B,KAAKC,WAAW;CACjB;CACA,IAAI,aAAa;EAChB,KAAKC,qBAAqB,UAAU,KAAKL,QAAQ,KAAKI,QAAQ;EAC9D,OAAO,KAAKC;CACb;CACA,WAAW;EACV,OAAO,KAAKJ;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKC;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
@@ -0,0 +1 @@
1
+ import "./planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.mjs";
@@ -1,11 +1,11 @@
1
1
  import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
2
- import { t as PostgresMigration } from "./postgres-migration-e8UybR1y-C_m4i1jp.mjs";
2
+ import { t as PostgresMigration } from "./postgres-migration-DVY2ALDJ-DTWECas_.mjs";
3
3
  import { MigrationPlanWithAuthoringSurface, OpFactoryCall } from "@prisma/orm-framework/components/control";
4
4
  import { SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
5
5
  import { MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
6
6
  import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
7
7
  import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
8
- //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-DT3i_p3G.d.mts
8
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-Bw145mJT.d.mts
9
9
  //#region src/core/migrations/planner-produced-postgres-migration.d.ts
10
10
  declare class TypeScriptRenderablePostgresMigration extends PostgresMigration implements MigrationPlanWithAuthoringSurface {
11
11
  #private;
@@ -22,4 +22,4 @@ declare class TypeScriptRenderablePostgresMigration extends PostgresMigration im
22
22
  }
23
23
  //#endregion
24
24
  export { TypeScriptRenderablePostgresMigration as t };
25
- //# sourceMappingURL=planner-produced-postgres-migration-DT3i_p3G-CyQUv3ac.d.mts.map
25
+ //# sourceMappingURL=planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-produced-postgres-migration-Bw145mJT.d.mts"],"mappings":";;;;;;;;;cAQc,8CAA8C,6BAA6B;;EAEvF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,UAAU;MACtH,wBAAwB,0BAA0B,6BAA6B,QAAQ,0BAA0B;EACrH,YAAY;;;;;;MAMR;EACJ,iBAAiB,wBAAwB"}
@@ -1,7 +1,7 @@
1
1
  import { i as quoteIdentifierWhereNeeded } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
2
- import { h as postgresCreateNamespace } from "./postgres-schema-AlEVkXXS-ZfXWYddl.mjs";
2
+ import { h as postgresCreateNamespace } from "./postgres-schema-COkaqci7-C6JpiSha.mjs";
3
3
  import { dataTypeParams, renderSqlCatalogText, sqlDataTypeOfCodec, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
4
- //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-rqOH8naU.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/planner-sql-checks-DCGV2qdu.mjs
5
5
  function resolveColumnTypeMetadata(column, storageTypes) {
6
6
  if (!column.typeRef) return column;
7
7
  const referencedType = storageTypes[column.typeRef];
@@ -43,4 +43,4 @@ function buildExpectedFormatType(column, types, storageTypes = {}) {
43
43
  //#endregion
44
44
  export { qualifyTableName as n, buildExpectedFormatType as t };
45
45
 
46
- //# sourceMappingURL=planner-sql-checks-rqOH8naU-B6xOE5lC.mjs.map
46
+ //# sourceMappingURL=planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planner-sql-checks-rqOH8naU-B6xOE5lC.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-rqOH8naU.mjs"],"sourcesContent":["import { i as quoteIdentifierWhereNeeded } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-AlEVkXXS.mjs\";\nimport { dataTypeParams, renderSqlCatalogText, sqlDataTypeOfCodec, unquotedSqlBaseName } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-type-resolution.ts\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) return column;\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/**\n* The type `format_type` prints, for the column's ALTER COLUMN TYPE postcheck: the catalog text of\n* its data type with normalised parameters, or for an enum its name, quoted where Postgres quotes\n* it.\n*/\nfunction buildExpectedFormatType(column, types, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tconst params = dataTypeParams(dataType, resolved.typeParams);\n\tif (dataType.sql.claimsKind !== void 0) return unquotedSqlBaseName(dataType, params).split(\".\").map(quoteIdentifierWhereNeeded).join(\".\");\n\treturn renderSqlCatalogText(dataType, params);\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-rqOH8naU.mjs.map"],"mappings":";;;;AAIA,SAAS,0BAA0B,QAAQ,cAAc;CACxD,IAAI,CAAC,OAAO,SAAS,OAAO;CAC5B,MAAM,iBAAiB,aAAa,OAAO;CAC3C,IAAI,CAAC,gBAAgB,OAAO;CAC5B,OAAO;EACN,SAAS,eAAe;EACxB,YAAY,eAAe;CAC5B;AACD;;;;;;;;;;;;AAcA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;;;;;AAMA,SAAS,wBAAwB,QAAQ,OAAO,eAAe,CAAC,GAAG;CAClE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,MAAM,WAAW,mBAAmB,SAAS,SAAS,KAAK;CAC3D,MAAM,SAAS,eAAe,UAAU,SAAS,UAAU;CAC3D,IAAI,SAAS,IAAI,eAAe,KAAK,GAAG,OAAO,oBAAoB,UAAU,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,0BAA0B,CAAC,CAAC,KAAK,GAAG;CACxI,OAAO,qBAAqB,UAAU,MAAM;AAC7C"}
1
+ {"version":3,"file":"planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/planner-sql-checks-DCGV2qdu.mjs"],"sourcesContent":["import { i as quoteIdentifierWhereNeeded } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-COkaqci7.mjs\";\nimport { dataTypeParams, renderSqlCatalogText, sqlDataTypeOfCodec, unquotedSqlBaseName } from \"@internal/sql-contract/data-type\";\n//#region src/core/migrations/planner-type-resolution.ts\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) return column;\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/planner-sql-checks.ts\n/**\n* String-keyed entry points the migration ops use to render\n* schema-qualified DDL and catalog checks. The `schema` argument is\n* interpreted as a namespace coordinate: the framework `__unbound__`\n* sentinel resolves to the late-bound `PostgresUnboundSchema` singleton\n* (which elides the qualifier so `search_path` decides at runtime); any\n* other id materialises a `PostgresSchema(id)` whose qualifier is the\n* named schema. Helpers route through these `Namespace` concretions so\n* the unbound branch lives in the polymorphic override, not the call\n* site.\n*/\nfunction qualifyTableName(schema, table) {\n\treturn postgresCreateNamespace({\n\t\tid: schema,\n\t\tentries: { table: {} }\n\t}).qualifyTable(table);\n}\n/**\n* The type `format_type` prints, for the column's ALTER COLUMN TYPE postcheck: the catalog text of\n* its data type with normalised parameters, or for an enum its name, quoted where Postgres quotes\n* it.\n*/\nfunction buildExpectedFormatType(column, types, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(resolved.codecId, types);\n\tconst params = dataTypeParams(dataType, resolved.typeParams);\n\tif (dataType.sql.claimsKind !== void 0) return unquotedSqlBaseName(dataType, params).split(\".\").map(quoteIdentifierWhereNeeded).join(\".\");\n\treturn renderSqlCatalogText(dataType, params);\n}\n//#endregion\nexport { qualifyTableName as n, buildExpectedFormatType as t };\n\n//# sourceMappingURL=planner-sql-checks-DCGV2qdu.mjs.map"],"mappings":";;;;AAIA,SAAS,0BAA0B,QAAQ,cAAc;CACxD,IAAI,CAAC,OAAO,SAAS,OAAO;CAC5B,MAAM,iBAAiB,aAAa,OAAO;CAC3C,IAAI,CAAC,gBAAgB,OAAO;CAC5B,OAAO;EACN,SAAS,eAAe;EACxB,YAAY,eAAe;CAC5B;AACD;;;;;;;;;;;;AAcA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,OAAO,wBAAwB;EAC9B,IAAI;EACJ,SAAS,EAAE,OAAO,CAAC,EAAE;CACtB,CAAC,CAAC,CAAC,aAAa,KAAK;AACtB;;;;;;AAMA,SAAS,wBAAwB,QAAQ,OAAO,eAAe,CAAC,GAAG;CAClE,MAAM,WAAW,0BAA0B,QAAQ,YAAY;CAC/D,MAAM,WAAW,mBAAmB,SAAS,SAAS,KAAK;CAC3D,MAAM,SAAS,eAAe,UAAU,SAAS,UAAU;CAC3D,IAAI,SAAS,IAAI,eAAe,KAAK,GAAG,OAAO,oBAAoB,UAAU,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,0BAA0B,CAAC,CAAC,KAAK,GAAG;CACxI,OAAO,qBAAqB,UAAU,MAAM;AAC7C"}
@@ -1,8 +1,8 @@
1
1
  import { S as PG_TEXT_CODEC_ID, _ as PG_INT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
2
- import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-k3Ebk3kj-DWk3nh_k.mjs";
3
- import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-nSGjxm-H-BeUu5zV2.mjs";
4
- import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-AlEVkXXS-ZfXWYddl.mjs";
5
- import { c as postgresAuthoringEntityTypes } from "./authoring-vHbPLrW4-BsHR7gUE.mjs";
2
+ import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-DRkmmE9S-C5Q9oH4Q.mjs";
3
+ import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-CKBDkxX7-Kw84Or3s.mjs";
4
+ import { _ as roleEntityKind, c as PostgresSchema, f as nativeEnumEntityKind, g as rlsEnablementEntityKind, p as policyEntityKind } from "./postgres-schema-COkaqci7-C6JpiSha.mjs";
5
+ import { c as postgresAuthoringEntityTypes } from "./authoring-_2G2lsLt-VmVbrMPn.mjs";
6
6
  import { requiredSchemaKeys } from "@prisma/orm-framework/components/codec";
7
7
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
8
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -12,7 +12,7 @@ import { buildSqlSchemaQualifiedView } from "@prisma/orm-family-sql/contract/con
12
12
  import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing-utils";
13
13
  import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
14
14
  import { sqlContractCanonicalizationHooks } from "@prisma/orm-family-sql/contract/canonicalization-hooks";
15
- //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-B0KloSYp.mjs
15
+ //#region ../../../3-targets/3-targets/postgres/dist/postgres-contract-view-CL-YTH_3.mjs
16
16
  const POSTGRES_AUTHORING_CTX = {
17
17
  family: "sql",
18
18
  target: "postgres",
@@ -143,4 +143,4 @@ const PostgresContractView = {
143
143
  //#endregion
144
144
  export { PostgresContractView as n, PostgresContractSerializer as t };
145
145
 
146
- //# sourceMappingURL=postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs.map
146
+ //# sourceMappingURL=postgres-contract-view-CL-YTH_3-Diah6i2a.mjs.map