@prisma/migrate 6.6.0-dev.10 → 6.6.0-dev.100

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 (166) hide show
  1. package/dist/CLI.js +3 -3
  2. package/dist/Migrate.js +9 -6
  3. package/dist/SchemaEngine.js +0 -28
  4. package/dist/SchemaEngineCLI.js +29 -0
  5. package/dist/{utils/getSchemaPathAndPrint.js → SchemaEngineWasm.js} +8 -8
  6. package/dist/bin.js +52 -50
  7. package/dist/chunk-23DZXSTI.js +62 -0
  8. package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
  9. package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
  10. package/dist/chunk-33LPBNDX.js +1399 -0
  11. package/dist/{chunk-MKK3GSDF.js → chunk-344G2PKM.js} +9 -9
  12. package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
  13. package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
  14. package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
  15. package/dist/{chunk-GG54LOYV.js → chunk-A4FQW4A5.js} +54 -50
  16. package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
  17. package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
  18. package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
  19. package/dist/{chunk-N4XTKFY6.js → chunk-CLSF7VUT.js} +42 -38
  20. package/dist/{chunk-2B4IAB6L.js → chunk-CNCVJ2IN.js} +377 -532
  21. package/dist/{chunk-IR55GBON.js → chunk-CU5UT2ED.js} +19 -18
  22. package/dist/{chunk-CQZFVAXC.js → chunk-CYEVXXRH.js} +51 -47
  23. package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
  24. package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
  25. package/dist/{chunk-KS7IEA6Z.js → chunk-HIDSEBVV.js} +55 -54
  26. package/dist/{chunk-ZOEKRXDP.js → chunk-I3LT2PO3.js} +35 -57
  27. package/dist/{chunk-N3KYWSX2.js → chunk-IEEJZC3B.js} +56 -49
  28. package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
  29. package/dist/chunk-IK3BVD3Y.js +233 -0
  30. package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
  31. package/dist/{chunk-HCBZB4XC.js → chunk-KW633S3Y.js} +56 -52
  32. package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
  33. package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
  34. package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
  35. package/dist/chunk-PQKZ53DW.js +76 -0
  36. package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
  37. package/dist/{chunk-WI2A2TQE.js → chunk-SO3VXCZV.js} +93 -92
  38. package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
  39. package/dist/chunk-URKH6SE2.js +479 -0
  40. package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
  41. package/dist/{chunk-5GVIOOXU.js → chunk-W5SQWSLC.js} +378 -533
  42. package/dist/{chunk-Q3ZLC44N.js → chunk-YBS5GSRF.js} +64 -69
  43. package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
  44. package/dist/chunk-YSWLN2IJ.js +890 -0
  45. package/dist/commands/DbCommand.js +3 -3
  46. package/dist/commands/DbDrop.js +4 -5
  47. package/dist/commands/DbExecute.js +10 -7
  48. package/dist/commands/DbPull.js +17 -12
  49. package/dist/commands/DbPush.js +12 -10
  50. package/dist/commands/DbSeed.js +4 -5
  51. package/dist/commands/MigrateCommand.js +3 -3
  52. package/dist/commands/MigrateDeploy.js +14 -12
  53. package/dist/commands/MigrateDev.js +17 -15
  54. package/dist/commands/MigrateDiff.js +13 -10
  55. package/dist/commands/MigrateReset.js +16 -14
  56. package/dist/commands/MigrateResolve.js +12 -10
  57. package/dist/commands/MigrateStatus.js +12 -10
  58. package/dist/index.js +58 -57
  59. package/dist/internals/src/Generator.d.ts +23 -5
  60. package/dist/internals/src/WasmSchemaEngineLoader.d.ts +5 -0
  61. package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
  62. package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
  63. package/dist/internals/src/cli/getSchema.d.ts +3 -28
  64. package/dist/internals/src/cli/hashes.d.ts +1 -2
  65. package/dist/internals/src/cli/schemaContext.d.ts +59 -0
  66. package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
  67. package/dist/internals/src/convertCredentials.d.ts +1 -1
  68. package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
  69. package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
  70. package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
  71. package/dist/internals/src/errorReporting.d.ts +0 -1
  72. package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
  73. package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
  74. package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
  75. package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
  76. package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
  77. package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
  78. package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
  79. package/dist/internals/src/index.d.ts +9 -8
  80. package/dist/internals/src/migrateTypes.d.ts +63 -0
  81. package/dist/internals/src/panic.d.ts +1 -4
  82. package/dist/internals/src/resolvePkg.d.ts +7 -0
  83. package/dist/internals/src/types.d.ts +1 -1
  84. package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
  85. package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
  86. package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
  87. package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
  88. package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
  89. package/dist/internals/src/wasm.d.ts +3 -1
  90. package/dist/migrate/src/Migrate.d.ts +18 -7
  91. package/dist/migrate/src/SchemaEngine.d.ts +20 -50
  92. package/dist/migrate/src/SchemaEngineCLI.d.ts +139 -0
  93. package/dist/migrate/src/SchemaEngineWasm.d.ts +134 -0
  94. package/dist/migrate/src/commands/DbExecute.d.ts +1 -1
  95. package/dist/migrate/src/commands/DbPull.d.ts +1 -1
  96. package/dist/migrate/src/commands/DbPush.d.ts +1 -1
  97. package/dist/migrate/src/commands/MigrateDeploy.d.ts +1 -1
  98. package/dist/migrate/src/commands/MigrateDev.d.ts +1 -1
  99. package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -1
  100. package/dist/migrate/src/commands/MigrateReset.d.ts +1 -1
  101. package/dist/migrate/src/commands/MigrateResolve.d.ts +1 -1
  102. package/dist/migrate/src/commands/MigrateStatus.d.ts +1 -1
  103. package/dist/migrate/src/index.d.ts +2 -2
  104. package/dist/migrate/src/types.d.ts +19 -19
  105. package/dist/migrate/src/utils/createMigration.d.ts +21 -0
  106. package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
  107. package/dist/migrate/src/utils/introspectSql.d.ts +3 -2
  108. package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
  109. package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
  110. package/dist/migrate/src/utils/seed.d.ts +0 -2
  111. package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
  112. package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
  113. package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
  114. package/dist/types.js +1 -1
  115. package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
  116. package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
  117. package/dist/utils/byline.js +1 -1
  118. package/dist/utils/captureStdout.js +3 -3
  119. package/dist/utils/countModelsAndTypes.js +1 -1
  120. package/dist/utils/createMigration.js +27 -0
  121. package/dist/utils/customColors.js +1 -1
  122. package/dist/utils/ensureDatabaseExists.js +7 -7
  123. package/dist/utils/errors.js +1 -1
  124. package/dist/utils/flagErrors.js +1 -1
  125. package/dist/utils/getDatabaseVersionSafe.js +10 -5
  126. package/dist/utils/handleEvaluateDataloss.js +1 -1
  127. package/dist/utils/introspectSql.js +10 -5
  128. package/dist/utils/isSchemaEmpty.js +1 -1
  129. package/dist/utils/listMigrations.js +25 -0
  130. package/dist/utils/now.js +1 -1
  131. package/dist/utils/printDatasource.js +1 -1
  132. package/dist/utils/printDatasources.js +5 -5
  133. package/dist/utils/printFiles.js +5 -5
  134. package/dist/utils/printIntrospectedSchema.js +1 -1
  135. package/dist/utils/printMigrationId.js +1 -1
  136. package/dist/utils/promptForMigrationName.js +3 -3
  137. package/dist/utils/removeSchemaFiles.js +1 -1
  138. package/dist/utils/replaceOrAddDatasource.js +1 -1
  139. package/dist/utils/replaceOrAddDatasource.test.js +1 -1
  140. package/dist/utils/saveSchemaFiles.js +1 -1
  141. package/dist/utils/seed.js +4 -7
  142. package/dist/utils/setupCockroach.js +3 -3
  143. package/dist/utils/setupMSSQL.js +1478 -707
  144. package/dist/utils/setupMongo.js +553 -552
  145. package/dist/utils/setupMysql.js +508 -563
  146. package/dist/utils/setupPostgres.js +3 -3
  147. package/dist/utils/spinner.js +4 -3
  148. package/dist/utils/test-handlePanic.js +1 -30
  149. package/dist/utils/unixSocket.js +1 -1
  150. package/dist/views/handleViewsIO.js +3 -3
  151. package/package.json +12 -11
  152. package/dist/chunk-GKDFIHM2.js +0 -45
  153. package/dist/chunk-J46BJQHT.js +0 -268
  154. package/dist/chunk-KOF4LGTS.js +0 -1817
  155. package/dist/chunk-YYPMC5FN.js +0 -1407
  156. package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
  157. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
  158. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
  159. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
  160. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
  161. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
  162. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
  163. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
  164. package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
  165. package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
  166. package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
