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

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 (176) hide show
  1. package/dist/{authoring-BtsOWgI3.mjs → authoring-34L18kA1.mjs} +18 -8
  2. package/dist/authoring-34L18kA1.mjs.map +1 -0
  3. package/dist/canonicalize-D1F4vUnP.d.mts.map +1 -1
  4. package/dist/{codec-ids-CI144z7g.d.mts → codec-ids-BswpvvND.d.mts} +3 -3
  5. package/dist/codec-ids-BswpvvND.d.mts.map +1 -0
  6. package/dist/{codec-ids-B10ZZHzw.mjs → codec-ids-D3G8K0YM.mjs} +3 -2
  7. package/dist/codec-ids-D3G8K0YM.mjs.map +1 -0
  8. package/dist/codec-ids.d.mts +2 -2
  9. package/dist/codec-ids.mjs +2 -2
  10. package/dist/{codec-types-CTfT4U4O.d.mts → codec-types-CQ07nOz-.d.mts} +4 -5
  11. package/dist/codec-types-CQ07nOz-.d.mts.map +1 -0
  12. package/dist/codec-types.d.mts +1 -1
  13. package/dist/{codecs-D7W9O0Xx.d.mts → codecs-G4DTY0F_.d.mts} +35 -7
  14. package/dist/codecs-G4DTY0F_.d.mts.map +1 -0
  15. package/dist/{codecs-DRbb26Or.mjs → codecs-TCsGgW-Y.mjs} +77 -5
  16. package/dist/codecs-TCsGgW-Y.mjs.map +1 -0
  17. package/dist/codecs.d.mts +2 -3
  18. package/dist/codecs.d.mts.map +1 -1
  19. package/dist/codecs.mjs +2 -2
  20. package/dist/contract-free.d.mts +2 -3
  21. package/dist/contract-free.d.mts.map +1 -1
  22. package/dist/contract-free.mjs +3 -3
  23. package/dist/{control-policy-UPteqwtU.mjs → control-policy-CZKdMztu.mjs} +4 -4
  24. package/dist/{control-policy-UPteqwtU.mjs.map → control-policy-CZKdMztu.mjs.map} +1 -1
  25. package/dist/control.d.mts +0 -1
  26. package/dist/control.d.mts.map +1 -1
  27. package/dist/control.mjs +74 -24
  28. package/dist/control.mjs.map +1 -1
  29. package/dist/data-transform-BOWpliq8.mjs.map +1 -1
  30. package/dist/{data-transform-DPzwBMhW.d.mts → data-transform-CGvE8yGx.d.mts} +1 -2
  31. package/dist/data-transform-CGvE8yGx.d.mts.map +1 -0
  32. package/dist/data-transform.d.mts +1 -1
  33. package/dist/{ddl-GTTOvjx_.mjs → ddl-DHXKzQ99.mjs} +3 -3
  34. package/dist/{ddl-GTTOvjx_.mjs.map → ddl-DHXKzQ99.mjs.map} +1 -1
  35. package/dist/ddl.d.mts +1 -1
  36. package/dist/default-normalizer-B9ZUiyUE.mjs +264 -0
  37. package/dist/default-normalizer-B9ZUiyUE.mjs.map +1 -0
  38. package/dist/default-normalizer.d.mts +14 -2
  39. package/dist/default-normalizer.d.mts.map +1 -1
  40. package/dist/default-normalizer.mjs +2 -248
  41. package/dist/{descriptor-meta-CFQKLXl_.mjs → descriptor-meta-qubYaxQA.mjs} +9 -4
  42. package/dist/descriptor-meta-qubYaxQA.mjs.map +1 -0
  43. package/dist/{diff-database-schema-47526Pv2.mjs → diff-database-schema-C-hnJ5mr.mjs} +9 -6
  44. package/dist/diff-database-schema-C-hnJ5mr.mjs.map +1 -0
  45. package/dist/diff-database-schema.d.mts +3 -3
  46. package/dist/diff-database-schema.d.mts.map +1 -1
  47. package/dist/diff-database-schema.mjs +1 -1
  48. package/dist/{errors-DO-w0EUS.mjs → errors-ByDS0xJL.mjs} +6 -6
  49. package/dist/errors-ByDS0xJL.mjs.map +1 -0
  50. package/dist/errors.d.mts +4 -4
  51. package/dist/errors.d.mts.map +1 -1
  52. package/dist/errors.mjs +1 -1
  53. package/dist/issue-planner.d.mts +1 -2
  54. package/dist/issue-planner.d.mts.map +1 -1
  55. package/dist/issue-planner.mjs +1 -1
  56. package/dist/migration.d.mts +3 -4
  57. package/dist/migration.d.mts.map +1 -1
  58. package/dist/migration.mjs +2 -2
  59. package/dist/native-type-normalizer.d.mts.map +1 -1
  60. package/dist/{nodes-Dv5eCSq9.d.mts → nodes-CQzM2hR0.d.mts} +1 -2
  61. package/dist/nodes-CQzM2hR0.d.mts.map +1 -0
  62. package/dist/{op-factory-call-Bn9zDx4_.d.mts → op-factory-call-DT7kdjVP.d.mts} +10 -7
  63. package/dist/op-factory-call-DT7kdjVP.d.mts.map +1 -0
  64. package/dist/{op-factory-call-C38NzvQD.mjs → op-factory-call-DuRj7WXX.mjs} +37 -16
  65. package/dist/{op-factory-call-C38NzvQD.mjs.map → op-factory-call-DuRj7WXX.mjs.map} +1 -1
  66. package/dist/op-factory-call.d.mts +2 -2
  67. package/dist/op-factory-call.mjs +2 -2
  68. package/dist/pack.d.mts +122 -6
  69. package/dist/pack.d.mts.map +1 -1
  70. package/dist/pack.mjs +1 -1
  71. package/dist/{planner-uHcFFWkx.mjs → planner-DPGxFcXo.mjs} +7 -7
  72. package/dist/{planner-uHcFFWkx.mjs.map → planner-DPGxFcXo.mjs.map} +1 -1
  73. package/dist/planner-ddl-builders.d.mts +1 -2
  74. package/dist/planner-ddl-builders.d.mts.map +1 -1
  75. package/dist/planner-identity-values.d.mts +0 -1
  76. package/dist/planner-identity-values.d.mts.map +1 -1
  77. package/dist/{planner-produced-postgres-migration-BEY1T0Xm.d.mts → planner-produced-postgres-migration-C-dwGdb2.d.mts} +2 -3
  78. package/dist/planner-produced-postgres-migration-C-dwGdb2.d.mts.map +1 -0
  79. package/dist/{planner-produced-postgres-migration-D7y-PEHK.mjs → planner-produced-postgres-migration-CFDpqWWE.mjs} +2 -2
  80. package/dist/planner-produced-postgres-migration-CFDpqWWE.mjs.map +1 -0
  81. package/dist/planner-produced-postgres-migration.d.mts +1 -1
  82. package/dist/planner-produced-postgres-migration.mjs +1 -1
  83. package/dist/planner-schema-lookup.d.mts +0 -1
  84. package/dist/planner-schema-lookup.d.mts.map +1 -1
  85. package/dist/{planner-sql-checks-zqNfs2XZ.mjs → planner-sql-checks-BuB877wH.mjs} +2 -2
  86. package/dist/{planner-sql-checks-zqNfs2XZ.mjs.map → planner-sql-checks-BuB877wH.mjs.map} +1 -1
  87. package/dist/planner-sql-checks.d.mts +0 -1
  88. package/dist/planner-sql-checks.d.mts.map +1 -1
  89. package/dist/planner-sql-checks.mjs +1 -1
  90. package/dist/planner-target-details-HkP4RrRO.d.mts.map +1 -1
  91. package/dist/planner.d.mts +3 -4
  92. package/dist/planner.d.mts.map +1 -1
  93. package/dist/planner.mjs +2 -2
  94. package/dist/{postgres-contract-view-C9j5cqP0.d.mts → postgres-contract-view-CeU7FJjW.d.mts} +4 -3
  95. package/dist/postgres-contract-view-CeU7FJjW.d.mts.map +1 -0
  96. package/dist/{postgres-contract-view-DM8sN1Ot.mjs → postgres-contract-view-DebHMqGR.mjs} +4 -4
  97. package/dist/{postgres-contract-view-DM8sN1Ot.mjs.map → postgres-contract-view-DebHMqGR.mjs.map} +1 -1
  98. package/dist/{postgres-database-schema-node-DJOTywwQ.d.mts → postgres-database-schema-node-DMXsIwAb.d.mts} +2 -3
  99. package/dist/postgres-database-schema-node-DMXsIwAb.d.mts.map +1 -0
  100. package/dist/{postgres-migration-arMSWU9b.mjs → postgres-migration-C_OPFhIF.mjs} +22 -6
  101. package/dist/postgres-migration-C_OPFhIF.mjs.map +1 -0
  102. package/dist/{postgres-migration-DbckK1su.d.mts → postgres-migration-DLIvzHjX.d.mts} +31 -7
  103. package/dist/postgres-migration-DLIvzHjX.d.mts.map +1 -0
  104. package/dist/{postgres-rls-policy--CSddvMR.d.mts → postgres-rls-policy-CYXdqG9B.d.mts} +1 -2
  105. package/dist/postgres-rls-policy-CYXdqG9B.d.mts.map +1 -0
  106. package/dist/{postgres-schema-Cm4DtiGA.mjs → postgres-schema-CewLYHB7.mjs} +2 -2
  107. package/dist/{postgres-schema-Cm4DtiGA.mjs.map → postgres-schema-CewLYHB7.mjs.map} +1 -1
  108. package/dist/{postgres-schema-DKq6s1P3.d.mts → postgres-schema-FdKRwe7X.d.mts} +3 -4
  109. package/dist/postgres-schema-FdKRwe7X.d.mts.map +1 -0
  110. package/dist/render-ops.d.mts +0 -1
  111. package/dist/render-ops.d.mts.map +1 -1
  112. package/dist/render-typescript.d.mts +0 -1
  113. package/dist/render-typescript.d.mts.map +1 -1
  114. package/dist/{resolve-ddl-schema-XyBaaenM.mjs → resolve-ddl-schema-D0wi_P9Q.mjs} +2 -2
  115. package/dist/{resolve-ddl-schema-XyBaaenM.mjs.map → resolve-ddl-schema-D0wi_P9Q.mjs.map} +1 -1
  116. package/dist/rls-canonicalize.d.mts +0 -1
  117. package/dist/rls-canonicalize.d.mts.map +1 -1
  118. package/dist/runtime.d.mts +1 -2
  119. package/dist/runtime.d.mts.map +1 -1
  120. package/dist/runtime.mjs +1 -1
  121. package/dist/schema-ir-annotations.d.mts +0 -1
  122. package/dist/schema-ir-annotations.d.mts.map +1 -1
  123. package/dist/schema-ir-annotations.mjs +1 -1
  124. package/dist/{schema-node-kinds-CrYzCR1i.d.mts → schema-node-kinds-DxvWh2Ic.d.mts} +1 -2
  125. package/dist/schema-node-kinds-DxvWh2Ic.d.mts.map +1 -0
  126. package/dist/sql-utils.d.mts.map +1 -1
  127. package/dist/{table-source-BvFo7gVs.d.mts → table-source-D5c2fxAQ.d.mts} +1 -2
  128. package/dist/table-source-D5c2fxAQ.d.mts.map +1 -0
  129. package/dist/{types-BDKkx8MA.d.mts → types-D2MLzLBD.d.mts} +1 -2
  130. package/dist/types-D2MLzLBD.d.mts.map +1 -0
  131. package/dist/types.d.mts +5 -5
  132. package/dist/types.mjs +1 -1
  133. package/package.json +21 -21
  134. package/src/core/authoring.ts +18 -5
  135. package/src/core/codec-helpers.ts +53 -1
  136. package/src/core/codec-ids.ts +1 -0
  137. package/src/core/codecs.ts +56 -3
  138. package/src/core/default-normalizer.ts +22 -0
  139. package/src/core/descriptor-meta.ts +2 -0
  140. package/src/core/errors.ts +5 -5
  141. package/src/core/index-types.ts +15 -0
  142. package/src/core/migrations/diff-database-schema.ts +3 -0
  143. package/src/core/migrations/op-factory-call.ts +40 -16
  144. package/src/core/migrations/operations/data-transform.ts +1 -1
  145. package/src/core/migrations/planner-produced-postgres-migration.ts +1 -1
  146. package/src/core/migrations/postgres-migration.ts +62 -2
  147. package/src/core/migrations/runner.ts +12 -11
  148. package/src/core/psl-infer/infer-psl-contract.ts +130 -12
  149. package/src/exports/codecs.ts +2 -0
  150. package/src/exports/control.ts +2 -0
  151. package/src/exports/default-normalizer.ts +1 -1
  152. package/src/exports/op-factory-call.ts +5 -0
  153. package/dist/authoring-BtsOWgI3.mjs.map +0 -1
  154. package/dist/codec-ids-B10ZZHzw.mjs.map +0 -1
  155. package/dist/codec-ids-CI144z7g.d.mts.map +0 -1
  156. package/dist/codec-types-CTfT4U4O.d.mts.map +0 -1
  157. package/dist/codecs-D7W9O0Xx.d.mts.map +0 -1
  158. package/dist/codecs-DRbb26Or.mjs.map +0 -1
  159. package/dist/data-transform-DPzwBMhW.d.mts.map +0 -1
  160. package/dist/default-normalizer.mjs.map +0 -1
  161. package/dist/descriptor-meta-CFQKLXl_.mjs.map +0 -1
  162. package/dist/diff-database-schema-47526Pv2.mjs.map +0 -1
  163. package/dist/errors-DO-w0EUS.mjs.map +0 -1
  164. package/dist/nodes-Dv5eCSq9.d.mts.map +0 -1
  165. package/dist/op-factory-call-Bn9zDx4_.d.mts.map +0 -1
  166. package/dist/planner-produced-postgres-migration-BEY1T0Xm.d.mts.map +0 -1
  167. package/dist/planner-produced-postgres-migration-D7y-PEHK.mjs.map +0 -1
  168. package/dist/postgres-contract-view-C9j5cqP0.d.mts.map +0 -1
  169. package/dist/postgres-database-schema-node-DJOTywwQ.d.mts.map +0 -1
  170. package/dist/postgres-migration-DbckK1su.d.mts.map +0 -1
  171. package/dist/postgres-migration-arMSWU9b.mjs.map +0 -1
  172. package/dist/postgres-rls-policy--CSddvMR.d.mts.map +0 -1
  173. package/dist/postgres-schema-DKq6s1P3.d.mts.map +0 -1
  174. package/dist/schema-node-kinds-CrYzCR1i.d.mts.map +0 -1
  175. package/dist/table-source-BvFo7gVs.d.mts.map +0 -1
  176. package/dist/types-BDKkx8MA.d.mts.map +0 -1
