@prisma/migrate 5.23.0-dev.19 → 5.23.0-dev.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/dist/Migrate.js +4 -4
  2. package/dist/SchemaEngine.js +4 -4
  3. package/dist/bin.js +35 -35
  4. package/dist/{chunk-EXUBPCXZ.js → chunk-3H4RLVCQ.js} +12 -12
  5. package/dist/{chunk-75AMGQ4R.js → chunk-GUBDW6S7.js} +6 -6
  6. package/dist/{chunk-BAVMZZAR.js → chunk-HODZFC64.js} +7 -7
  7. package/dist/{chunk-BAFPAACN.js → chunk-ILJRJJ3S.js} +4 -4
  8. package/dist/{chunk-O6RO4YUZ.js → chunk-ILQWQHQO.js} +6 -6
  9. package/dist/{chunk-76XWADEV.js → chunk-KEPR65SW.js} +6 -6
  10. package/dist/{chunk-M2HXROCC.js → chunk-LAHPBQAT.js} +58 -54
  11. package/dist/{chunk-MWEO3VUS.js → chunk-LJOMIPJW.js} +7 -7
  12. package/dist/{chunk-GJN3CSXW.js → chunk-NKL64AIB.js} +6 -6
  13. package/dist/{chunk-VWV2NY26.js → chunk-NKQGJ3AE.js} +7 -3
  14. package/dist/{chunk-XLLUFIQK.js → chunk-PCJYN6LT.js} +6 -5
  15. package/dist/{chunk-SV5GANSI.js → chunk-PFEH6ILG.js} +6 -6
  16. package/dist/{chunk-ZBOJAYON.js → chunk-PNBMPQYH.js} +6 -6
  17. package/dist/{chunk-W3ROQKBN.js → chunk-V7DE6JTG.js} +4 -4
  18. package/dist/{chunk-HPBKCC4U.js → chunk-WCDK5V6K.js} +59 -55
  19. package/dist/{chunk-UJWMQPUH.js → chunk-X6GGREJW.js} +6 -6
  20. package/dist/{chunk-YOW3VBYS.js → chunk-Z4OLB2H4.js} +6 -6
  21. package/dist/commands/DbExecute.js +5 -5
  22. package/dist/commands/DbPull.js +6 -6
  23. package/dist/commands/DbPush.js +5 -5
  24. package/dist/commands/MigrateDeploy.js +5 -5
  25. package/dist/commands/MigrateDev.js +5 -5
  26. package/dist/commands/MigrateDiff.js +6 -6
  27. package/dist/commands/MigrateReset.js +5 -5
  28. package/dist/commands/MigrateResolve.js +5 -5
  29. package/dist/commands/MigrateStatus.js +5 -5
  30. package/dist/index.js +41 -41
  31. package/dist/{multipart-parser-KKECAI5D.js → multipart-parser-73VM3J4A.js} +10 -7
  32. package/dist/{multipart-parser-47FFAP42-P3F6TPHJ.js → multipart-parser-ITART6UP-FFJAMHWE.js} +25 -22
  33. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  34. package/dist/utils/introspectSql.js +3 -3
  35. package/dist/utils/removeSchemaFiles.js +3 -3
  36. package/dist/utils/saveSchemaFiles.js +3 -3
  37. package/dist/utils/setupMSSQL.js +49 -46
  38. package/dist/utils/setupMongo.js +2 -1
  39. package/dist/utils/setupMysql.js +45 -0
  40. package/package.json +6 -6
