@prisma/migrate 6.20.0-dev.7 → 6.20.0-dev.9

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 (88) hide show
  1. package/dist/CLI.js +2 -2
  2. package/dist/Migrate.js +4 -8
  3. package/dist/SchemaEngineCLI.js +4 -4
  4. package/dist/SchemaEngineWasm.js +4 -4
  5. package/dist/bin.js +71 -74
  6. package/dist/chunk-3MCWUFUJ.js +169 -0
  7. package/dist/{chunk-O35BTK6Y.js → chunk-7BNYLV6P.js} +7 -14
  8. package/dist/{chunk-F2XCBEZ4.js → chunk-AIUUIREM.js} +27 -53
  9. package/dist/{chunk-74LUB4XX.js → chunk-BRPS327A.js} +23 -45
  10. package/dist/{chunk-7TVX3D4W.js → chunk-CQ6GMT2G.js} +23 -69
  11. package/dist/{chunk-EJG7GKM7.js → chunk-DCXZOUQV.js} +5 -5
  12. package/dist/{chunk-LLO7YF56.js → chunk-DYXUXG3K.js} +7 -7
  13. package/dist/{chunk-GSX25HRL.js → chunk-ENVEA7LT.js} +10 -13
  14. package/dist/{chunk-6ORQRJLP.js → chunk-FEUKQ7J3.js} +38 -132
  15. package/dist/{chunk-BHJMJSM4.js → chunk-IQWOR45L.js} +28 -24
  16. package/dist/{chunk-R4IWP35Z.js → chunk-IVL273O6.js} +20 -20
  17. package/dist/{chunk-PHXLQVPT.js → chunk-L7EZFBB4.js} +40 -68
  18. package/dist/{chunk-3AKRTEIK.js → chunk-N4SBKLAB.js} +24 -23
  19. package/dist/{chunk-NGQA5JTN.js → chunk-OAHBNV3B.js} +5 -5
  20. package/dist/{chunk-22YP3RXZ.js → chunk-OZ26HKM7.js} +7 -7
  21. package/dist/{chunk-AXR7LS2N.js → chunk-PEUHUCS4.js} +4 -5
  22. package/dist/{chunk-TW22Y3AA.js → chunk-QAOWTYGM.js} +31 -32
  23. package/dist/{chunk-2FXU5NZQ.js → chunk-QOPTDDIH.js} +5 -10
  24. package/dist/{chunk-J33EXHZB.js → chunk-S4LY555Z.js} +26 -46
  25. package/dist/{chunk-NB4FRYRQ.js → chunk-TLHUBVSH.js} +6 -6
  26. package/dist/{chunk-Z27SI4AV.js → chunk-TRUKHPCA.js} +20 -15
  27. package/dist/{chunk-D4TRX77Y.js → chunk-WF7UXKO5.js} +6 -9
  28. package/dist/{chunk-ZTIS675B.js → chunk-XFASRSQR.js} +81 -172
  29. package/dist/{chunk-3WC4XD74.js → chunk-XGTVKL4L.js} +11 -4
  30. package/dist/{chunk-VU5BLQUI.js → chunk-ZOT2HSX5.js} +218 -22
  31. package/dist/commands/DbCommand.js +2 -2
  32. package/dist/commands/DbDrop.js +5 -5
  33. package/dist/commands/DbExecute.js +5 -9
  34. package/dist/commands/DbPull.js +10 -16
  35. package/dist/commands/DbPush.js +8 -12
  36. package/dist/commands/DbSeed.js +3 -3
  37. package/dist/commands/MigrateCommand.js +2 -2
  38. package/dist/commands/MigrateDeploy.js +7 -11
  39. package/dist/commands/MigrateDev.js +8 -13
  40. package/dist/commands/MigrateDiff.js +6 -9
  41. package/dist/commands/MigrateReset.js +8 -13
  42. package/dist/commands/MigrateResolve.js +7 -11
  43. package/dist/commands/MigrateStatus.js +7 -11
  44. package/dist/index.js +44 -48
  45. package/dist/internals/src/cli/getSchema.d.ts +1 -15
  46. package/dist/migrate/src/CLI.d.ts +1 -1
  47. package/dist/migrate/src/Migrate.d.ts +2 -3
  48. package/dist/migrate/src/SchemaEngineCLI.d.ts +4 -3
  49. package/dist/migrate/src/commands/DbCommand.d.ts +1 -1
  50. package/dist/migrate/src/commands/DbDrop.d.ts +1 -1
  51. package/dist/migrate/src/commands/DbExecute.d.ts +1 -1
  52. package/dist/migrate/src/commands/DbPull.d.ts +1 -2
  53. package/dist/migrate/src/commands/DbPush.d.ts +1 -1
  54. package/dist/migrate/src/commands/MigrateCommand.d.ts +1 -1
  55. package/dist/migrate/src/commands/MigrateDeploy.d.ts +1 -1
  56. package/dist/migrate/src/commands/MigrateDev.d.ts +1 -1
  57. package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
  58. package/dist/migrate/src/commands/MigrateReset.d.ts +1 -1
  59. package/dist/migrate/src/commands/MigrateResolve.d.ts +1 -1
  60. package/dist/migrate/src/commands/MigrateStatus.d.ts +1 -1
  61. package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +9 -5
  62. package/dist/migrate/src/utils/errors.d.ts +3 -0
  63. package/dist/migrate/src/utils/getDatabaseVersionSafe.d.ts +2 -1
  64. package/dist/migrate/src/utils/introspectSql.d.ts +2 -2
  65. package/dist/migrate/src/utils/printDatasource.d.ts +1 -3
  66. package/dist/migrate/src/utils/seed.d.ts +0 -6
  67. package/dist/utils/ensureDatabaseExists.js +6 -6
  68. package/dist/utils/errors.js +8 -7
  69. package/dist/utils/getDatabaseVersionSafe.js +5 -9
  70. package/dist/utils/introspectSql.js +5 -9
  71. package/dist/utils/printDatasource.js +2 -2
  72. package/dist/utils/printDatasources.js +31 -3
  73. package/dist/utils/seed.js +2 -3
  74. package/dist/utils/setupMSSQL.js +18 -3
  75. package/dist/utils/spinner.js +2 -3
  76. package/dist/views/handleViewsIO.js +2 -2
  77. package/package.json +11 -11
  78. package/dist/chunk-AI6DH66U.js +0 -55
  79. package/dist/chunk-D6LYHB65.js +0 -905
  80. package/dist/chunk-RR6BKMNO.js +0 -80
  81. package/dist/chunk-T64SUJ5L.js +0 -46
  82. package/dist/chunk-VV4M6AN7.js +0 -233
  83. package/dist/migrate/src/utils/replaceOrAddDatasource.d.ts +0 -2
  84. package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +0 -1
  85. package/dist/migrate/src/utils/warnDatasourceDriverAdapter.d.ts +0 -2
  86. package/dist/utils/replaceOrAddDatasource.js +0 -25
  87. package/dist/utils/replaceOrAddDatasource.test.js +0 -207
  88. package/dist/utils/warnDatasourceDriverAdapter.js +0 -25