@@ -9,7 +9,7 @@
9
9
  * - `toOp()` — converts the IR node to a runtime
10
10
  * `SqlMigrationPlanOperation` by delegating to the matching pure factory
11
11
  * under `operations/`. `DataTransformCall.toOp()` always throws
12
- * `PN-MIG-2001` because a planner-generated data transform is an
12
+ * `MIGRATION.UNFILLED_PLACEHOLDER` because a planner-generated data transform is an
13
13
  * unfilled authoring stub by construction.
14
14
  * - `renderTypeScript()` / `importRequirements()` — inherited from
15
15
  * `TsExpression`. Used by `renderCallsToTypeScript` to emit the call as
@@ -45,7 +45,7 @@ import {
45
45
  tableExistsAst,
46
46
  } from '../../contract-free/checks';
47
47
  import * as contractFreeDdl from '../../contract-free/ddl';
48
- import type { PostgresRlsPolicy } from '../postgres-rls-policy';
48
+ import type { PostgresRlsPolicy, PostgresRlsPolicyInput } from '../postgres-rls-policy';
49
49
  import {
50
50
  escapeLiteral,
51
51
  quoteIdentifier,
@@ -740,10 +740,6 @@ export class AddNotNullColumnDirectCall extends PostgresOpFactoryCallNode {
740
740
  renderTypeScript(): string {
741
741
  return `rawSql(${jsonToTsSource({ id: `column.${this.tableName}.${this.columnName}`, label: this.label, operationClass: 'additive' })})`;
742
742
  }
743
-
744
- override importRequirements(): readonly ImportRequirement[] {
745
- return [];
746
- }
747
743
  }
748
744
 
749
745
  /**
@@ -810,10 +806,6 @@ export class AddNotNullColumnWithTempDefaultCall extends PostgresOpFactoryCallNo
810
806
  renderTypeScript(): string {
811
807
  return `rawSql(${jsonToTsSource({ id: `column.${this.tableName}.${this.columnName}`, label: this.label, operationClass: 'additive' })})`;
812
808
  }
813
-
814
- override importRequirements(): readonly ImportRequirement[] {
815
- return [];
816
- }
817
809
  }
818
810
 
819
811
  // ============================================================================
@@ -1515,7 +1507,7 @@ export class AddNativeEnumValueCall extends PostgresOpFactoryCallNode {
1515
1507
  * A planner-generated data-transform stub. `checkSlot` and `runSlot` name
1516
1508
  * the unfilled authoring slots that the rendered `migration.ts` will expose
1517
1509
  * to the user via `placeholder("…")` calls. `toOp()` always throws
1518
- * `PN-MIG-2001`: the planner cannot lower a stubbed transform to a runtime
1510
+ * `MIGRATION.UNFILLED_PLACEHOLDER`: the planner cannot lower a stubbed transform to a runtime
1519
1511
  * op — the user must fill the rendered `migration.ts` and re-emit.
1520
1512
  */
1521
1513
  export class DataTransformCall extends PostgresOpFactoryCallNode {
@@ -1592,7 +1584,23 @@ export class CreatePostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
1592
1584
  }
1593
1585
 
1594
1586
  renderTypeScript(): string {
1595
- return `createRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.policy)})`;
1587
+ const p = this.policy;
1588
+ const input: PostgresRlsPolicyInput = {
1589
+ name: p.name,
1590
+ prefix: p.prefix,
1591
+ tableName: p.tableName,
1592
+ namespaceId: p.namespaceId,
1593
+ operation: p.operation,
1594
+ roles: p.roles,
1595
+ ...ifDefined('using', p.using),
1596
+ ...ifDefined('withCheck', p.withCheck),
1597
+ permissive: p.permissive,
1598
+ };
1599
+ return `this.createRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, policy: ${jsonToTsSource(input)} })`;
1600
+ }
1601
+
1602
+ override importRequirements(): readonly ImportRequirement[] {
1603
+ return [];
1596
1604
  }
1597
1605
  }
