@prisma/migrate 7.10.0-dev.9 → 7.10.0-integration-fix-prisma-publish-token.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 (97) hide show
  1. package/dist/Migrate.js +4 -4
  2. package/dist/SchemaEngineCLI.js +4 -4
  3. package/dist/SchemaEngineWasm.js +4 -4
  4. package/dist/bin.js +42 -36
  5. package/dist/{chunk-CQTYRADU.js → chunk-2WAUT755.js} +24 -19
  6. package/dist/{chunk-FXSCTGN2.js → chunk-3C5DQOOW.js} +5 -5
  7. package/dist/{chunk-XTEEOIUV.js → chunk-3DR7R72S.js} +19 -14
  8. package/dist/{chunk-HWBQGGZH.js → chunk-3NKLI5KP.js} +9 -9
  9. package/dist/{chunk-6TSRRBNA.js → chunk-57S5K3DX.js} +7 -7
  10. package/dist/{chunk-7CQBDP4H.js → chunk-6F7CAPL7.js} +9 -10
  11. package/dist/{chunk-TDN3QQTH.js → chunk-6V2VYU3A.js} +30 -25
  12. package/dist/{chunk-TW5MYPTK.js → chunk-6W7GTZYX.js} +27 -22
  13. package/dist/{chunk-GBUW4I6U.js → chunk-7KCEXIB2.js} +6 -6
  14. package/dist/{chunk-TEOIOJ7P.js → chunk-A6PUWLVN.js} +6 -6
  15. package/dist/{chunk-LZ2DWYUY.js → chunk-BWFPKWBD.js} +7 -7
  16. package/dist/{chunk-6EQA63NM.js → chunk-D7N4YVZS.js} +39 -33
  17. package/dist/{chunk-DPRQXN36.js → chunk-DTSU3YZP.js} +6 -6
  18. package/dist/{chunk-WA2SOLDQ.js → chunk-EGNBSKBG.js} +8 -8
  19. package/dist/{chunk-DNNMOG7A.js → chunk-F2LZOLZK.js} +25 -24
  20. package/dist/{chunk-PPE4XDUL.js → chunk-GD52HTMX.js} +10 -10
  21. package/dist/{chunk-2HCAA4GX.js → chunk-GHPP2B5T.js} +27 -23
  22. package/dist/{chunk-RM4WK3ML.js → chunk-I7UMFS37.js} +33 -26
  23. package/dist/{chunk-NGEWTXY6.js → chunk-J6BC6QDB.js} +6 -6
  24. package/dist/{chunk-6DDIA3ZD.js → chunk-KDAXJMEP.js} +5 -5
  25. package/dist/{chunk-ZUHJASAP.js → chunk-KYZDCMJW.js} +12 -12
  26. package/dist/{chunk-UA3FFRRV.js → chunk-NSQ3NTDD.js} +26 -20
  27. package/dist/{chunk-VEBRKA5H.js → chunk-OQKFK65J.js} +6 -6
  28. package/dist/{chunk-YNB3IN6Q.js → chunk-OXZFIZV6.js} +8 -8
  29. package/dist/{chunk-WP5M3D4N.js → chunk-PCCMNZGX.js} +31 -28
  30. package/dist/{chunk-QCPYZUFF.js → chunk-RRKGNIXU.js} +34 -32
  31. package/dist/{chunk-THJ7K72W.js → chunk-SFFTVLXC.js} +6 -6
  32. package/dist/{chunk-AL3XYISJ.js → chunk-SUVNEDA5.js} +56 -51
  33. package/dist/{chunk-PEUHUCS4.js → chunk-T25WPL3D.js} +632 -625
  34. package/dist/{chunk-NHSJJSXU.js → chunk-TKQMAG6L.js} +5 -5
  35. package/dist/{chunk-DL2W77GY.js → chunk-TY3ROQOX.js} +34 -31
  36. package/dist/{chunk-RGXJYLMD.js → chunk-ZOYXSZ2J.js} +5 -5
  37. package/dist/{chunk-INC5VUX4.js → chunk-ZVRF2A5M.js} +6 -6
  38. package/dist/commands/DbCommand.js +2 -2
  39. package/dist/commands/DbDrop.js +3 -3
  40. package/dist/commands/DbExecute.js +5 -5
  41. package/dist/commands/DbPull.js +6 -6
  42. package/dist/commands/DbPush.js +6 -6
  43. package/dist/commands/DbSeed.js +2 -2
  44. package/dist/commands/MigrateCommand.js +2 -2
  45. package/dist/commands/MigrateDeploy.js +5 -5
  46. package/dist/commands/MigrateDev.js +7 -7
  47. package/dist/commands/MigrateDiff.js +6 -6
  48. package/dist/commands/MigrateReset.js +6 -6
  49. package/dist/commands/MigrateResolve.js +5 -5
  50. package/dist/commands/MigrateStatus.js +5 -5
  51. package/dist/commands/db-command-completion.js +2 -2
  52. package/dist/commands/db-execute-completion.js +2 -2
  53. package/dist/commands/db-pull-completion.js +2 -2
  54. package/dist/commands/db-push-completion.js +2 -2
  55. package/dist/commands/db-seed-completion.js +2 -2
  56. package/dist/commands/migrate-command-completion.js +2 -2
  57. package/dist/commands/migrate-deploy-completion.js +2 -2
  58. package/dist/commands/migrate-dev-completion.js +2 -2
  59. package/dist/commands/migrate-diff-completion.js +2 -2
  60. package/dist/commands/migrate-reset-completion.js +2 -2
  61. package/dist/commands/migrate-resolve-completion.js +2 -2
  62. package/dist/commands/migrate-status-completion.js +2 -2
  63. package/dist/index.js +63 -63
  64. package/dist/src/commands/DbCommand.d.ts +2 -2
  65. package/dist/src/commands/DbDrop.d.ts +3 -2
  66. package/dist/src/commands/DbExecute.d.ts +3 -2
  67. package/dist/src/commands/DbPull.d.ts +3 -2
  68. package/dist/src/commands/DbPush.d.ts +3 -2
  69. package/dist/src/commands/DbSeed.d.ts +3 -2
  70. package/dist/src/commands/MigrateCommand.d.ts +2 -2
  71. package/dist/src/commands/MigrateDeploy.d.ts +3 -2
  72. package/dist/src/commands/MigrateDev.d.ts +3 -2
  73. package/dist/src/commands/MigrateDiff.d.ts +3 -2
  74. package/dist/src/commands/MigrateReset.d.ts +3 -2
  75. package/dist/src/commands/MigrateResolve.d.ts +3 -2
  76. package/dist/src/commands/MigrateStatus.d.ts +3 -2
  77. package/dist/src/commands/db-command-completion.d.ts +1 -1
  78. package/dist/src/commands/db-execute-completion.d.ts +1 -1
  79. package/dist/src/commands/db-pull-completion.d.ts +1 -1
  80. package/dist/src/commands/db-push-completion.d.ts +1 -1
  81. package/dist/src/commands/db-seed-completion.d.ts +1 -1
  82. package/dist/src/commands/migrate-command-completion.d.ts +1 -1
  83. package/dist/src/commands/migrate-deploy-completion.d.ts +1 -1
  84. package/dist/src/commands/migrate-dev-completion.d.ts +1 -1
  85. package/dist/src/commands/migrate-diff-completion.d.ts +1 -1
  86. package/dist/src/commands/migrate-reset-completion.d.ts +1 -1
  87. package/dist/src/commands/migrate-resolve-completion.d.ts +1 -1
  88. package/dist/src/commands/migrate-status-completion.d.ts +1 -1
  89. package/dist/src/utils/errors.d.ts +4 -4
  90. package/dist/src/utils/handleEvaluateDataloss.d.ts +1 -1
  91. package/dist/utils/errors.js +8 -8
  92. package/dist/utils/getDatabaseVersionSafe.js +5 -5
  93. package/dist/utils/handleEvaluateDataloss.js +2 -2
  94. package/dist/utils/introspectSql.js +5 -5
  95. package/dist/utils/setupMSSQL.js +142 -56
  96. package/dist/views/handleViewsIO.js +2 -2
  97. package/package.json +12 -12