@@ -18,9 +18,9 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var printDatasource_exports = {};
20
20
  __export(printDatasource_exports, {
21
- printDatasource: () => import_chunk_2FXU5NZQ.printDatasource
21
+ printDatasource: () => import_chunk_QOPTDDIH.printDatasource
22
22
  });
23
23
  module.exports = __toCommonJS(printDatasource_exports);
24
- var import_chunk_2FXU5NZQ = require("../chunk-2FXU5NZQ.js");
24
+ var import_chunk_QOPTDDIH = require("../chunk-QOPTDDIH.js");
25
25
  var import_chunk_SKRR5WT4 = require("../chunk-SKRR5WT4.js");
26
26
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
@@ -18,10 +18,38 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var printDatasources_exports = {};
20
20
  __export(printDatasources_exports, {
21
- printDatamodelObject: () => import_chunk_AI6DH66U.printDatamodelObject,
22
- printDatasources: () => import_chunk_AI6DH66U.printDatasources
21
+ printDatamodelObject: () => printDatamodelObject,
22
+ printDatasources: () => printDatasources
23
23
  });
24
24
  module.exports = __toCommonJS(printDatasources_exports);
25
- var import_chunk_AI6DH66U = require("../chunk-AI6DH66U.js");
26
25
  var import_chunk_2R6DII47 = require("../chunk-2R6DII47.js");