1598
1606
 
@@ -1623,7 +1631,11 @@ export class DropPostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
1623
1631
  }
1624
1632
 
1625
1633
  renderTypeScript(): string {
1626
- return `dropRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.policyName)})`;
1634
+ return `this.dropRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, policy: ${jsonToTsSource(this.policyName)} })`;
1635
+ }
1636
+
1637
+ override importRequirements(): readonly ImportRequirement[] {
1638
+ return [];
1627
1639
  }
1628
1640
  }
1629
1641
 
@@ -1652,7 +1664,11 @@ export class EnableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
1652
1664
  }
1653
1665
 
1654
1666
  renderTypeScript(): string {
1655
- return `enableRowLevelSecurity(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;
1667
+ return `this.enableRowLevelSecurity({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)} })`;
1668
+ }
1669
+
1670
+ override importRequirements(): readonly ImportRequirement[] {
1671
+ return [];
1656
1672
  }
1657
1673
  }
1658
1674
 
@@ -1681,7 +1697,11 @@ export class DisableRowLevelSecurityCall extends PostgresOpFactoryCallNode {
1681
1697
  }
1682
1698
 
1683
1699
  renderTypeScript(): string {
1684
- return `disableRowLevelSecurity(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)})`;
1700
+ return `this.disableRowLevelSecurity({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)} })`;
1701
+ }
1702
+
1703
+ override importRequirements(): readonly ImportRequirement[] {
1704
+ return [];
1685
1705
  }
1686
1706
  }
1687
1707
 
@@ -1724,7 +1744,11 @@ export class RenamePostgresRlsPolicyCall extends PostgresOpFactoryCallNode {
1724
1744
  }
1725
1745
 
1726
1746
  renderTypeScript(): string {
1727
- return `renameRlsPolicy(${jsonToTsSource(this.schemaName)}, ${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.oldPolicyName)}, ${jsonToTsSource(this.newPolicyName)})`;
1747
+ return `this.renameRlsPolicy({ schema: ${jsonToTsSource(this.schemaName)}, table: ${jsonToTsSource(this.tableName)}, from: ${jsonToTsSource(this.oldPolicyName)}, to: ${jsonToTsSource(this.newPolicyName)} })`;
1748
+ }
1749
+
1750
+ override importRequirements(): readonly ImportRequirement[] {
1751
+ return [];
1728
1752
  }
1729
1753
  }
1730
1754
 
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * The factory accepts lazy closures (`() => SqlQueryPlan | Buildable`),
23
23
  * invokes each one, asserts that its `meta.storageHash` matches the
24
- * `contract` it was handed (→ `PN-MIG-2005` on mismatch), and lowers the
24
+ * `contract` it was handed (→ `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` on mismatch), and lowers the
25
25
  * plan via the supplied control adapter to a serialized `{sql, params}`
26
26
  * payload.
27
27
  *
@@ -15,7 +15,7 @@
15
15
  * Placeholder-bearing plans: `renderTypeScript()` always succeeds and embeds
16
16
  * `() => placeholder("slot")` at each stub. `operations`, in contrast, is
17
17
  * _not safe to enumerate_ on a stub-bearing plan — `DataTransformCall.toOp()`
18
- * throws `PN-MIG-2001` because a planner-stubbed closure cannot be lowered
18
+ * throws `MIGRATION.UNFILLED_PLACEHOLDER` because a planner-stubbed closure cannot be lowered
19
19
  * to a runtime op. Callers that know a plan may carry stubs must render to
20
20
  * `migration.ts`, let the user fill the slots, and re-load the edited
21
21
  * migration before enumerating ops. The walk-schema planner does not emit
@@ -8,6 +8,7 @@ import type { SqlStorage } from '@prisma-next/sql-contract/types';
8
8
  import type { DdlColumn, DdlTableConstraint } from '@prisma-next/sql-relational-core/ast';
9
9
  import { errorPostgresMigrationStackMissing } from '../errors';
10
10
  import { PostgresContractView } from '../postgres-contract-view';
11
+ import { PostgresRlsPolicy, type PostgresRlsPolicyInput } from '../postgres-rls-policy';
11
12
  import {
12
13
  AddCheckConstraintCall,
13
14
  AddColumnCall,
@@ -19,8 +20,10 @@ import {
19
20
  type AlterColumnTypeOptions,
20
21
  CreateIndexCall,
21
22
  CreateNativeEnumTypeCall,
23
+ CreatePostgresRlsPolicyCall,
22
24
  CreateSchemaCall,
23
25
  CreateTableCall,
26
+ DisableRowLevelSecurityCall,
24
27
  DropCheckConstraintCall,
25
28
  DropColumnCall,
26
29
  DropConstraintCall,
@@ -28,7 +31,10 @@ import {
28
31
  DropIndexCall,
29
32
  DropNativeEnumTypeCall,
30
33
  DropNotNullCall,
34
+ DropPostgresRlsPolicyCall,
31
35
  DropTableCall,
36
+ EnableRowLevelSecurityCall,
37
+ RenamePostgresRlsPolicyCall,
32
38
  SetDefaultCall,
33
39
  SetNotNullCall,
34
40
  } from './op-factory-call';
@@ -75,7 +81,7 @@ export abstract class PostgresMigration<
75
81
  * Materialized Postgres control adapter, created once per migration
76
82
  * instance from the injected stack. `undefined` only when the migration
77
83
  * was instantiated without a stack (test fixtures); `controlAdapterFor`
78
- * throws a PN-MIG-2007 in that case to surface the misuse.
84
+ * throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING in that case to surface the misuse.
79
85
  */
80
86
  protected readonly controlAdapter: SqlControlAdapter<'postgres'> | undefined;
81
87
 
@@ -101,7 +107,7 @@ export abstract class PostgresMigration<
101
107
  }
102
108
 
103
109
  /**
104
- * Returns the materialized control adapter, or throws a PN-MIG-2007 naming
110
+ * Returns the materialized control adapter, or throws a MIGRATION.POSTGRES_CONTROL_STACK_MISSING naming
105
111
  * `operation` when the migration was constructed without a `ControlStack`.
106
112
  * Single home for the null-check that every DDL/DML method shares.
107
113
  */
@@ -420,4 +426,58 @@ export abstract class PostgresMigration<
420
426
  }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
421
427
  return installExtension(options, this.controlAdapterFor('installExtension'));
422
428
  }
429
+
430
+ protected enableRowLevelSecurity(options: {
431
+ readonly schema: string;
432
+ readonly table: string;
433
+ }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
434
+ return new EnableRowLevelSecurityCall(options.schema, options.table).toOp(
435
+ this.controlAdapterFor('enableRowLevelSecurity'),
436
+ );
437
+ }
438
+
439
+ protected disableRowLevelSecurity(options: {
440
+ readonly schema: string;
441
+ readonly table: string;
442
+ }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
443
+ return new DisableRowLevelSecurityCall(options.schema, options.table).toOp(
444
+ this.controlAdapterFor('disableRowLevelSecurity'),
445
+ );
446
+ }
447
+
448
+ protected createRlsPolicy(options: {
449
+ readonly schema: string;
450
+ readonly table: string;
451
+ readonly policy: PostgresRlsPolicyInput;
452
+ }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
453
+ return new CreatePostgresRlsPolicyCall(
454
+ options.schema,
455
+ options.table,
456
+ new PostgresRlsPolicy(options.policy),
457
+ ).toOp(this.controlAdapterFor('createRlsPolicy'));
458
+ }
459
+
460
+ protected dropRlsPolicy(options: {
461
+ readonly schema: string;
462
+ readonly table: string;
463
+ readonly policy: string;
464
+ }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
465
+ return new DropPostgresRlsPolicyCall(options.schema, options.table, options.policy).toOp(
466
+ this.controlAdapterFor('dropRlsPolicy'),
467
+ );
468
+ }
469
+
470
+ protected renameRlsPolicy(options: {
471
+ readonly schema: string;
472
+ readonly table: string;
473
+ readonly from: string;
474
+ readonly to: string;
475
+ }): Promise<SqlMigrationPlanOperation<PostgresPlanTargetDetails>> {
476
+ return new RenamePostgresRlsPolicyCall(
477
+ options.schema,
478
+ options.table,
479
+ options.from,
480
+ options.to,
481
+ ).toOp(this.controlAdapterFor('renameRlsPolicy'));
482
+ }
423
483
  }
@@ -137,7 +137,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
137
137
  frameworkComponents: options.frameworkComponents,
138
138
  });
139
139
  if (!schemaVerifyResult.ok) {
140
- return runnerFailure('SCHEMA_VERIFY_FAILED', schemaVerifyResult.summary, {
140
+ return runnerFailure('MIGRATION.SCHEMA_VERIFY_FAILED', schemaVerifyResult.summary, {
141
141
  why: 'The resulting database schema does not satisfy the destination contract.',
142
142
  meta: {
143
143
  issues: schemaVerifyResult.schema.issues,
@@ -313,7 +313,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
313
313
  return okVoid();
314
314
  }
315
315
  return runnerFailure(
316
- 'LEGACY_MARKER_SHAPE',
316
+ 'MIGRATION.LEGACY_MARKER_SHAPE',
317
317
  'Legacy marker-table shape detected on prisma_contract.marker (no `space` column). ' +
318
318
  'Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. ' +
319
319
  'Drop `prisma_contract.marker` and re-run `dbInit` to reinitialise from a clean baseline.',
@@ -335,7 +335,8 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
335
335
  for (const step of steps) {
336
336
  const result = await driver.query(step.sql, step.params ?? []);
337
337
  if (!this.stepResultIsTrue(result.rows)) {
338
- const code = phase === 'precheck' ? 'PRECHECK_FAILED' : 'POSTCHECK_FAILED';
338
+ const code =
339
+ phase === 'precheck' ? 'MIGRATION.PRECHECK_FAILED' : 'MIGRATION.POSTCHECK_FAILED';
339
340
  return runnerFailure(
340
341
  code,
341
342
  `Operation ${operation.id} failed during ${phase}: ${step.description}`,
@@ -363,7 +364,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
363
364
  } catch (error: unknown) {
364
365
  if (SqlQueryError.is(error)) {
365
366
  return runnerFailure(
366
- 'EXECUTION_FAILED',
367
+ 'MIGRATION.EXECUTION_FAILED',
367
368
  `Operation ${operation.id} failed during execution: ${step.description}`,
368
369
  {
369
370
  why: error.message,
@@ -487,7 +488,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
487
488
  for (const operation of operations) {
488
489
  if (!allowedClasses.has(operation.operationClass)) {
489
490
  return runnerFailure(
490
- 'POLICY_VIOLATION',
491
+ 'MIGRATION.POLICY_VIOLATION',
491
492
  `Operation ${operation.id} has class "${operation.operationClass}" which is not allowed by policy.`,
492
493
  {
493
494
  why: `Policy only allows: ${policy.allowedOperationClasses.join(', ')}.`,
@@ -517,7 +518,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
517
518
 
518
519
  if (!marker) {
519
520
  return runnerFailure(
520
- 'MARKER_ORIGIN_MISMATCH',
521
+ 'MIGRATION.MARKER_ORIGIN_MISMATCH',
521
522
  `Missing contract marker: expected origin storage hash ${origin.storageHash}.`,
522
523
  {
523
524
  meta: {
@@ -528,7 +529,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
528
529
  }
529
530
  if (marker.storageHash !== origin.storageHash) {
530
531
  return runnerFailure(
531
- 'MARKER_ORIGIN_MISMATCH',
532
+ 'MIGRATION.MARKER_ORIGIN_MISMATCH',
532
533
  `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`,
533
534
  {
534
535
  meta: {
@@ -540,7 +541,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
540
541
  }
541
542
  if (origin.profileHash && marker.profileHash !== origin.profileHash) {
542
543
  return runnerFailure(
543
- 'MARKER_ORIGIN_MISMATCH',
544
+ 'MIGRATION.MARKER_ORIGIN_MISMATCH',
544
545
  `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`,
545
546
  {
546
547
  meta: {
@@ -559,7 +560,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
559
560
  ): Result<void, SqlMigrationRunnerFailure> {
560
561
  if (destination.storageHash !== contract.storage.storageHash) {
561
562
  return runnerFailure(
562
- 'DESTINATION_CONTRACT_MISMATCH',
563
+ 'MIGRATION.DESTINATION_CONTRACT_MISMATCH',
563
564
  `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`,
564
565
  {
565
566
  meta: {
@@ -575,7 +576,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
575
576
  destination.profileHash !== contract.profileHash
576
577
  ) {
577
578
  return runnerFailure(
578
- 'DESTINATION_CONTRACT_MISMATCH',
579
+ 'MIGRATION.DESTINATION_CONTRACT_MISMATCH',
579
580
  `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`,
580
581
  {
581
582
  meta: {
@@ -614,7 +615,7 @@ class PostgresMigrationRunner implements SqlMigrationRunner<PostgresPlanTargetDe
614
615
  });
615
616
  if (!updated) {
616
617
  return runnerFailure(
617
- 'MARKER_CAS_FAILURE',
618
+ 'MIGRATION.MARKER_CAS_FAILURE',
618
619
  'Marker was modified by another process during migration execution.',
619
620
  {
620
621
  meta: {
@@ -162,6 +162,15 @@ type ForeignKeyResolution = {
162
162
  readonly extraRelationsByTable: ReadonlyMap<string, readonly RelationField[]>;
163
163
  /** Synthetic field-name maps for cross-space-referenced pack tables, merged into `fieldNamesByTable`. */
164
164
  readonly crossSpaceFieldNamesByTable: ReadonlyMap<string, TableColumnFieldNameMap>;
165
+ /** Dangling foreign keys dropped per host table, kept so the model can explain the drop. */
166
+ readonly danglingForeignKeysByTable: ReadonlyMap<string, readonly DanglingForeignKeyInfo[]>;
167
+ };
168
+
169
+ /** A foreign key dropped because its target lives outside the introspected scope. */
170
+ type DanglingForeignKeyInfo = {
171
+ readonly columns: readonly string[];
172
+ readonly referencedSchema: string | undefined;
173
+ readonly referencedTable: string;
165
174
  };
166
175
 
167
176
  /**
@@ -198,6 +207,7 @@ function resolveForeignKeys(
198
207
  const resultTables: Record<string, SqlTableIR> = {};
199
208
  const extraRelationsByTable = new Map<string, RelationField[]>();
200
209
  const crossSpaceFieldNamesByTable = new Map<string, TableColumnFieldNameMap>();
210
+ const danglingForeignKeysByTable = new Map<string, DanglingForeignKeyInfo[]>();
201
211
 
202
212
  for (const [tableName, table] of Object.entries(tables)) {
203
213
  const keptForeignKeys: SqlForeignKeyIR[] = [];
@@ -248,9 +258,22 @@ function resolveForeignKeys(
248
258
 
249
259
  // Not a pack-owned coordinate: keep the foreign key if the referenced
250
260
  // table survived introspection (local), otherwise drop it while keeping
251
- // the scalar column (dangling).
261
+ // the scalar column (dangling) — recording it so the model can explain
262
+ // the drop instead of the relation vanishing without a trace.
252
263
  if (tables[fk.referencedTable] !== undefined) {
253
264
  keptForeignKeys.push(fk);
265
+ } else {
266
+ const dangling: DanglingForeignKeyInfo = {
267
+ columns: fk.columns,
268
+ referencedSchema: fk.referencedSchema,
269
+ referencedTable: fk.referencedTable,
270
+ };
271
+ const existingDangling = danglingForeignKeysByTable.get(tableName);
272
+ if (existingDangling) {
273
+ existingDangling.push(dangling);
274
+ } else {
275
+ danglingForeignKeysByTable.set(tableName, [dangling]);
276
+ }
254
277
  }
255
278
  }
256
279
 
@@ -260,7 +283,12 @@ function resolveForeignKeys(
260
283
  : new SqlTableIR({ ...table, foreignKeys: keptForeignKeys });
261
284
  }
262
285
 
263
- return { tables: resultTables, extraRelationsByTable, crossSpaceFieldNamesByTable };
286
+ return {
287
+ tables: resultTables,
288
+ extraRelationsByTable,
289
+ crossSpaceFieldNamesByTable,
290
+ danglingForeignKeysByTable,
291
+ };
264
292
  }
265
293
 
266
294
  /**
@@ -405,6 +433,7 @@ export function inferPostgresPslContract(
405
433
  tables: resolvedTables,
406
434
  extraRelationsByTable,
407
435
  crossSpaceFieldNamesByTable,
436
+ danglingForeignKeysByTable,
408
437
  } = resolveForeignKeys(tables, owners);
409
438
  const schemaIR = new SqlSchemaIR({ tables: resolvedTables });
410
439
 
@@ -437,6 +466,7 @@ export function inferPostgresPslContract(
437
466
  {
438
467
  extraRelationsByTable,
439
468
  crossSpaceFieldNamesByTable,
469
+ danglingForeignKeysByTable,
440
470
  },
441
471
  wrapNamespaceName,
442
472
  );
@@ -447,12 +477,13 @@ export function buildPslDocumentAst(
447
477
  options: PslPrinterOptions,
448
478
  foreignKeyExtras: Pick<
449
479
  ForeignKeyResolution,
450
- 'extraRelationsByTable' | 'crossSpaceFieldNamesByTable'
480
+ 'extraRelationsByTable' | 'crossSpaceFieldNamesByTable' | 'danglingForeignKeysByTable'
451
481
  >,
452
482
  namespaceName?: string,
453
483
  ): PslDocumentAst {
454
484
  const { typeMap, defaultMapping, parseRawDefault: rawDefaultParser } = options;
455
- const { extraRelationsByTable, crossSpaceFieldNamesByTable } = foreignKeyExtras;
485
+ const { extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } =
486
+ foreignKeyExtras;
456
487
 
457
488
  const modelNames = buildTopLevelNameMap(
458
489
  Object.keys(schemaIR.tables),
@@ -508,6 +539,7 @@ export function buildPslDocumentAst(
508
539
  ...(relationsByTable.get(table.name) ?? []),
509
540
  ...(extraRelationsByTable.get(table.name) ?? []),
510
541
  ],
542
+ danglingForeignKeysByTable.get(table.name) ?? [],
511
543
  ),
512
544
  );
513
545
  }
@@ -642,6 +674,7 @@ function buildModel(
642
674
  defaultMapping: DefaultMappingOptions | undefined,
643
675
  rawDefaultParser: PslPrinterOptions['parseRawDefault'],
644
676
  relationFields: readonly RelationField[],
677
+ danglingForeignKeys: readonly DanglingForeignKeyInfo[],
645
678
  ): PslModel {
646
679
  const { name: modelName, map: mapName } = toModelName(table.name);
647
680
  const fieldNameMap = fieldNamesByTable.get(table.name);
@@ -719,13 +752,23 @@ function buildModel(
719
752
  modelAttributes.push(buildMapAttribute('model', mapName));
720
753
  }
721
754
 
722
- // Surface introspection advisory: tables without a primary key cannot serve
723
- // as the right-hand side of a `findUnique`-style query downstream, so the
724
- // user should add an `@id`. This warning is part of the emitted SQL output
725
- // and is asserted byte-for-byte, so keep the exact wording.
726
- const comment = table.primaryKey
727
- ? undefined
728
- : '// WARNING: This table has no primary key in the database';
755
+ // Surface introspection advisories the user would otherwise have no way to
756
+ // discover from the emitted PSL alone. Both warnings are part of the
757
+ // emitted SQL output and are asserted byte-for-byte, so keep the exact
758
+ // wording; a table hitting both is combined onto the single comment line
759
+ // `PslModel.comment` supports.
760
+ const warnings: string[] = [];
761
+ if (!table.primaryKey) {
762
+ // Tables without a primary key cannot serve as the right-hand side of a
763
+ // `findUnique`-style query downstream, so the user should add an `@id`.
764
+ warnings.push('This table has no primary key in the database');
765
+ }
766
+ if (danglingForeignKeys.length > 0) {
767
+ warnings.push(
768
+ buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, table.name),
769
+ );
770
+ }
771
+ const comment = warnings.length > 0 ? `// WARNING: ${warnings.join(' ')}` : undefined;
729
772
 