@@ -26,18 +26,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_MATFO4ZW_exports = {};
30
- __export(chunk_MATFO4ZW_exports, {
29
+ var chunk_OEWQACEH_exports = {};
30
+ __export(chunk_OEWQACEH_exports, {
31
31
  N: () => N,
32
32
  handleViewsIO: () => handleViewsIO,
33
33
  require_function: () => require_function,
34
34
  z: () => z
35
35
  });
36
- module.exports = __toCommonJS(chunk_MATFO4ZW_exports);
37
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
36
+ module.exports = __toCommonJS(chunk_OEWQACEH_exports);
37
+ var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
38
38
  var import_internals = require("@prisma/internals");
39
39
  var import_path = __toESM(require("path"));
40
- var require_function = (0, import_chunk_WWAWV7DQ.__commonJS)({
40
+ var require_function = (0, import_chunk_2ESYSVXG.__commonJS)({
41
41
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/function.js"(exports) {
42
42
  "use strict";
43
43
  var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
@@ -324,7 +324,7 @@ var require_function = (0, import_chunk_WWAWV7DQ.__commonJS)({
324
324
  exports.dual = dual;
325
325
  }
326
326
  });
327
- var require_internal = (0, import_chunk_WWAWV7DQ.__commonJS)({
327
+ var require_internal = (0, import_chunk_2ESYSVXG.__commonJS)({
328
328
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/internal.js"(exports) {
329
329
  "use strict";
330
330
  var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
@@ -463,7 +463,7 @@ var require_internal = (0, import_chunk_WWAWV7DQ.__commonJS)({
463
463
  exports.flatMapReader = flatMapReader;
464
464
  }
465
465
  });
466
- var require_Apply = (0, import_chunk_WWAWV7DQ.__commonJS)({
466
+ var require_Apply = (0, import_chunk_2ESYSVXG.__commonJS)({
467
467
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Apply.js"(exports) {
468
468
  "use strict";
469
469
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -705,7 +705,7 @@ var require_Apply = (0, import_chunk_WWAWV7DQ.__commonJS)({
705
705
  }
706
706
  }
707
707
  });
708
- var require_Functor = (0, import_chunk_WWAWV7DQ.__commonJS)({
708
+ var require_Functor = (0, import_chunk_2ESYSVXG.__commonJS)({
709
709
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Functor.js"(exports) {
710
710
  "use strict";
711
711
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -778,7 +778,7 @@ var require_Functor = (0, import_chunk_WWAWV7DQ.__commonJS)({
778
778
  }
779
779
  }
780
780
  });
781
- var require_Applicative = (0, import_chunk_WWAWV7DQ.__commonJS)({
781
+ var require_Applicative = (0, import_chunk_2ESYSVXG.__commonJS)({
782
782
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Applicative.js"(exports) {
783
783
  "use strict";
784
784
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -811,7 +811,7 @@ var require_Applicative = (0, import_chunk_WWAWV7DQ.__commonJS)({
811
811
  }
812
812
  }
813
813
  });
814
- var require_Chain = (0, import_chunk_WWAWV7DQ.__commonJS)({
814
+ var require_Chain = (0, import_chunk_2ESYSVXG.__commonJS)({
815
815
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Chain.js"(exports) {
816
816
  "use strict";
817
817
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -849,7 +849,7 @@ var require_Chain = (0, import_chunk_WWAWV7DQ.__commonJS)({
849
849
  }
850
850
  }
851
851
  });
852
- var require_ChainRec = (0, import_chunk_WWAWV7DQ.__commonJS)({
852
+ var require_ChainRec = (0, import_chunk_2ESYSVXG.__commonJS)({
853
853
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/ChainRec.js"(exports) {
854
854
  "use strict";
855
855
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -864,7 +864,7 @@ var require_ChainRec = (0, import_chunk_WWAWV7DQ.__commonJS)({
864
864
  exports.tailRec = tailRec;
865
865
  }
866
866
  });
867
- var require_FromEither = (0, import_chunk_WWAWV7DQ.__commonJS)({
867
+ var require_FromEither = (0, import_chunk_2ESYSVXG.__commonJS)({
868
868
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/FromEither.js"(exports) {
869
869
  "use strict";
870
870
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -980,7 +980,7 @@ var require_FromEither = (0, import_chunk_WWAWV7DQ.__commonJS)({
980
980
  }
981
981
  }
982
982
  });
983
- var require_Separated = (0, import_chunk_WWAWV7DQ.__commonJS)({
983
+ var require_Separated = (0, import_chunk_2ESYSVXG.__commonJS)({
984
984
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Separated.js"(exports) {
985
985
  "use strict";
986
986
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1039,7 +1039,7 @@ var require_Separated = (0, import_chunk_WWAWV7DQ.__commonJS)({
1039
1039
  exports.right = right;
1040
1040
  }
1041
1041
  });
1042
- var require_Witherable = (0, import_chunk_WWAWV7DQ.__commonJS)({
1042
+ var require_Witherable = (0, import_chunk_2ESYSVXG.__commonJS)({
1043
1043
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Witherable.js"(exports) {
1044
1044
  "use strict";
1045
1045
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -1106,7 +1106,7 @@ var require_Witherable = (0, import_chunk_WWAWV7DQ.__commonJS)({
1106
1106
  }
1107
1107
  }
1108
1108
  });
1109
- var require_Either = (0, import_chunk_WWAWV7DQ.__commonJS)({
1109
+ var require_Either = (0, import_chunk_2ESYSVXG.__commonJS)({
1110
1110
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Either.js"(exports) {
1111
1111
  "use strict";
1112
1112
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -1714,7 +1714,7 @@ var require_Either = (0, import_chunk_WWAWV7DQ.__commonJS)({
1714
1714
  }
1715
1715
  }
1716
1716
  });
1717
- var require_FromIO = (0, import_chunk_WWAWV7DQ.__commonJS)({
1717
+ var require_FromIO = (0, import_chunk_2ESYSVXG.__commonJS)({
1718
1718
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/FromIO.js"(exports) {
1719
1719
  "use strict";
1720
1720
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1753,7 +1753,7 @@ var require_FromIO = (0, import_chunk_WWAWV7DQ.__commonJS)({
1753
1753
  }
1754
1754
  }
1755
1755
  });
1756
- var require_Task = (0, import_chunk_WWAWV7DQ.__commonJS)({
1756
+ var require_Task = (0, import_chunk_2ESYSVXG.__commonJS)({
1757
1757
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Task.js"(exports) {
1758
1758
  "use strict";
1759
1759
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -2048,7 +2048,7 @@ var require_Task = (0, import_chunk_WWAWV7DQ.__commonJS)({
2048
2048
  exports.getMonoid = (0, Applicative_1.getApplicativeMonoid)(exports.ApplicativeSeq);
2049
2049
  }
2050
2050
  });
2051
- var require_Predicate = (0, import_chunk_WWAWV7DQ.__commonJS)({
2051
+ var require_Predicate = (0, import_chunk_2ESYSVXG.__commonJS)({
2052
2052
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Predicate.js"(exports) {
2053
2053
  "use strict";
2054
2054
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2122,7 +2122,7 @@ var require_Predicate = (0, import_chunk_WWAWV7DQ.__commonJS)({
2122
2122
  exports.and = and;
2123
2123
  }
2124
2124
  });
2125
- var require_Magma = (0, import_chunk_WWAWV7DQ.__commonJS)({
2125
+ var require_Magma = (0, import_chunk_2ESYSVXG.__commonJS)({
2126
2126
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Magma.js"(exports) {
2127
2127
  "use strict";
2128
2128
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2177,7 +2177,7 @@ var require_Magma = (0, import_chunk_WWAWV7DQ.__commonJS)({
2177
2177
  exports.concatAll = concatAll;
2178
2178
  }
2179
2179
  });
2180
- var require_Eq = (0, import_chunk_WWAWV7DQ.__commonJS)({
2180
+ var require_Eq = (0, import_chunk_2ESYSVXG.__commonJS)({
2181
2181
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Eq.js"(exports) {
2182
2182
  "use strict";
2183
2183
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2271,7 +2271,7 @@ var require_Eq = (0, import_chunk_WWAWV7DQ.__commonJS)({
2271
2271
  };
2272
2272
  }
2273
2273
  });
2274
- var require_Ord = (0, import_chunk_WWAWV7DQ.__commonJS)({
2274
+ var require_Ord = (0, import_chunk_2ESYSVXG.__commonJS)({
2275
2275
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Ord.js"(exports) {
2276
2276
  "use strict";
2277
2277
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2441,7 +2441,7 @@ var require_Ord = (0, import_chunk_WWAWV7DQ.__commonJS)({
2441
2441
  );
2442
2442
  }
2443
2443
  });
2444
- var require_Semigroup = (0, import_chunk_WWAWV7DQ.__commonJS)({
2444
+ var require_Semigroup = (0, import_chunk_2ESYSVXG.__commonJS)({
2445
2445
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Semigroup.js"(exports) {
2446
2446
  "use strict";
2447
2447
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -2599,7 +2599,7 @@ var require_Semigroup = (0, import_chunk_WWAWV7DQ.__commonJS)({
2599
2599
  };
2600
2600
  }
2601
2601
  });
2602
- var require_Zero = (0, import_chunk_WWAWV7DQ.__commonJS)({
2602
+ var require_Zero = (0, import_chunk_2ESYSVXG.__commonJS)({
2603
2603
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Zero.js"(exports) {
2604
2604
  "use strict";
2605
2605
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -2611,7 +2611,7 @@ var require_Zero = (0, import_chunk_WWAWV7DQ.__commonJS)({
2611
2611
  }
2612
2612
  }
2613
2613
  });
2614
- var require_Option = (0, import_chunk_WWAWV7DQ.__commonJS)({
2614
+ var require_Option = (0, import_chunk_2ESYSVXG.__commonJS)({
2615
2615
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Option.js"(exports) {
2616
2616
  "use strict";
2617
2617
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -3153,7 +3153,7 @@ var require_Option = (0, import_chunk_WWAWV7DQ.__commonJS)({
3153
3153
  exports.getLastMonoid = getLastMonoid;
3154
3154
  }
3155
3155
  });
3156
- var require_Compactable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3156
+ var require_Compactable = (0, import_chunk_2ESYSVXG.__commonJS)({
3157
3157
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Compactable.js"(exports) {
3158
3158
  "use strict";
3159
3159
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -3213,7 +3213,7 @@ var require_Compactable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3213
3213
  }
3214
3214
  }
3215
3215
  });
3216
- var require_EitherT = (0, import_chunk_WWAWV7DQ.__commonJS)({
3216
+ var require_EitherT = (0, import_chunk_2ESYSVXG.__commonJS)({
3217
3217
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/EitherT.js"(exports) {
3218
3218
  "use strict";
3219
3219
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -3498,7 +3498,7 @@ var require_EitherT = (0, import_chunk_WWAWV7DQ.__commonJS)({
3498
3498
  }
3499
3499
  }
3500
3500
  });
3501
- var require_Filterable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3501
+ var require_Filterable = (0, import_chunk_2ESYSVXG.__commonJS)({
3502
3502
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/Filterable.js"(exports) {
3503
3503
  "use strict";
3504
3504
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3581,7 +3581,7 @@ var require_Filterable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3581
3581
  }
3582
3582
  }
3583
3583
  });
3584
- var require_FromTask = (0, import_chunk_WWAWV7DQ.__commonJS)({
3584
+ var require_FromTask = (0, import_chunk_2ESYSVXG.__commonJS)({
3585
3585
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/FromTask.js"(exports) {
3586
3586
  "use strict";
3587
3587
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3620,7 +3620,7 @@ var require_FromTask = (0, import_chunk_WWAWV7DQ.__commonJS)({
3620
3620
  }
3621
3621
  }
3622
3622
  });
3623
- var require_TaskEither = (0, import_chunk_WWAWV7DQ.__commonJS)({
3623
+ var require_TaskEither = (0, import_chunk_2ESYSVXG.__commonJS)({
3624
3624
  "../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/lib/TaskEither.js"(exports) {
3625
3625
  "use strict";
3626
3626
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
@@ -4251,10 +4251,10 @@ var require_TaskEither = (0, import_chunk_WWAWV7DQ.__commonJS)({
4251
4251
  }
4252
4252
  }
4253
4253
  });
4254
- var E2 = (0, import_chunk_WWAWV7DQ.__toESM)(require_Either());
4255
- var import_function = (0, import_chunk_WWAWV7DQ.__toESM)(require_function());
4256
- var T2 = (0, import_chunk_WWAWV7DQ.__toESM)(require_Task());
4257
- var TE = (0, import_chunk_WWAWV7DQ.__toESM)(require_TaskEither());
4254
+ var E2 = (0, import_chunk_2ESYSVXG.__toESM)(require_Either());
4255
+ var import_function = (0, import_chunk_2ESYSVXG.__toESM)(require_function());
4256
+ var T2 = (0, import_chunk_2ESYSVXG.__toESM)(require_Task());
4257
+ var TE = (0, import_chunk_2ESYSVXG.__toESM)(require_TaskEither());
4258
4258
  var t = Symbol.for("@ts-pattern/matcher");
4259
4259
  var e = Symbol.for("@ts-pattern/isVariadic");
4260
4260
  var n = "@ts-pattern/anonymous-select-key";
@@ -4512,15 +4512,14 @@ var I = class _I {
4512
4512
  return this;
4513
4513
  }
4514
4514
  };
4515
- async function handleViewsIO({ views, schemaPath }) {
4516
- const prismaDir = import_path.default.dirname((0, import_internals.pathToPosix)(schemaPath));
4517
- const viewsDir = import_path.default.posix.join(prismaDir, "views");
4515
+ async function handleViewsIO({ views, viewsDirectoryPath }) {
4516
+ const posixViewsDirectoryPath = (0, import_internals.pathToPosix)(viewsDirectoryPath);
4518
4517
  if (views.length === 0) {
4519
- await cleanLeftoversIO(viewsDir);
4518
+ await cleanLeftoversIO(posixViewsDirectoryPath);
4520
4519
  return;
4521
4520
  }
4522
- const { viewFilesToKeep } = await createViewsIO(viewsDir, views);
4523
- await cleanLeftoversIO(viewsDir, viewFilesToKeep);
4521
+ const { viewFilesToKeep } = await createViewsIO(posixViewsDirectoryPath, views);
4522
+ await cleanLeftoversIO(posixViewsDirectoryPath, viewFilesToKeep);
4524
4523
  }
4525
4524
  async function createViewsIO(viewsDir, views) {
4526
4525
  const viewEntries = views.map(({ schema, ...rest }) => {
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_PQKZ53DW_exports = {};
30
+ __export(chunk_PQKZ53DW_exports, {
31
+ listMigrations: () => listMigrations
32
+ });
33
+ module.exports = __toCommonJS(chunk_PQKZ53DW_exports);
34
+ var import_promises = __toESM(require("node:fs/promises"));
35
+ var import_node_path = __toESM(require("node:path"));
36
+ async function listMigrations(migrationsDirectoryPath) {
37
+ const baseDir = migrationsDirectoryPath;
38
+ const lockfileName = "migration_lock.toml";
39
+ const lockfileContent = await import_promises.default.readFile(import_node_path.default.join(migrationsDirectoryPath, lockfileName), { encoding: "utf-8" }).catch(() => null);
40
+ const lockfile = {
41
+ path: lockfileName,
42
+ content: lockfileContent
43
+ };
44
+ let entries = [];
45
+ try {
46
+ entries = await import_promises.default.readdir(migrationsDirectoryPath, { withFileTypes: true, recursive: false }).catch((_) => []);
47
+ } catch (error) {
48
+ if (error.code === "ENOENT") {
49
+ return {
50
+ baseDir,
51
+ lockfile,
52
+ migrationDirectories: []
53
+ };
54
+ }
55
+ throw error;
56
+ }
57
+ const migrationDirectories = [];
58
+ for (const entry of entries.filter((entry2) => entry2.isDirectory())) {
59
+ const migrationPath = import_node_path.default.join(baseDir, entry.name);
60
+ const migrationFileName = "migration.sql";
61
+ const migrationFileContent = await import_promises.default.readFile(import_node_path.default.join(migrationPath, migrationFileName), { encoding: "utf-8" }).then((content) => ({ tag: "ok", value: content })).catch((error) => ({ tag: "error", value: error.message }));
62
+ migrationDirectories.push({
63
+ path: entry.name,
64
+ migrationFile: {
65
+ path: migrationFileName,
66
+ content: migrationFileContent
67
+ }
68
+ });
69
+ }
70
+ const sortedMigrations = migrationDirectories.sort((a, b) => a.path.localeCompare(b.path));
71
+ return {
72
+ baseDir,
73
+ lockfile,
74
+ migrationDirectories: sortedMigrations
75
+ };
76
+ }