27
26
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
27
+ var import_indent_string = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_2R6DII47.require_indent_string)());
28
+ function printDatasources(internalDatasources) {
29
+ return internalDatasources.map((d) => String(new InternalDataSourceClass(d))).join("\n\n");
30
+ }
31
+ var tab = 2;
32
+ var InternalDataSourceClass = class {
33
+ constructor(dataSource) {
34
+ this.dataSource = dataSource;
35
+ }
36
+ toString() {
37
+ const { dataSource } = this;
38
+ const obj = {
39
+ provider: dataSource.provider,
40
+ url: dataSource.url
41
+ };
42
+ if (dataSource.config && typeof dataSource.config === "object") {
43
+ Object.assign(obj, dataSource.config);
44
+ }
45
+ return `datasource ${dataSource.name} {
46
+ ${(0, import_indent_string.default)(printDatamodelObject(obj), tab)}
47
+ }`;
48
+ }
49
+ };
50
+ function printDatamodelObject(obj) {
51
+ const maxLength = Object.keys(obj).reduce((max, curr) => Math.max(max, curr.length), 0);
52
+ return Object.entries(obj).map(
53
+ ([key, value]) => `${key.padEnd(maxLength)} = ${typeof value === "object" && value && value.value ? JSON.stringify(value.value) : JSON.stringify(value)}`
54
+ ).join("\n");
55
+ }
@@ -18,11 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var seed_exports = {};
20
20
  __export(seed_exports, {
21
- executeSeedCommand: () => import_chunk_PHXLQVPT.executeSeedCommand,
22
- getSeedCommandFromPackageJson: () => import_chunk_PHXLQVPT.getSeedCommandFromPackageJson
21
+ executeSeedCommand: () => import_chunk_L7EZFBB4.executeSeedCommand
23
22
  });
24
23
  module.exports = __toCommonJS(seed_exports);
25
- var import_chunk_PHXLQVPT = require("../chunk-PHXLQVPT.js");
24
+ var import_chunk_L7EZFBB4 = require("../chunk-L7EZFBB4.js");
26
25
  var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
27
26
  var import_chunk_SKRR5WT4 = require("../chunk-SKRR5WT4.js");
28
27
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
@@ -37915,7 +37915,7 @@ var require_define_lazy_prop = (0, import_chunk_2ESYSVXG.__commonJS)({
37915
37915
  }
37916
37916
  });