@@ -26,38 +26,38 @@ 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_M2HXROCC_exports = {};
30
- __export(chunk_M2HXROCC_exports, {
29
+ var chunk_LAHPBQAT_exports = {};
30
+ __export(chunk_LAHPBQAT_exports, {
31
31
  MigrateDiff: () => MigrateDiff,
32
32
  init_MigrateDiff: () => init_MigrateDiff
33
33
  });
34
- module.exports = __toCommonJS(chunk_M2HXROCC_exports);
35
- var import_chunk_VWV2NY26 = require("./chunk-VWV2NY26.js");
34
+ module.exports = __toCommonJS(chunk_LAHPBQAT_exports);
35
+ var import_chunk_NKQGJ3AE = require("./chunk-NKQGJ3AE.js");
36
36
  var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
37
37
  var import_chunk_TKAGMA5K = require("./chunk-TKAGMA5K.js");
38
- var import_chunk_MWEO3VUS = require("./chunk-MWEO3VUS.js");
38
+ var import_chunk_LJOMIPJW = require("./chunk-LJOMIPJW.js");
39
39
  var import_chunk_LVFPGUOH = require("./chunk-LVFPGUOH.js");
40
40
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
41
41
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
42
- var import_process = __toESM(require("process"));
43
- var import_promises = __toESM(require("fs/promises"));
44
- var import_url = require("url");
45
- var import_path = __toESM(require("path"));
46
- var import_url2 = require("url");
47
- var import_promises2 = __toESM(require("fs/promises"));
48
- var import_path2 = __toESM(require("path"));
49
- var import_path3 = __toESM(require("path"));
42
+ var import_node_process = __toESM(require("node:process"));
43
+ var import_promises = __toESM(require("node:fs/promises"));
44
+ var import_node_url = require("node:url");
45
+ var import_node_path = __toESM(require("node:path"));
46
+ var import_node_url2 = require("node:url");
47
+ var import_promises2 = __toESM(require("node:fs/promises"));
48
+ var import_node_path2 = __toESM(require("node:path"));
49
+ var import_node_path3 = __toESM(require("node:path"));
50
50
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
51
- var import_path4 = __toESM(require("path"));
51
+ var import_node_path4 = __toESM(require("node:path"));
52
52
  var import_debug = __toESM(require("@prisma/debug"));
53
53
  var import_get_platform = require("@prisma/get-platform");
54
54
  var import_debug2 = require("@prisma/debug");
55
55
  var import_fs = __toESM(require("fs"));
56
- var import_path5 = __toESM(require("path"));
56
+ var import_path = __toESM(require("path"));
57
57
  var import_util = require("util");
58
58
  var import_debug3 = __toESM(require("@prisma/debug"));
59
59
  var import_internals = require("@prisma/internals");
60
- var import_path6 = __toESM(require("path"));
60
+ var import_path2 = __toESM(require("path"));
61
61
  var require_promisify = (0, import_chunk_WWAWV7DQ.__commonJS)({
62
62
  "../../node_modules/.pnpm/fs-jetpack@5.1.0/node_modules/fs-jetpack/lib/utils/promisify.js"(exports, module2) {
63
63
  "use strict";
@@ -1614,6 +1614,7 @@ var require_minimatch = (0, import_chunk_WWAWV7DQ.__commonJS)({
1614
1614
  continue;
1615
1615
  }
1616
1616
  switch (c) {
1617
+ /* istanbul ignore next */
1617
1618
  case "/": {
1618
1619
  return false;
1619
1620
  }
@@ -1621,6 +1622,8 @@ var require_minimatch = (0, import_chunk_WWAWV7DQ.__commonJS)({
1621
1622
  clearStateChar();
1622
1623
  escaping = true;
1623
1624
  continue;
1625
+ // the various stateChar values
1626
+ // for the "extglob" stuff.
1624
1627
  case "?":
1625
1628
  case "*":
1626
1629
  case "+":
@@ -1680,6 +1683,7 @@ var require_minimatch = (0, import_chunk_WWAWV7DQ.__commonJS)({
1680
1683
  clearStateChar();
1681
1684
  re += "|";
1682
1685
  continue;
1686
+ // these are mostly the same in regexp and glob
1683
1687
  case "[":
1684
1688
  clearStateChar();
1685
1689
  if (inClass) {
@@ -6166,9 +6170,9 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
6166
6170
  usesPrismaSchemaFolder: () => usesPrismaSchemaFolder2
6167
6171
  });
6168
6172
  module2.exports = __toCommonJS2(src_exports);
6169
- var import_node_path22 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("path"));
6173
+ var import_node_path22 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("node:path"));
6170
6174
  var import_prisma_schema_wasm2 = (0, import_chunk_WWAWV7DQ.__require)("@prisma/prisma-schema-wasm");
6171
- var import_node_path5 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("path"));
6175
+ var import_node_path5 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("node:path"));
6172
6176
  function createFileNameToKeyMapper(options) {
6173
6177
  if (options.caseSensitive) {
6174
6178
  return (fileName) => fileName;
@@ -6393,15 +6397,15 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
6393
6397
  }
6394
6398
  });
6395
6399
  async function findUp(name, {
6396
- cwd = import_process.default.cwd(),
6400
+ cwd = import_node_process.default.cwd(),
6397
6401
  type = "file",
6398
6402
  stopAt
6399
6403
  } = {}) {
6400
- let directory = import_path.default.resolve(toPath(cwd) ?? "");
6401
- const { root } = import_path.default.parse(directory);
6402
- stopAt = import_path.default.resolve(directory, toPath(stopAt ?? root));
6404
+ let directory = import_node_path.default.resolve(toPath(cwd) ?? "");
6405
+ const { root } = import_node_path.default.parse(directory);
6406
+ stopAt = import_node_path.default.resolve(directory, toPath(stopAt ?? root));
6403
6407
  while (directory && directory !== stopAt && directory !== root) {
6404
- const filePath = import_path.default.isAbsolute(name) ? name : import_path.default.join(directory, name);
6408
+ const filePath = import_node_path.default.isAbsolute(name) ? name : import_node_path.default.join(directory, name);
6405
6409
  try {
6406
6410
  const stats = await import_promises.default.stat(filePath);
6407
6411
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) {
@@ -6409,14 +6413,14 @@ async function findUp(name, {
6409
6413
  }
6410
6414
  } catch {
6411
6415
  }
6412
- directory = import_path.default.dirname(directory);
6416
+ directory = import_node_path.default.dirname(directory);
6413
6417
  }
6414
6418
  }
6415
6419
  var toPath;
6416
6420
  var init_find_up_simple = (0, import_chunk_WWAWV7DQ.__esm)({
6417
6421
  "../../node_modules/.pnpm/find-up-simple@1.0.0/node_modules/find-up-simple/index.js"() {
6418
6422
  "use strict";
6419
- toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_url.fileURLToPath)(urlOrPath) : urlOrPath;
6423
+ toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
6420
6424
  }
6421
6425
  });
6422
6426
  var require_js_tokens = (0, import_chunk_WWAWV7DQ.__commonJS)({
@@ -10688,8 +10692,8 @@ var require_typos = (0, import_chunk_WWAWV7DQ.__commonJS)({
10688
10692
  var require_fixer = (0, import_chunk_WWAWV7DQ.__commonJS)({
10689
10693
  "../../node_modules/.pnpm/normalize-package-data@6.0.0/node_modules/normalize-package-data/lib/fixer.js"(exports, module2) {
10690
10694
  "use strict";
10691
- var isValidSemver = (0, import_chunk_VWV2NY26.require_valid)();
10692
- var cleanSemver = (0, import_chunk_VWV2NY26.require_clean)();
10695
+ var isValidSemver = (0, import_chunk_NKQGJ3AE.require_valid)();
10696
+ var cleanSemver = (0, import_chunk_NKQGJ3AE.require_clean)();
10693
10697
  var validateLicense = require_validate_npm_package_license();
10694
10698
  var hostedGitInfo = require_lib5();
10695
10699
  var isBuiltinModule = require_is_core_module();
@@ -11237,7 +11241,7 @@ var init_default = (0, import_chunk_WWAWV7DQ.__esm)({
11237
11241
  }
11238
11242
  });
11239
11243
  function toPath2(urlOrPath) {
11240
- return urlOrPath instanceof URL ? (0, import_url2.fileURLToPath)(urlOrPath) : urlOrPath;
11244
+ return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
11241
11245
  }
11242
11246
  var init_node = (0, import_chunk_WWAWV7DQ.__esm)({
11243
11247
  "../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js"() {
@@ -11256,7 +11260,7 @@ var init_read_pkg = (0, import_chunk_WWAWV7DQ.__esm)({
11256
11260
  init_parse_json();
11257
11261
  import_normalize_package_data = (0, import_chunk_WWAWV7DQ.__toESM)(require_normalize(), 1);
11258
11262
  init_node();
11259
- getPackagePath = (cwd) => import_path2.default.resolve(toPath2(cwd) ?? ".", "package.json");
11263
+ getPackagePath = (cwd) => import_node_path2.default.resolve(toPath2(cwd) ?? ".", "package.json");
11260
11264
  _readPackage = (file, normalize) => {
11261
11265
  const json = typeof file === "string" ? parseJson(file) : file;
11262
11266
  if (normalize) {
@@ -11272,7 +11276,7 @@ async function readPackageUp(options) {
11272
11276
  return;
11273
11277
  }
11274
11278
  return {
11275
- packageJson: await readPackage({ ...options, cwd: import_path3.default.dirname(filePath) }),
11279
+ packageJson: await readPackage({ ...options, cwd: import_node_path3.default.dirname(filePath) }),
11276
11280
  path: filePath
11277
11281
  };
11278
11282
  }
@@ -11565,7 +11569,7 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
11565
11569
  "checkpoint-client": "1.1.33",
11566
11570
  "cli-truncate": "2.1.0",
11567
11571
  dotenv: "16.0.3",
11568
- esbuild: "0.23.0",
11572
+ esbuild: "0.24.0",
11569
11573
  "escape-string-regexp": "4.0.0",
11570
11574
  execa: "5.1.1",
11571
11575
  "fast-glob": "3.3.2",
@@ -11670,7 +11674,7 @@ var init_errorHelpers = (0, import_chunk_WWAWV7DQ.__esm)({
11670
11674
  }
11671
11675
  });
11672
11676
  function relativizePathInPSLError(error) {
11673
- return error.replaceAll(process.cwd() + import_path4.default.sep, "");
11677
+ return error.replaceAll(process.cwd() + import_node_path4.default.sep, "");
11674
11678
  }
11675
11679
  var init_relativizePathInPSLError = (0, import_chunk_WWAWV7DQ.__esm)({
11676
11680
  "../internals/src/engine-commands/relativizePathInPSLError.ts"() {
@@ -11901,7 +11905,7 @@ async function readSchemaFromSingleFile(schemaPath) {
11901
11905
  const schemaTuple = [schemaPath, file];
11902
11906
  return {
11903
11907
  ok: true,
11904
- schema: { schemaPath, schemaRootDir: import_path5.default.dirname(schemaPath), schemas: [schemaTuple] }
11908
+ schema: { schemaPath, schemaRootDir: import_path.default.dirname(schemaPath), schemas: [schemaTuple] }
11905
11909
  };
11906
11910
  }
11907
11911
  async function readSchemaFromDirectory(schemaPath) {
@@ -11959,10 +11963,10 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
11959
11963
  }
11960
11964
  async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName }) {
11961
11965
  if (schemaPathFromArgs) {
11962
- const absPath = import_path5.default.resolve(cwd, schemaPathFromArgs);
11966
+ const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
11963
11967
  const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
11964
11968
  if (!customSchemaResult.ok) {
11965
- const relPath = import_path5.default.relative(cwd, absPath);
11969
+ const relPath = import_path.default.relative(cwd, absPath);
11966
11970
  throw new Error(
11967
11971
  `Could not load \`${argumentName}\` from provided path \`${relPath}\`: ${renderLookupError(
11968
11972
  customSchemaResult.error
@@ -12008,7 +12012,7 @@ function renderDefaultLookupError(error, cwd) {
12008
12012
  for (const failure of error.failures) {
12009
12013
  const filePath = failure.rule.schemaPath.path;
12010
12014
  if (!printedPaths.has(failure.rule.schemaPath.path)) {
12011
- parts.push(`${import_path5.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
12015
+ parts.push(`${import_path.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
12012
12016
  printedPaths.add(filePath);
12013
12017
  }
12014
12018
  }
@@ -12035,20 +12039,20 @@ async function getSchemaFromPackageJson(cwd) {
12035
12039
  const schemaPathFromPkgJson = prismaConfig.data.schema;
12036
12040
  if (typeof schemaPathFromPkgJson !== "string") {
12037
12041
  throw new Error(
12038
- `Provided schema path \`${schemaPathFromPkgJson}\` from \`${import_path5.default.relative(
12042
+ `Provided schema path \`${schemaPathFromPkgJson}\` from \`${import_path.default.relative(
12039
12043
  cwd,
12040
12044
  prismaConfig.packagePath
12041
12045
  )}\` must be of type string`
12042
12046
  );
12043
12047
  }
12044
- const absoluteSchemaPath = import_path5.default.isAbsolute(schemaPathFromPkgJson) ? schemaPathFromPkgJson : import_path5.default.resolve(import_path5.default.dirname(prismaConfig.packagePath), schemaPathFromPkgJson);
12048
+ const absoluteSchemaPath = import_path.default.isAbsolute(schemaPathFromPkgJson) ? schemaPathFromPkgJson : import_path.default.resolve(import_path.default.dirname(prismaConfig.packagePath), schemaPathFromPkgJson);
12045
12049
  const lookupResult = await readSchemaFromFileOrDirectory(absoluteSchemaPath);
12046
12050
  if (!lookupResult.ok) {
12047
12051
  throw new Error(
12048
- `Could not load schema from \`${import_path5.default.relative(
12052
+ `Could not load schema from \`${import_path.default.relative(
12049
12053
  cwd,
12050
12054
  absoluteSchemaPath
12051
- )}\` provided by "prisma.schema" config of \`${import_path5.default.relative(
12055
+ )}\` provided by "prisma.schema" config of \`${import_path.default.relative(
12052
12056
  cwd,
12053
12057
  prismaConfig.packagePath
12054
12058
  )}\`: ${renderLookupError(lookupResult.error)}`
@@ -12059,27 +12063,27 @@ async function getSchemaFromPackageJson(cwd) {
12059
12063
  async function getDefaultSchema(cwd, failures = []) {
12060
12064
  const schemaPrisma = {
12061
12065
  schemaPath: {
12062
- path: import_path5.default.join(cwd, "schema.prisma"),
12066
+ path: import_path.default.join(cwd, "schema.prisma"),
12063
12067
  kind: "file"
12064
12068
  }
12065
12069
  };
12066
12070
  const prismaSchemaFile = {
12067
12071
  schemaPath: {
12068
- path: import_path5.default.join(cwd, "prisma", "schema.prisma"),
12072
+ path: import_path.default.join(cwd, "prisma", "schema.prisma"),
12069
12073
  kind: "file"
12070
12074
  },
12071
12075
  conflictsWith: {
12072
- path: import_path5.default.join(cwd, "prisma", "schema"),
12076
+ path: import_path.default.join(cwd, "prisma", "schema"),
12073
12077
  kind: "directory"
12074
12078
  }
12075
12079
  };
12076
12080
  const prismaSchemaFolder = {
12077
12081
  schemaPath: {
12078
- path: import_path5.default.join(cwd, "prisma", "schema"),
12082
+ path: import_path.default.join(cwd, "prisma", "schema"),
12079
12083
  kind: "directory"
12080
12084
  },
12081
12085
  conflictsWith: {
12082
- path: import_path5.default.join(cwd, "prisma", "schema.prisma"),
12086
+ path: import_path.default.join(cwd, "prisma", "schema.prisma"),
12083
12087
  kind: "file"
12084
12088
  }
12085
12089
  };
@@ -12095,7 +12099,7 @@ async function getDefaultSchema(cwd, failures = []) {
12095
12099
  const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
12096
12100
  if (conflictingSchema.ok) {
12097
12101
  throw new Error(
12098
- `Found Prisma Schemas at both \`${import_path5.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path5.default.relative(
12102
+ `Found Prisma Schemas at both \`${import_path.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path.default.relative(
12099
12103
  cwd,
12100
12104
  rule.conflictsWith.path
12101
12105
  )}\`. Please remove one.`
@@ -12139,7 +12143,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
12139
12143
  import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
12140
12144
  (0, import_chunk_6TE2RIPN.init_colors)();
12141
12145
  init_getSchema();
12142
- (0, import_chunk_MWEO3VUS.init_Migrate)();
12146
+ (0, import_chunk_LJOMIPJW.init_Migrate)();
12143
12147
  (0, import_chunk_TKAGMA5K.init_captureStdout)();
12144
12148
  debug3 = (0, import_debug3.default)("prisma:migrate:diff");
12145
12149
  helpOptions = (0, import_internals.format)(
@@ -12244,7 +12248,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12244
12248
  };
12245
12249
  } else if (args["--from-schema-datasource"]) {
12246
12250
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false });
12247
- const schema = await getSchemaWithPath(import_path6.default.resolve(args["--from-schema-datasource"]), {
12251
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), {
12248
12252
  argumentName: "--from-schema-datasource"
12249
12253
  });
12250
12254
  const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
@@ -12253,7 +12257,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12253
12257
  ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12254
12258
  };
12255
12259
  } else if (args["--from-schema-datamodel"]) {
12256
- const schema = await getSchemaWithPath(import_path6.default.resolve(args["--from-schema-datamodel"]), {
12260
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), {
12257
12261
  argumentName: "--from-schema-datamodel"
12258
12262
  });
12259
12263
  from = {
@@ -12268,7 +12272,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12268
12272
  } else if (args["--from-migrations"]) {
12269
12273
  from = {
12270
12274
  tag: "migrations",
12271
- path: import_path6.default.resolve(args["--from-migrations"])
12275
+ path: import_path2.default.resolve(args["--from-migrations"])
12272
12276
  };
12273
12277
  } else if (args["--from-local-d1"]) {
12274
12278
  const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--from-local-d1" });
@@ -12284,7 +12288,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12284
12288
  };
12285
12289
  } else if (args["--to-schema-datasource"]) {
12286
12290
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false });
12287
- const schema = await getSchemaWithPath(import_path6.default.resolve(args["--to-schema-datasource"]), {
12291
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), {
12288
12292
  argumentName: "--to-schema-datasource"
12289
12293
  });
12290
12294
  const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
@@ -12293,7 +12297,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12293
12297
  ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12294
12298
  };
12295
12299
  } else if (args["--to-schema-datamodel"]) {
12296
- const schema = await getSchemaWithPath(import_path6.default.resolve(args["--to-schema-datamodel"]), {
12300
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), {
12297
12301
  argumentName: "--to-schema-datamodel"
12298
12302
  });
12299
12303
  to = {
@@ -12308,7 +12312,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12308
12312
  } else if (args["--to-migrations"]) {
12309
12313
  to = {
12310
12314
  tag: "migrations",
12311
- path: import_path6.default.resolve(args["--to-migrations"])
12315
+ path: import_path2.default.resolve(args["--to-migrations"])
12312
12316
  };
12313
12317
  } else if (args["--to-local-d1"]) {
12314
12318
  const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--to-local-d1" });
@@ -12317,7 +12321,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12317
12321
  url: `file:${d1Database}`
12318
12322
  };
12319
12323
  }
12320
- const migrate = new import_chunk_MWEO3VUS.Migrate();
12324
+ const migrate = new import_chunk_LJOMIPJW.Migrate();
12321
12325
  const captureStdout = new import_chunk_TKAGMA5K.CaptureStdout();
12322
12326
  const outputPath = args["--output"];
12323
12327
  const isOutputDefined = Boolean(outputPath);
@@ -26,14 +26,14 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_MWEO3VUS_exports = {};
30
- __export(chunk_MWEO3VUS_exports, {
29
+ var chunk_LJOMIPJW_exports = {};
30
+ __export(chunk_LJOMIPJW_exports, {
31
31
  Migrate: () => Migrate,
32
32
  init_Migrate: () => init_Migrate
33
33
  });
34
- module.exports = __toCommonJS(chunk_MWEO3VUS_exports);
34
+ module.exports = __toCommonJS(chunk_LJOMIPJW_exports);
35
35
  var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
36
- var import_chunk_XLLUFIQK = require("./chunk-XLLUFIQK.js");
36
+ var import_chunk_PCJYN6LT = require("./chunk-PCJYN6LT.js");
37
37
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
38
38
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
39
39
  var import_engines_version = require("@prisma/engines-version");
@@ -543,19 +543,19 @@ var init_Migrate = (0, import_chunk_WWAWV7DQ.__esm)({
543
543
  "src/Migrate.ts"() {
544
544
  (0, import_chunk_6TE2RIPN.init_colors)();
545
545
  import_log_update = (0, import_chunk_WWAWV7DQ.__toESM)(require_log_update());
546
- (0, import_chunk_XLLUFIQK.init_SchemaEngine)();
546
+ (0, import_chunk_PCJYN6LT.init_SchemaEngine)();
547
547
  packageJson = eval(`require('../package.json')`);
548
548
  Migrate = class {
549
549
  constructor(schemaPath, enabledPreviewFeatures) {
550
550
  if (schemaPath) {
551
551
  this.schemaPath = import_path.default.resolve(process.cwd(), schemaPath);
552
552
  this.migrationsDirectoryPath = import_path.default.join(import_path.default.dirname(this.schemaPath), "migrations");
553
- this.engine = new import_chunk_XLLUFIQK.SchemaEngine({
553
+ this.engine = new import_chunk_PCJYN6LT.SchemaEngine({
554
554
  schemaPath: this.schemaPath,
555
555
  enabledPreviewFeatures
556
556
  });
557
557
  } else {
558
- this.engine = new import_chunk_XLLUFIQK.SchemaEngine({
558
+ this.engine = new import_chunk_PCJYN6LT.SchemaEngine({
559
559
  enabledPreviewFeatures
560
560
  });
561
561
  }
@@ -26,20 +26,20 @@ 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_GJN3CSXW_exports = {};
30
- __export(chunk_GJN3CSXW_exports, {
29
+ var chunk_NKL64AIB_exports = {};
30
+ __export(chunk_NKL64AIB_exports, {
31
31
  getDatabaseVersionSafe: () => getDatabaseVersionSafe,
32
32
  init_getDatabaseVersionSafe: () => init_getDatabaseVersionSafe
33
33
  });
34
- module.exports = __toCommonJS(chunk_GJN3CSXW_exports);
35
- var import_chunk_XLLUFIQK = require("./chunk-XLLUFIQK.js");
34
+ module.exports = __toCommonJS(chunk_NKL64AIB_exports);
35
+ var import_chunk_PCJYN6LT = require("./chunk-PCJYN6LT.js");
36
36
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
37
37
  var import_debug = __toESM(require("@prisma/debug"));
38
38
  async function getDatabaseVersionSafe(args) {
39
39
  let engine;
40
40
  let dbVersion;
41
41
  try {
42
- engine = new import_chunk_XLLUFIQK.SchemaEngine({});
42
+ engine = new import_chunk_PCJYN6LT.SchemaEngine({});
43
43
  dbVersion = await engine.getDatabaseVersion(args);
44
44
  } catch (e) {
45
45
  debug(e);
@@ -53,7 +53,7 @@ async function getDatabaseVersionSafe(args) {
53
53
  var debug;
54
54
  var init_getDatabaseVersionSafe = (0, import_chunk_WWAWV7DQ.__esm)({
55
55
  "src/utils/getDatabaseVersionSafe.ts"() {
56
- (0, import_chunk_XLLUFIQK.init_SchemaEngine)();
56
+ (0, import_chunk_PCJYN6LT.init_SchemaEngine)();
57
57
  debug = (0, import_debug.default)("prisma:cli");
58
58
  }
59
59
  });
@@ -16,8 +16,8 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_VWV2NY26_exports = {};
20
- __export(chunk_VWV2NY26_exports, {
19
+ var chunk_NKQGJ3AE_exports = {};
20
+ __export(chunk_NKQGJ3AE_exports, {
21
21
  require_clean: () => require_clean,
22
22
  require_constants: () => require_constants,
23
23
  require_debug: () => require_debug,
@@ -28,7 +28,7 @@ __export(chunk_VWV2NY26_exports, {
28
28
  require_semver: () => require_semver,
29
29
  require_valid: () => require_valid
30
30
  });
31
- module.exports = __toCommonJS(chunk_VWV2NY26_exports);
31
+ module.exports = __toCommonJS(chunk_NKQGJ3AE_exports);
32
32
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
33
33
  var require_debug = (0, import_chunk_WWAWV7DQ.__commonJS)({
34
34
  "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js"(exports, module2) {
@@ -353,6 +353,8 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
353
353
  this.inc("patch", identifier, identifierBase);
354
354
  this.inc("pre", identifier, identifierBase);
355
355
  break;
356
+ // If the input is a non-prerelease version, this acts the same as
357
+ // prepatch.
356
358
  case "prerelease":
357
359
  if (this.prerelease.length === 0) {
358
360
  this.inc("patch", identifier, identifierBase);
@@ -380,6 +382,8 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
380
382
  }
381
383
  this.prerelease = [];
382
384
  break;
385
+ // This probably shouldn't be used publicly.
386
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
383
387
  case "pre": {
384
388
  const base = Number(identifierBase) ? 1 : 0;
385
389
  if (!identifier && identifierBase === false) {
@@ -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_XLLUFIQK_exports = {};
30
- __export(chunk_XLLUFIQK_exports, {
29
+ var chunk_PCJYN6LT_exports = {};
30
+ __export(chunk_PCJYN6LT_exports, {
31
31
  EngineError: () => EngineError,
32
32
  SchemaEngine: () => SchemaEngine,
33
33
  init_SchemaEngine: () => init_SchemaEngine
34
34
  });
35
- module.exports = __toCommonJS(chunk_XLLUFIQK_exports);
35
+ module.exports = __toCommonJS(chunk_PCJYN6LT_exports);
36
36
  var import_chunk_LVFPGUOH = require("./chunk-LVFPGUOH.js");
37
37
  var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
38
38
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
39
39
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
40
- var import_path = __toESM(require("path"));
40
+ var import_node_path = __toESM(require("node:path"));
41
41
  var import_debug = __toESM(require("@prisma/debug"));
42
42
  var import_internals = require("@prisma/internals");
43
43
  var import_child_process = require("child_process");
@@ -174,7 +174,7 @@ var init_SchemaEngine = (0, import_chunk_WWAWV7DQ.__esm)({
174
174
  );
175
175
  const { views } = introspectResult;
176
176
  if (views) {
177
- const schemaPath = this.schemaPath ?? import_path.default.join(process.cwd(), "prisma");
177
+ const schemaPath = this.schemaPath ?? import_node_path.default.join(process.cwd(), "prisma");
178
178
  await (0, import_chunk_LVFPGUOH.handleViewsIO)({ views, schemaPath });
179
179
  }
180
180
  return introspectResult;
@@ -360,6 +360,7 @@ ${this.lastError?.backtrace ?? ""}`;
360
360
  case import_internals.SchemaEngineExitCode.Panic:
361
361
  handlePanic();
362
362
  break;
363
+ // treat unknown error codes as panics
363
364
  default:
364
365
  handlePanic();
365
366
  }
@@ -26,13 +26,13 @@ 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_SV5GANSI_exports = {};
30
- __export(chunk_SV5GANSI_exports, {
29
+ var chunk_PFEH6ILG_exports = {};
30
+ __export(chunk_PFEH6ILG_exports, {
31
31
  MigrateStatus: () => MigrateStatus,
32
32
  init_MigrateStatus: () => init_MigrateStatus
33
33
  });
34
- module.exports = __toCommonJS(chunk_SV5GANSI_exports);
35
- var import_chunk_MWEO3VUS = require("./chunk-MWEO3VUS.js");
34
+ module.exports = __toCommonJS(chunk_PFEH6ILG_exports);
35
+ var import_chunk_LJOMIPJW = require("./chunk-LJOMIPJW.js");
36
36
  var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
37
37
  var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
38
38
  var import_chunk_KEBB7UIB = require("./chunk-KEBB7UIB.js");
@@ -44,7 +44,7 @@ var debug, _MigrateStatus, MigrateStatus;
44
44
  var init_MigrateStatus = (0, import_chunk_WWAWV7DQ.__esm)({
45
45
  "src/commands/MigrateStatus.ts"() {
46
46
  (0, import_chunk_6TE2RIPN.init_colors)();
47
- (0, import_chunk_MWEO3VUS.init_Migrate)();
47
+ (0, import_chunk_LJOMIPJW.init_Migrate)();
48
48
  (0, import_chunk_KEBB7UIB.init_ensureDatabaseExists)();
49
49
  (0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
50
50
  (0, import_chunk_Q7ACZDDT.init_printDatasource)();
@@ -74,7 +74,7 @@ var init_MigrateStatus = (0, import_chunk_WWAWV7DQ.__esm)({
74
74
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
75
75
  const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
76
76
  (0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_KEBB7UIB.getDatasourceInfo)({ schemaPath }) });
77
- const migrate = new import_chunk_MWEO3VUS.Migrate(schemaPath);
77
+ const migrate = new import_chunk_LJOMIPJW.Migrate(schemaPath);
78
78
  await (0, import_chunk_KEBB7UIB.ensureCanConnectToDatabase)(schemaPath);
79
79
  let diagnoseResult;
80
80
  let listMigrationDirectoriesResult;
@@ -26,13 +26,13 @@ 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_ZBOJAYON_exports = {};
30
- __export(chunk_ZBOJAYON_exports, {
29
+ var chunk_PNBMPQYH_exports = {};
30
+ __export(chunk_PNBMPQYH_exports, {
31
31
  DbExecute: () => DbExecute,
32
32
  init_DbExecute: () => init_DbExecute
33
33
  });
34
- module.exports = __toCommonJS(chunk_ZBOJAYON_exports);
35
- var import_chunk_MWEO3VUS = require("./chunk-MWEO3VUS.js");
34
+ module.exports = __toCommonJS(chunk_PNBMPQYH_exports);
35
+ var import_chunk_LJOMIPJW = require("./chunk-LJOMIPJW.js");
36
36
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
37
37
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
38
38
  var import_internals = require("@prisma/internals");
@@ -72,7 +72,7 @@ var init_DbExecute = (0, import_chunk_WWAWV7DQ.__esm)({
72
72
  "src/commands/DbExecute.ts"() {
73
73
  import_get_stdin = (0, import_chunk_WWAWV7DQ.__toESM)(require_get_stdin());
74
74
  (0, import_chunk_6TE2RIPN.init_colors)();
75
- (0, import_chunk_MWEO3VUS.init_Migrate)();
75
+ (0, import_chunk_LJOMIPJW.init_Migrate)();
76
76
  helpOptions = (0, import_internals.format)(
77
77
  `${(0, import_chunk_6TE2RIPN.bold)("Usage")}
78
78
 
@@ -171,7 +171,7 @@ See \`${(0, import_chunk_6TE2RIPN.green)((0, import_internals.getCommandWithExec
171
171
  ...(0, import_internals.toSchemasWithConfigDir)(schemaWithPath, config)
172
172
  };
173
173
  }
174
- const migrate = new import_chunk_MWEO3VUS.Migrate();
174
+ const migrate = new import_chunk_LJOMIPJW.Migrate();
175
175
  try {
176
176
  await migrate.engine.dbExecute({
177
177
  script,
@@ -26,14 +26,14 @@ 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_W3ROQKBN_exports = {};
30
- __export(chunk_W3ROQKBN_exports, {
29
+ var chunk_V7DE6JTG_exports = {};
30
+ __export(chunk_V7DE6JTG_exports, {
31
31
  init_removeSchemaFiles: () => init_removeSchemaFiles,
32
32
  removeSchemaFiles: () => removeSchemaFiles
33
33
  });
34
- module.exports = __toCommonJS(chunk_W3ROQKBN_exports);
34
+ module.exports = __toCommonJS(chunk_V7DE6JTG_exports);
35
35
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
36
- var import_promises = __toESM(require("fs/promises"));
36
+ var import_promises = __toESM(require("node:fs/promises"));
37
37
  async function removeSchemaFiles(files) {
38
38
  await Promise.all(files.map(([path]) => import_promises.default.rm(path)));
39
39
  }