@@ -26,32 +26,29 @@ 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_TW5MYPTK_exports = {};
30
- __export(chunk_TW5MYPTK_exports, {
29
+ var chunk_6W7GTZYX_exports = {};
30
+ __export(chunk_6W7GTZYX_exports, {
31
31
  MigrateReset: () => MigrateReset
32
32
  });
33
- module.exports = __toCommonJS(chunk_TW5MYPTK_exports);
33
+ module.exports = __toCommonJS(chunk_6W7GTZYX_exports);
34
34
  var import_chunk_G222ME3D = require("./chunk-G222ME3D.js");
35
35
  var import_chunk_PHX6STZ3 = require("./chunk-PHX6STZ3.js");
36
- var import_chunk_ZUHJASAP = require("./chunk-ZUHJASAP.js");
36
+ var import_chunk_KYZDCMJW = require("./chunk-KYZDCMJW.js");
37
37
  var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
38
38
  var import_chunk_BRPS327A = require("./chunk-BRPS327A.js");
39
- var import_chunk_RGXJYLMD = require("./chunk-RGXJYLMD.js");
39
+ var import_chunk_ZOYXSZ2J = require("./chunk-ZOYXSZ2J.js");
40
40
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
41
41
  var import_internals = require("@prisma/internals");
42
42
  var import_prompts = __toESM(require("prompts"));
43
- var MigrateReset = class _MigrateReset {
44
- static new() {
45
- return new _MigrateReset();
46
- }
47
- static help = (0, import_internals.format)(`
43
+ function renderHelp(cliCommand) {
44
+ return (0, import_internals.format)(`
48
45
  Reset your database and apply all migrations, all data will be lost
49
46
 
50
47
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
51
48
 
52
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset [options]
49
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate reset [options]
53
50
 
54
- The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma.config.ts")}).
51
+ The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma7.config.ts")}).
55
52
 
56
53
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
57
54
 
@@ -63,14 +60,22 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
63
60
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
64
61
 
65
62
  Reset your database and apply all migrations, all data will be lost
66
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset
63
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate reset
67
64
 
68
65
  Specify a schema
69
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --schema=./schema.prisma
66
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate reset --schema=./schema.prisma
70
67
 
71
68
  Use --force to skip the confirmation prompt
72
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --force
69
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate reset --force
73
70
  `);
71
+ }
72
+ var MigrateReset = class _MigrateReset {
73
+ constructor(cliCommand) {
74
+ this.cliCommand = cliCommand;
75
+ }
76
+ static new(cliCommand) {
77
+ return new _MigrateReset(cliCommand);
78
+ }
74
79
  async parse(argv, config, baseDir) {
75
80
  const args = (0, import_internals.arg)(argv, {
76
81
  "--help": Boolean,
@@ -94,12 +99,12 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
94
99
  baseDir
95
100
  })
96
101
  });
97
- const cmd = "migrate reset";
98
- const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config, cmd });
102
+ const cmd = `${this.cliCommand} migrate reset`;
103
+ const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config, command: cmd });
104
+ (0, import_internals.checkUnsupportedDataProxy)({ command: cmd, validatedConfig });
99
105
  const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext, config);
100
106
  const datasourceInfo = (0, import_chunk_BRPS327A.parseDatasourceInfo)(schemaContext.primaryDatasource, validatedConfig);
101
107
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
102
- (0, import_internals.checkUnsupportedDataProxy)({ cmd, validatedConfig });
103
108
  const successMessage = await (0, import_chunk_BRPS327A.ensureDatabaseExists)(
104
109
  baseDir,
105
110
  (0, import_internals.getSchemaDatasourceProvider)(schemaContext),
@@ -111,7 +116,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
111
116
  process.stdout.write("\n");
112
117
  if (!args["--force"]) {
113
118
  if (!(0, import_internals.canPrompt)()) {
114
- throw new import_chunk_ZUHJASAP.MigrateResetEnvNonInteractiveError();
119
+ throw new import_chunk_KYZDCMJW.MigrateResetEnvNonInteractiveError();
115
120
  }
116
121
  const confirmation = await (0, import_prompts.default)({
117
122
  type: "confirm",
@@ -129,7 +134,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
129
134
  externalTables: config.tables?.external ?? [],
130
135
  externalEnums: config.enums?.external ?? []
131
136
  };
132
- const migrate = await import_chunk_RGXJYLMD.Migrate.setup({
137
+ const migrate = await import_chunk_ZOYXSZ2J.Migrate.setup({
133
138
  schemaEngineConfig: config,
134
139
  baseDir,
135
140
  migrationsDirPath,
@@ -167,8 +172,8 @@ ${(0, import_chunk_G222ME3D.printFilesFromMigrationIds)("migrations", migrationI
167
172
  if (error) {
168
173
  return new import_internals.HelpError(`
169
174
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
170
- ${_MigrateReset.help}`);
175
+ ${renderHelp(this.cliCommand)}`);
171
176
  }
172
- return _MigrateReset.help;
177
+ return renderHelp(this.cliCommand);
173
178
  }
174
179
  };