37917
37917
  var require_open = (0, import_chunk_2ESYSVXG.__commonJS)({
37918
- "../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js"(exports, module2) {
37918
+ "../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.js"(exports, module2) {
37919
37919
  "use strict";
37920
37920
  var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
37921
37921
  var childProcess2 = (0, import_chunk_2ESYSVXG.__require)("child_process");
@@ -37925,6 +37925,21 @@ var require_open = (0, import_chunk_2ESYSVXG.__commonJS)({
37925
37925
  var defineLazyProperty = require_define_lazy_prop();
37926
37926
  var localXdgOpenPath = path4.join(__dirname, "xdg-open");
37927
37927
  var { platform, arch: arch2 } = process;
37928
+ var hasContainerEnv = () => {
37929
+ try {
37930
+ fs4.statSync("/run/.containerenv");
37931
+ return true;
37932
+ } catch {
37933
+ return false;
37934
+ }
37935
+ };
37936
+ var cachedResult;
37937
+ function isInsideContainer() {
37938
+ if (cachedResult === void 0) {
37939
+ cachedResult = hasContainerEnv() || isDocker();
37940
+ }
37941
+ return cachedResult;
37942
+ }
37928
37943
  var getWslDrivesMountPoint = /* @__PURE__ */ (() => {
37929
37944
  const defaultMountPoint = "/mnt/";
37930
37945
  let mountPoint;
@@ -38005,7 +38020,7 @@ var require_open = (0, import_chunk_2ESYSVXG.__commonJS)({
38005
38020
  if (app) {
38006
38021
  cliArguments.push("-a", app);
38007
38022
  }
38008
- } else if (platform === "win32" || isWsl && !isDocker()) {
38023
+ } else if (platform === "win32" || isWsl && !isInsideContainer() && !app) {
38009
38024
  const mountPoint = await getWslDrivesMountPoint();
38010
38025
  command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
38011
38026
  cliArguments.push(
@@ -38068,7 +38083,7 @@ var require_open = (0, import_chunk_2ESYSVXG.__commonJS)({
38068
38083
  return new Promise((resolve, reject) => {
38069
38084
  subprocess.once("error", reject);
38070
38085
  subprocess.once("close", (exitCode) => {
38071
- if (options.allowNonzeroExitCode && exitCode > 0) {
38086
+ if (!options.allowNonzeroExitCode && exitCode > 0) {
38072
38087
  reject(new Error(`Exited with code ${exitCode}`));
38073
38088
  return;
38074
38089
  }
@@ -18,10 +18,9 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var spinner_exports = {};
20
20
  __export(spinner_exports, {
21
- createSpinner: () => import_chunk_VU5BLQUI.createSpinner
21
+ createSpinner: () => import_chunk_ZOT2HSX5.createSpinner
22
22
  });
23
23
  module.exports = __toCommonJS(spinner_exports);
24
- var import_chunk_VU5BLQUI = require("../chunk-VU5BLQUI.js");
25
- var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
24
+ var import_chunk_ZOT2HSX5 = require("../chunk-ZOT2HSX5.js");
26
25
  var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
27
26
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var handleViewsIO_exports = {};
20
20
  __export(handleViewsIO_exports, {
21
- handleViewsIO: () => import_chunk_AXR7LS2N.handleViewsIO
21
+ handleViewsIO: () => import_chunk_PEUHUCS4.handleViewsIO
22
22
  });
23
23
  module.exports = __toCommonJS(handleViewsIO_exports);
24
- var import_chunk_AXR7LS2N = require("../chunk-AXR7LS2N.js");
24
+ var import_chunk_PEUHUCS4 = require("../chunk-PEUHUCS4.js");
25
25
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/migrate",
3
- "version": "6.20.0-dev.7",
3
+ "version": "6.20.0-dev.9",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/migrate/src/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "@swc/core": "1.11.5",
22
22
  "@swc/jest": "0.2.37",
23
23
  "@types/jest": "29.5.14",
24
- "@types/node": "18.19.76",
24
+ "@types/node": "~20.19.24",
25
25
  "@types/pg": "8.11.11",
26
26
  "@types/prompts": "2.4.9",
27
27
  "@types/sqlite3": "3.1.11",
@@ -44,21 +44,21 @@
44
44
  "tempy": "1.0.1",
45
45
  "ts-pattern": "5.6.2",
46
46
  "typescript": "5.4.5",
47
- "@prisma/adapter-libsql": "6.20.0-dev.7"
47
+ "@prisma/adapter-libsql": "6.20.0-dev.9"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@prisma/internals": "*"
51
51
  },
52
52
  "dependencies": {
53
- "@prisma/engines-version": "6.20.0-5.46b83975fec203f6665832b932ab3dc58be23eab",
53
+ "@prisma/engines-version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513",
54
54
  "prompts": "2.4.2",
55
- "@prisma/client-generator-registry": "6.20.0-dev.7",
56
- "@prisma/config": "6.20.0-dev.7",
57
- "@prisma/debug": "6.20.0-dev.7",
58
- "@prisma/driver-adapter-utils": "6.20.0-dev.7",
59
- "@prisma/get-platform": "6.20.0-dev.7",
60
- "@prisma/internals": "6.20.0-dev.7",
61
- "@prisma/generator": "6.20.0-dev.7"
55
+ "@prisma/client-generator-registry": "6.20.0-dev.9",
56
+ "@prisma/debug": "6.20.0-dev.9",
57
+ "@prisma/config": "6.20.0-dev.9",
58
+ "@prisma/driver-adapter-utils": "6.20.0-dev.9",
59
+ "@prisma/generator": "6.20.0-dev.9",
60
+ "@prisma/get-platform": "6.20.0-dev.9",
61
+ "@prisma/internals": "6.20.0-dev.9"
62
62
  },
63
63
  "files": [
64
64
  "README.md",
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_AI6DH66U_exports = {};
20
- __export(chunk_AI6DH66U_exports, {
21
- printDatamodelObject: () => printDatamodelObject,
22
- printDatasources: () => printDatasources
23
- });
24
- module.exports = __toCommonJS(chunk_AI6DH66U_exports);
25
- var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
26
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
27
- var import_indent_string = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_2R6DII47.require_indent_string)());
28
- function printDatasources(internalDatasources) {
29
- return internalDatasources.map((d) => String(new InternalDataSourceClass(d))).join("\n\n");
30
- }
31
- var tab = 2;
32
- var InternalDataSourceClass = class {
33
- constructor(dataSource) {
34
- this.dataSource = dataSource;
35
- }
36
- toString() {
37
- const { dataSource } = this;
38
- const obj = {
39
- provider: dataSource.provider,
40
- url: dataSource.url
41
- };
42
- if (dataSource.config && typeof dataSource.config === "object") {
43
- Object.assign(obj, dataSource.config);
44
- }
45
- return `datasource ${dataSource.name} {
46
- ${(0, import_indent_string.default)(printDatamodelObject(obj), tab)}
47
- }`;
48
- }
49
- };
50
- function printDatamodelObject(obj) {
51
- const maxLength = Object.keys(obj).reduce((max, curr) => Math.max(max, curr.length), 0);
52
- return Object.entries(obj).map(
53
- ([key, value]) => `${key.padEnd(maxLength)} = ${typeof value === "object" && value && value.value ? JSON.stringify(value.value) : JSON.stringify(value)}`
54
- ).join("\n");
55
- }