730
773
  return {
731
774
  kind: 'model',
@@ -737,6 +780,35 @@ function buildModel(
737
780
  };
738
781
  }
739
782
 
783
+ /**
784
+ * Explains a foreign key `resolveForeignKeys` dropped as dangling: the
785
+ * database enforces it, but its target lives outside the introspected
786
+ * schema, so infer has no model to point a relation at. The suggested fix
787
+ * targets the common cause — an unconfigured extension pack's schema
788
+ * (e.g. Supabase's `auth`).
789
+ */
790
+ function buildDanglingForeignKeyWarning(
791
+ danglingForeignKeys: readonly DanglingForeignKeyInfo[],
792
+ fieldNamesByTable: ReadonlyMap<string, TableColumnFieldNameMap>,
793
+ tableName: string,
794
+ ): string {
795
+ const descriptions = danglingForeignKeys.map((fk) => {
796
+ const fieldNames = fk.columns.map((columnName) =>
797
+ resolveColumnFieldName(fieldNamesByTable, tableName, columnName),
798
+ );
799
+ const target =
800
+ fk.referencedSchema !== undefined
801
+ ? `${fk.referencedSchema}.${fk.referencedTable}`
802
+ : fk.referencedTable;
803
+ return `"${fieldNames.join(', ')}" -> "${target}"`;
804
+ });
805
+ return (
806
+ `Foreign key ${descriptions.join(', ')} exists in the database, but its target schema is ` +
807
+ 'outside the introspected scope, so no relation field was generated. If the target schema ' +
808
+ 'is described by an extension pack, add it to extensionPacks and re-run infer.'
809
+ );
810
+ }
811
+
740
812
  function buildScalarField(
741
813
  column: SqlColumnIR,
742
814
  table: SqlTableIR,
@@ -799,7 +871,32 @@ function buildScalarField(
799
871
  attributes.push(buildSimpleConstraintFieldAttribute('id', singlePkConstraintName));
800
872
  }
801
873
 
802
- if (column.default !== undefined) {
874
+ if (
875
+ column.default === undefined &&
876
+ column.resolvedDefault?.kind === 'function' &&
877
+ column.resolvedDefault.expression === 'autoincrement()'
878
+ ) {
879
+ // An identity column: a `resolvedDefault` with no raw `default` is the
880
+ // only introspected shape the control adapter produces for
881
+ // `GENERATED ... AS IDENTITY` (Postgres reports no `column_default`;
882
+ // the adapter stamps `autoincrement()` directly). There is no
883
+ // `identity` field on the column IR — this pairing is the marker.
884
+ attributes.push(parseDefaultAttributeString('@default(autoincrement())'));
885
+ } else if (column.many === true && column.resolvedDefault?.kind === 'literal') {
886
+ // A list column's default must print from `resolvedDefault`: the raw SQL
887
+ // text (e.g. `'{}'::text[]`) only parses to `dbgenerated(...)`, which the
888
+ // interpreter rejects on a list column (lists accept literal defaults
889
+ // only). PSL literal-list elements are string/number/boolean only, so a
890
+ // resolved value holding anything else has no spelling — the default is
891
+ // then omitted, which verify reports as a live-only "extra", not a
892
+ // false mismatch.
893
+ const formatted = Array.isArray(column.resolvedDefault.value)
894
+ ? formatPslListLiteralValue(column.resolvedDefault.value)
895
+ : undefined;
896
+ if (formatted !== undefined) {
897
+ attributes.push(parseDefaultAttributeString(`@default(${formatted})`));
898
+ }
899
+ } else if (column.default !== undefined) {
803
900
  const parsed = parseColumnDefault(column.default, column.nativeType, rawDefaultParser);
804
901
  if (parsed) {
805
902
  const result = mapDefault(parsed, defaultMapping);
@@ -989,6 +1086,27 @@ function escapePslString(value: string): string {
989
1086
  .replace(/\r/g, '\\r');
990
1087
  }
991
1088
 
1089
+ /**
1090
+ * Formats a resolved literal-default array as PSL literal-list syntax
1091
+ * (`[1, 2, 3]`, `["a", "b"]`, `[]`). PSL's list-literal grammar only accepts
1092
+ * string/number/boolean elements, so any other element (e.g. `null`, a
1093
+ * nested array/object) makes the value unrepresentable and this returns
1094
+ * `undefined`.
1095
+ */
1096
+ function formatPslListLiteralValue(elements: readonly unknown[]): string | undefined {
1097
+ const parts: string[] = [];
1098
+ for (const element of elements) {
1099
+ if (typeof element === 'string') {
1100
+ parts.push(`"${escapePslString(element)}"`);
1101
+ } else if (typeof element === 'number' || typeof element === 'boolean') {
1102
+ parts.push(String(element));
1103
+ } else {
1104
+ return undefined;
1105
+ }
1106
+ }
1107
+ return `[${parts.join(', ')}]`;
1108
+ }
1109
+
992
1110
  /**
993
1111
  * Resolves a `SqlColumnIR.default` value into a normalized {@link ColumnDefault}.
994
1112
  *
@@ -2,6 +2,7 @@ export type {
2
2
  PgBitDescriptor,
3
3
  PgBoolDescriptor,
4
4
  PgCharDescriptor,
5
+ PgDateDescriptor,
5
6
  PgEnumCodec,
6
7
  PgEnumDescriptor,
7
8
  PgFloat4Descriptor,
@@ -29,6 +30,7 @@ export {
29
30
  pgBitColumn,
30
31
  pgBoolColumn,
31
32
  pgCharColumn,
33
+ pgDateColumn,
32
34
  pgEnumDescriptor,
33
35
  pgFloat4Column,
34
36
  pgFloat8Column,
@@ -9,6 +9,7 @@ import type {
9
9
  import type { StorageColumn } from '@prisma-next/sql-contract/types';
10
10
  import { blindCast } from '@prisma-next/utils/casts';
11
11
  import { ifDefined } from '@prisma-next/utils/defined';
12
+ import { postgresResolveDefault } from '../core/default-normalizer';
12
13
  import { postgresTargetDescriptorMeta } from '../core/descriptor-meta';
13
14
  import { contractToPostgresDatabaseSchemaNode } from '../core/migrations/contract-to-postgres-database-schema-node';
14
15
  import { diffPostgresSchema } from '../core/migrations/diff-database-schema';
@@ -64,6 +65,7 @@ const postgresTargetDescriptor: SqlControlTargetDescriptor<'postgres', PostgresP
64
65
  annotationNamespace: 'pg',
65
66
  ...ifDefined('expandNativeType', expander),
66
67
  renderDefault: postgresRenderDefault,
68
+ resolveDefault: postgresResolveDefault,
67
69
  });
68
70
  },
69
71
  },
@@ -1 +1 @@
1
- export { parsePostgresDefault } from '../core/default-normalizer';
1
+ export { parsePostgresDefault, postgresResolveDefault } from '../core/default-normalizer';
@@ -10,9 +10,11 @@ export {
10
10
  CreateExtensionCall,
11
11
  CreateIndexCall,
12
12
  CreateNativeEnumTypeCall,
13
+ CreatePostgresRlsPolicyCall,
13
14
  CreateSchemaCall,
14
15
  CreateTableCall,
15
16
  DataTransformCall,
17
+ DisableRowLevelSecurityCall,
16
18
  DropCheckConstraintCall,
17
19
  DropColumnCall,
18
20
  DropConstraintCall,
@@ -20,8 +22,11 @@ export {
20
22
  DropIndexCall,
21
23
  DropNativeEnumTypeCall,
22
24
  DropNotNullCall,
25
+ DropPostgresRlsPolicyCall,
23
26
  DropTableCall,
27
+ EnableRowLevelSecurityCall,
24
28
  RawSqlCall,
29
+ RenamePostgresRlsPolicyCall,
25
30
  SetDefaultCall,
26
31
  SetNotNullCall,
27
32
  } from '../core/migrations/op-factory-call';