@@ -16,18 +16,18 @@ 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_GBUW4I6U_exports = {};
20
- __export(chunk_GBUW4I6U_exports, {
19
+ var chunk_7KCEXIB2_exports = {};
20
+ __export(chunk_7KCEXIB2_exports, {
21
21
  dbCompletion: () => dbCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_GBUW4I6U_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_7KCEXIB2_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var dbCompletion = {
26
26
  name: "db",
27
27
  description: "Manage your database schema and lifecycle",
28
28
  options: [
29
29
  { name: "help", alias: "h", description: "Display this help message" },
30
- { name: "config", description: "Custom path to your Prisma config file", values: import_completion_values.completionConfigPaths },
31
- { name: "schema", description: "Custom path to your Prisma schema", values: import_completion_values.completionSchemaPaths }
30
+ { name: "config", description: "Custom path to your Prisma config file", values: import_internals.completionConfigPaths },
31
+ { name: "schema", description: "Custom path to your Prisma schema", values: import_internals.completionSchemaPaths }
32
32
  ]
33
33
  };
@@ -16,19 +16,19 @@ 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_TEOIOJ7P_exports = {};
20
- __export(chunk_TEOIOJ7P_exports, {
19
+ var chunk_A6PUWLVN_exports = {};
20
+ __export(chunk_A6PUWLVN_exports, {
21
21
  migrateResetCompletion: () => migrateResetCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_TEOIOJ7P_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_A6PUWLVN_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateResetCompletion = {
26
26
  name: "migrate reset",
27
27
  description: "Reset your database and apply all migrations",
28
28
  options: [
29
29
  { name: "help", alias: "h", description: "Display this help message" },
30
- { name: "schema", description: "Custom path to your Prisma schema", values: import_completion_values.completionSchemaPaths },
31
- { name: "config", description: "Custom path to your Prisma config file", values: import_completion_values.completionConfigPaths },
30
+ { name: "schema", description: "Custom path to your Prisma schema", values: import_internals.completionSchemaPaths },
31
+ { name: "config", description: "Custom path to your Prisma config file", values: import_internals.completionConfigPaths },
32
32
  { name: "force", alias: "f", description: "Skip the confirmation prompt" }
33
33
  ]
34
34
  };
@@ -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_LZ2DWYUY_exports = {};
30
- __export(chunk_LZ2DWYUY_exports, {
29
+ var chunk_BWFPKWBD_exports = {};
30
+ __export(chunk_BWFPKWBD_exports, {
31
31
  SchemaEngineWasm: () => SchemaEngineWasm
32
32
  });
33
- module.exports = __toCommonJS(chunk_LZ2DWYUY_exports);
34
- var import_chunk_6DDIA3ZD = require("./chunk-6DDIA3ZD.js");
35
- var import_chunk_PEUHUCS4 = require("./chunk-PEUHUCS4.js");
33
+ module.exports = __toCommonJS(chunk_BWFPKWBD_exports);
34
+ var import_chunk_KDAXJMEP = require("./chunk-KDAXJMEP.js");
35
+ var import_chunk_T25WPL3D = require("./chunk-T25WPL3D.js");
36
36
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
37
37
  var import_debug = __toESM(require("@prisma/debug"));
38
38
  var import_internals = require("@prisma/internals");
@@ -83,7 +83,7 @@ var SchemaEngineWasm = class _SchemaEngineWasm {
83
83
  const { message, stack } = (0, import_internals.getWasmError)(e);
84
84
  throw new import_internals.RustPanic(serializePanic(message), stack, command, import_internals.ErrorArea.LIFT_CLI);
85
85
  } else if ("code" in error) {
86
- throw new import_chunk_6DDIA3ZD.EngineError((0, import_chunk_SKRR5WT4.red)(`${error.code}
86
+ throw new import_chunk_KDAXJMEP.EngineError((0, import_chunk_SKRR5WT4.red)(`${error.code}
87
87
 
88
88
  ${(0, import_internals.relativizePathInPSLError)(error.message)}
89
89
  `), error.code);
@@ -189,7 +189,7 @@ ${(0, import_internals.relativizePathInPSLError)(error.message)}
189
189
  });
190
190
  const { views } = introspectResult;
191
191
  if (views) {
192
- await (0, import_chunk_PEUHUCS4.handleViewsIO)({ views, viewsDirectoryPath });
192
+ await (0, import_chunk_T25WPL3D.handleViewsIO)({ views, viewsDirectoryPath });
193
193
  }
194
194
  return introspectResult;
195
195
  }
@@ -26,38 +26,35 @@ 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_6EQA63NM_exports = {};
30
- __export(chunk_6EQA63NM_exports, {
29
+ var chunk_D7N4YVZS_exports = {};
30
+ __export(chunk_D7N4YVZS_exports, {
31
31
  DbPull: () => DbPull
32
32
  });
33
- module.exports = __toCommonJS(chunk_6EQA63NM_exports);
33
+ module.exports = __toCommonJS(chunk_D7N4YVZS_exports);
34
34
  var import_chunk_ZOT2HSX5 = require("./chunk-ZOT2HSX5.js");
35
35
  var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
36
36
  var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
37
37
  var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
38
38
  var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
39
39
  var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
40
- var import_chunk_ZUHJASAP = require("./chunk-ZUHJASAP.js");
40
+ var import_chunk_KYZDCMJW = require("./chunk-KYZDCMJW.js");
41
41
  var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
42
42
  var import_chunk_BRPS327A = require("./chunk-BRPS327A.js");
43
- var import_chunk_RGXJYLMD = require("./chunk-RGXJYLMD.js");
43
+ var import_chunk_ZOYXSZ2J = require("./chunk-ZOYXSZ2J.js");
44
44
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
45
45
  var import_debug = __toESM(require("@prisma/debug"));
46
46
  var import_internals = require("@prisma/internals");
47
47
  var import_path = __toESM(require("path"));
48
48
  var debug = (0, import_debug.default)("prisma:db:pull");
49
- var DbPull = class _DbPull {
50
- static new() {
51
- return new _DbPull();
52
- }
53
- static help = (0, import_internals.format)(`
49
+ function renderHelp(cliCommand) {
50
+ return (0, import_internals.format)(`
54
51
  Pull the state from the database to the Prisma schema using introspection
55
52
 
56
53
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
57
54
 
58
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull [flags/options]
55
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull [flags/options]
59
56
 
60
- The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma.config.ts")}).
57
+ The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma7.config.ts")}).
61
58
 
62
59
  ${(0, import_chunk_SKRR5WT4.bold)("Flags")}
63
60
 
@@ -77,21 +74,29 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
77
74
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
78
75
 
79
76
  With an existing Prisma schema
80
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull
77
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull
81
78
 
82
79
  Or specify a Prisma schema path
83
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull --schema=./schema.prisma
80
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull --schema=./schema.prisma
84
81
 
85
82
  Instead of saving the result to the filesystem, you can also print it to stdout
86
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull --print
83
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull --print
87
84
 
88
85
  Overwrite the current schema with the introspected schema instead of enriching it
89
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull --force
86
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull --force
90
87
 
91
88
  Set composite types introspection depth to 2 levels
92
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull --composite-type-depth=2
89
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull --composite-type-depth=2
93
90
 
94
91
  `);
92
+ }
93
+ var DbPull = class _DbPull {
94
+ constructor(cliCommand) {
95
+ this.cliCommand = cliCommand;
96
+ }
97
+ static new(cliCommand) {
98
+ return new _DbPull(cliCommand);
99
+ }
95
100
  async parse(argv, config, baseDir = process.cwd()) {
96
101
  const args = (0, import_internals.arg)(argv, {
97
102
  "--help": Boolean,
@@ -131,16 +136,17 @@ Set composite types introspection depth to 2 levels
131
136
  }
132
137
  };
133
138
  }
134
- const cmd = "db pull";
135
- const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config: cmdSpecificConfig, cmd });
136
- (0, import_internals.checkUnsupportedDataProxy)({ cmd, validatedConfig });
139
+ const cmd = `${this.cliCommand} db pull`;
140
+ const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config: cmdSpecificConfig, command: cmd });
141
+ (0, import_internals.checkUnsupportedDataProxy)({ command: cmd, validatedConfig });
137
142
  if (schemaContext && !args["--print"]) {
138
143
  (0, import_internals.printSchemaLoadedMessage)(schemaContext.loadedFromPathForLogMessages);
139
144
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_BRPS327A.parseDatasourceInfo)(schemaContext?.primaryDatasource, validatedConfig) });
140
145
  }
141
146
  if (!schemaContext) {
142
- throw new import_chunk_ZUHJASAP.NoSchemaFoundError();
147
+ throw new import_chunk_KYZDCMJW.NoSchemaFoundError();
143
148
  }
149
+ (0, import_internals.getSchemaDatasourceProvider)(schemaContext);
144
150
  const firstDatasource = schemaContext.primaryDatasource;
145
151
  const schema = schemaContext.schemaFiles;
146
152
  await (0, import_internals.getConfig)({
@@ -151,13 +157,13 @@ Set composite types introspection depth to 2 levels
151
157
  if (isReintrospection && !args["--force"] && firstDatasource?.provider === "mongodb") {
152
158
  throw new Error(`Iterating on one schema using re-introspection with db pull is currently not supported with MongoDB provider.
153
159
  You can explicitly ignore and override your current local schema file with ${(0, import_chunk_SKRR5WT4.green)(
154
- (0, import_internals.getCommandWithExecutor)("prisma db pull --force")
160
+ (0, import_internals.getCommandWithExecutor)(`${this.cliCommand} db pull --force`)
155
161
  )}
156
162
  Some information will be lost (relations, comments, mapped fields, @ignore...), follow ${(0, import_internals.link)(
157
163
  "https://github.com/prisma/prisma/issues/9585"
158
164
  )} for more info.`);
159
165
  }
160
- const migrate = await import_chunk_RGXJYLMD.Migrate.setup({
166
+ const migrate = await import_chunk_ZOYXSZ2J.Migrate.setup({
161
167
  schemaEngineConfig: cmdSpecificConfig,
162
168
  baseDir,
163
169
  schemaContext,
@@ -188,10 +194,10 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
188
194
  throw new Error(`
189
195
  ${(0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)(`${e.code} `))}${(0, import_chunk_SKRR5WT4.red)("The introspected database was empty:")}
190
196
 
191
- ${(0, import_chunk_SKRR5WT4.bold)("prisma db pull")} could not create any models in your ${(0, import_chunk_SKRR5WT4.bold)(
197
+ ${(0, import_chunk_SKRR5WT4.bold)(`${this.cliCommand} db pull`)} could not create any models in your ${(0, import_chunk_SKRR5WT4.bold)(
192
198
  "schema.prisma"
193
199
  )} file and you will not be able to generate Prisma Client with the ${(0, import_chunk_SKRR5WT4.bold)(
194
- (0, import_internals.getCommandWithExecutor)("prisma generate")
200
+ (0, import_internals.getCommandWithExecutor)(`${this.cliCommand} generate`)
195
201
  )} command.
196
202
 
197
203
  ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
@@ -201,16 +207,16 @@ ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
201
207
  "schema.prisma"
202
208
  )} points to a database that is not empty (it must contain at least one table).
203
209
 
204
- Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
210
+ Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${this.cliCommand} db pull`))} again.
205
211
  `);
206
212
  } else if (e.code === "P1003") {
207
213
  throw new Error(`
208
214
  ${(0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)(`${e.code} `))}${(0, import_chunk_SKRR5WT4.red)("The introspected database does not exist:")}
209
215
 
210
- ${(0, import_chunk_SKRR5WT4.bold)("prisma db pull")} could not create any models in your ${(0, import_chunk_SKRR5WT4.bold)(
216
+ ${(0, import_chunk_SKRR5WT4.bold)(`${this.cliCommand} db pull`)} could not create any models in your ${(0, import_chunk_SKRR5WT4.bold)(
211
217
  "schema.prisma"
212
218
  )} file and you will not be able to generate Prisma Client with the ${(0, import_chunk_SKRR5WT4.bold)(
213
- (0, import_internals.getCommandWithExecutor)("prisma generate")
219
+ (0, import_internals.getCommandWithExecutor)(`${this.cliCommand} generate`)
214
220
  )} command.
215
221
 
216
222
  ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
@@ -220,7 +226,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
220
226
  "schema.prisma"
221
227
  )} points to an existing database.
222
228
 
223
- Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
229
+ Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${this.cliCommand} db pull`))} again.
224
230
  `);
225
231
  } else if (e.code === "P1012") {
226
232
  process.stdout.write("\n");
@@ -229,7 +235,7 @@ Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getComm
229
235
  Introspection failed as your current Prisma schema file is invalid
230
236
 
231
237
  Please fix your current schema manually (using either ${(0, import_chunk_SKRR5WT4.green)(
232
- (0, import_internals.getCommandWithExecutor)("prisma validate")
238
+ (0, import_internals.getCommandWithExecutor)(`${this.cliCommand} validate`)
233
239
  )} or the Prisma VS Code extension to understand what's broken and confirm you fixed it), and then run this command again.
234
240
  Or run this command with the ${(0, import_chunk_SKRR5WT4.green)(
235
241
  "--force"
@@ -265,7 +271,7 @@ Or run this command with the ${(0, import_chunk_SKRR5WT4.green)(
265
271
  import_path.default.relative(process.cwd(), introspectedSchemaPath)
266
272
  )} in ${(0, import_chunk_SKRR5WT4.bold)((0, import_internals.formatms)(Math.round(performance.now()) - before))}
267
273
  ${(0, import_chunk_SKRR5WT4.yellow)(introspectionWarningsMessage)}
268
- ${`Run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma generate"))} to generate Prisma Client.`}`);
274
+ ${`Run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${this.cliCommand} generate`))} to generate Prisma Client.`}`);
269
275
  }
270
276
  return "";
271
277
  }
@@ -280,8 +286,8 @@ ${warnings}`;
280
286
  if (error) {
281
287
  return new import_internals.HelpError(`
282
288
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
283
- ${_DbPull.help}`);
289
+ ${renderHelp(this.cliCommand)}`);
284
290
  }
285
- return _DbPull.help;
291
+ return renderHelp(this.cliCommand);
286
292
  }
287
293
  };
@@ -16,19 +16,19 @@ 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_DPRQXN36_exports = {};
20
- __export(chunk_DPRQXN36_exports, {
19
+ var chunk_DTSU3YZP_exports = {};
20
+ __export(chunk_DTSU3YZP_exports, {
21
21
  dbExecuteCompletion: () => dbExecuteCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_DPRQXN36_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_DTSU3YZP_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var dbExecuteCompletion = {
26
26
  name: "db execute",
27
27
  description: "Execute SQL or scripts on your database",
28
28
  options: [
29
29
  { name: "help", alias: "h", description: "Display this help message" },
30
- { name: "config", description: "Custom path to your Prisma config file", values: import_completion_values.completionConfigPaths },
31
- { name: "file", description: "Path to a file containing the script to execute", values: import_completion_values.completionSqlScriptPaths },
30
+ { name: "config", description: "Custom path to your Prisma config file", values: import_internals.completionConfigPaths },
31
+ { name: "file", description: "Path to a file containing the script to execute", values: import_internals.completionSqlScriptPaths },
32
32
  { name: "stdin", description: "Use terminal standard input as the script to execute" }
33
33
  ]
34
34
  };
@@ -16,20 +16,20 @@ 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_WA2SOLDQ_exports = {};
20
- __export(chunk_WA2SOLDQ_exports, {
19
+ var chunk_EGNBSKBG_exports = {};
20
+ __export(chunk_EGNBSKBG_exports, {
21
21
  migrateResolveCompletion: () => migrateResolveCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_WA2SOLDQ_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_EGNBSKBG_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateResolveCompletion = {
26
26
  name: "migrate resolve",
27
27
  description: "Mark a migration as applied or rolled back",
28
28
  options: [
29
29
  { name: "help", alias: "h", description: "Display this help message" },
30
- { name: "schema", description: "Custom path to your Prisma schema", values: import_completion_values.completionSchemaPaths },
31
- { name: "config", description: "Custom path to your Prisma config file", values: import_completion_values.completionConfigPaths },
32
- { name: "applied", description: "Mark a migration as applied", values: import_completion_values.completionMigrationIds },
33
- { name: "rolled-back", description: "Mark a migration as rolled back", values: import_completion_values.completionMigrationIds }
30
+ { name: "schema", description: "Custom path to your Prisma schema", values: import_internals.completionSchemaPaths },
31
+ { name: "config", description: "Custom path to your Prisma config file", values: import_internals.completionConfigPaths },
32
+ { name: "applied", description: "Mark a migration as applied", values: import_internals.completionMigrationIds },
33
+ { name: "rolled-back", description: "Mark a migration as rolled back", values: import_internals.completionMigrationIds }
34
34
  ]
35
35
  };
@@ -16,26 +16,20 @@ 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_DNNMOG7A_exports = {};
20
- __export(chunk_DNNMOG7A_exports, {
19
+ var chunk_F2LZOLZK_exports = {};
20
+ __export(chunk_F2LZOLZK_exports, {
21
21
  MigrateCommand: () => MigrateCommand
22
22
  });
23
- module.exports = __toCommonJS(chunk_DNNMOG7A_exports);
23
+ module.exports = __toCommonJS(chunk_F2LZOLZK_exports);
24
24
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
25
25
  var import_internals = require("@prisma/internals");
26
- var MigrateCommand = class _MigrateCommand {
27
- constructor(cmds) {
28
- this.cmds = cmds;
29
- }
30
- static new(cmds) {
31
- return new _MigrateCommand(cmds);
32
- }
33
- static help = (0, import_internals.format)(`
26
+ function renderHelp(cliCommand) {
27
+ return (0, import_internals.format)(`
34
28
  Update the database schema with migrations
35
29
 
36
30
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
37
31
 
38
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate [command] [options]
32
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate [command] [options]
39
33
 
40
34
  ${(0, import_chunk_SKRR5WT4.bold)("Commands for development")}
41
35
 
@@ -62,26 +56,32 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
62
56
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
63
57
 
64
58
  Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
65
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev
59
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate dev
66
60
 
67
61
  Reset your database and apply all migrations
68
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset
62
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate reset
69
63
 
70
64
  Apply pending migrations to the database in production/staging
71
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate deploy
65
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate deploy
72
66
 
73
67
  Check the status of migrations in the production/staging database
74
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status
68
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate status
75
69
 
76
70
  Specify a schema
77
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status --schema=./schema.prisma
71
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate status --schema=./schema.prisma
78
72
 
79
73
  Compare the database schema from two databases and render the diff as a SQL script
80
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
81
- --from-url "$DATABASE_URL" \\
82
- --to-url "postgresql://login:password@localhost:5432/db" \\
83
- --script
74
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff --from-url "$DATABASE_URL" --to-url "postgresql://login:password@localhost:5432/db" --script
84
75
  `);
76
+ }
77
+ var MigrateCommand = class _MigrateCommand {
78
+ constructor(cmds, cliCommand) {
79
+ this.cmds = cmds;
80
+ this.cliCommand = cliCommand;
81
+ }
82
+ static new(cmds, cliCommand) {
83
+ return new _MigrateCommand(cmds, cliCommand);
84
+ }
85
85
  async parse(argv, config, baseDir) {
86
86
  const args = (0, import_internals.arg)(argv, {
87
87
  "--help": Boolean,
@@ -108,14 +108,15 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
108
108
  }
109
109
  return cmd.parse(argsForCmd, config, baseDir);
110
110
  }
111
- return (0, import_internals.unknownCommand)(_MigrateCommand.help, commandName);
111
+ return (0, import_internals.unknownCommand)(renderHelp(this.cliCommand), commandName);
112
112
  }
113
113
  help(error) {
114
+ const help = renderHelp(this.cliCommand);
114
115
  if (error) {
115
116
  return new import_internals.HelpError(`
116
117
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
117
- ${_MigrateCommand.help}`);
118
+ ${help}`);
118
119
  }
119
- return _MigrateCommand.help;
120
+ return help;
120
121
  }
121
122
  };
@@ -16,42 +16,42 @@ 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_PPE4XDUL_exports = {};
20
- __export(chunk_PPE4XDUL_exports, {
19
+ var chunk_GD52HTMX_exports = {};
20
+ __export(chunk_GD52HTMX_exports, {
21
21
  migrateDiffCompletion: () => migrateDiffCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_PPE4XDUL_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_GD52HTMX_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateDiffCompletion = {
26
26
  name: "migrate diff",
27
27
  description: "Compare the database schema from two arbitrary sources",
28
28
  options: [
29
29
  { name: "help", alias: "h", description: "Display this help message" },
30
- { name: "config", description: "Custom path to your Prisma config file", values: import_completion_values.completionConfigPaths },
30
+ { name: "config", description: "Custom path to your Prisma config file", values: import_internals.completionConfigPaths },
31
31
  {
32
32
  name: "output",
33
33
  alias: "o",
34
34
  description: "Write the diff to a file instead of stdout",
35
- values: import_completion_values.completionDiffOutputPaths
35
+ values: import_internals.completionDiffOutputPaths
36
36
  },
37
37
  { name: "from-empty", description: "Assume the source data model is empty" },
38
- { name: "from-schema", description: "Path to a Prisma schema file as the source", values: import_completion_values.completionSchemaPaths },
38
+ { name: "from-schema", description: "Path to a Prisma schema file as the source", values: import_internals.completionSchemaPaths },
39
39
  {
40
40
  name: "from-migrations",
41
41
  description: "Path to a Prisma migrations directory as the source",
42
- values: import_completion_values.completionMigrationsDirPaths
42
+ values: import_internals.completionMigrationsDirPaths
43
43
  },
44
44
  { name: "from-config-datasource", description: "Use the datasource from the Prisma config file as the source" },
45
45
  { name: "to-empty", description: "Assume the destination data model is empty" },
46
46
  {
47
47
  name: "to-schema",
48
48
  description: "Path to a Prisma schema file as the destination",
49
- values: import_completion_values.completionSchemaPaths
49
+ values: import_internals.completionSchemaPaths
50
50
  },
51
51
  {
52
52
  name: "to-migrations",
53
53
  description: "Path to a Prisma migrations directory as the destination",
54
- values: import_completion_values.completionMigrationsDirPaths
54
+ values: import_internals.completionMigrationsDirPaths
55
55
  },
56
56
  {
57
57
  name: "to-config-datasource",