@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
@@ -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_2HCAA4GX_exports = {};
20
- __export(chunk_2HCAA4GX_exports, {
19
+ var chunk_GHPP2B5T_exports = {};
20
+ __export(chunk_GHPP2B5T_exports, {
21
21
  DbCommand: () => DbCommand
22
22
  });
23
- module.exports = __toCommonJS(chunk_2HCAA4GX_exports);
23
+ module.exports = __toCommonJS(chunk_GHPP2B5T_exports);
24
24
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
25
25
  var import_internals = require("@prisma/internals");
26
- var DbCommand = class _DbCommand {
27
- constructor(cmds) {
28
- this.cmds = cmds;
29
- }
30
- static new(cmds) {
31
- return new _DbCommand(cmds);
32
- }
33
- static help = (0, import_internals.format)(`
26
+ function renderHelp(cliCommand) {
27
+ return (0, import_internals.format)(`
34
28
  ${process.platform === "win32" ? "" : "\u{1F3CB}\uFE0F "}Manage your database schema and lifecycle during development.
35
29
 
36
30
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
37
31
 
38
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db [command] [options]
32
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db [command] [options]
39
33
 
40
34
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
41
35
 
@@ -51,18 +45,27 @@ ${(0, import_chunk_SKRR5WT4.bold)("Commands")}
51
45
 
52
46
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
53
47
 
54
- Run \`prisma db pull\`
55
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db pull
48
+ Run \`${cliCommand} db pull\`
49
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db pull
56
50
 
57
- Run \`prisma db push\`
58
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
51
+ Run \`${cliCommand} db push\`
52
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db push
59
53
 
60
- Run \`prisma db seed\`
61
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed
54
+ Run \`${cliCommand} db seed\`
55
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db seed
62
56
 
63
- Run \`prisma db execute\`
64
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db execute
57
+ Run \`${cliCommand} db execute\`
58
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db execute
65
59
  `);
60
+ }
61
+ var DbCommand = class _DbCommand {
62
+ constructor(cmds, cliCommand) {
63
+ this.cmds = cmds;
64
+ this.cliCommand = cliCommand;
65
+ }
66
+ static new(cmds, cliCommand) {
67
+ return new _DbCommand(cmds, cliCommand);
68
+ }
66
69
  async parse(argv, config, baseDir) {
67
70
  const args = (0, import_internals.arg)(argv, {
68
71
  "--help": Boolean,
@@ -82,14 +85,15 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
82
85
  const argsForCmd = args["--preview-feature"] ? [...args._.slice(1), `--preview-feature`] : args._.slice(1);
83
86
  return cmd.parse(argsForCmd, config, baseDir);
84
87
  }
85
- return (0, import_internals.unknownCommand)(_DbCommand.help, args._[0]);
88
+ return (0, import_internals.unknownCommand)(renderHelp(this.cliCommand), args._[0]);
86
89
  }
87
90
  help(error) {
91
+ const help = renderHelp(this.cliCommand);
88
92
  if (error) {
89
93
  return new import_internals.HelpError(`
90
94
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
91
- ${_DbCommand.help}`);
95
+ ${help}`);
92
96
  }
93
- return _DbCommand.help;
97
+ return help;
94
98
  }
95
99
  };
@@ -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_RM4WK3ML_exports = {};
30
- __export(chunk_RM4WK3ML_exports, {
29
+ var chunk_I7UMFS37_exports = {};
30
+ __export(chunk_I7UMFS37_exports, {
31
31
  MigrateDiff: () => MigrateDiff,
32
32
  getRemovedTargetParameterHint: () => getRemovedTargetParameterHint
33
33
  });
34
- module.exports = __toCommonJS(chunk_RM4WK3ML_exports);
34
+ module.exports = __toCommonJS(chunk_I7UMFS37_exports);
35
35
  var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
36
- var import_chunk_RGXJYLMD = require("./chunk-RGXJYLMD.js");
36
+ var import_chunk_ZOYXSZ2J = require("./chunk-ZOYXSZ2J.js");
37
37
  var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
38
38
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
39
39
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
@@ -3166,10 +3166,11 @@ var require_main = (0, import_chunk_2ESYSVXG.__commonJS)({
3166
3166
  });
3167
3167
  var import_fs_jetpack = (0, import_chunk_2ESYSVXG.__toESM)(require_main());
3168
3168
  var debug = (0, import_debug.default)("prisma:migrate:diff");
3169
- var helpOptions = (0, import_internals.format)(
3170
- `${(0, import_chunk_SKRR5WT4.bold)("Usage")}
3169
+ function renderHelpOptions(cliCommand) {
3170
+ return (0, import_internals.format)(
3171
+ `${(0, import_chunk_SKRR5WT4.bold)("Usage")}
3171
3172
 
3172
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff [options]
3173
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff [options]
3173
3174
 
3174
3175
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
3175
3176
 
@@ -3194,16 +3195,14 @@ ${(0, import_chunk_SKRR5WT4.bold)("Flags")}
3194
3195
 
3195
3196
  --script Render a SQL script to stdout instead of the default human readable summary (not supported on MongoDB)
3196
3197
  --exit-code Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1.`
3197
- );
3198
- var MigrateDiff = class _MigrateDiff {
3199
- static new() {
3200
- return new _MigrateDiff();
3201
- }
3202
- static help = (0, import_internals.format)(`
3198
+ );
3199
+ }
3200
+ function renderHelp(cliCommand) {
3201
+ return (0, import_internals.format)(`
3203
3202
  ${process.platform === "win32" ? "" : "\u{1F50D} "}Compares the database schema from two arbitrary sources, and outputs the differences either as a human-readable summary (by default) or an executable script.
3204
3203
 
3205
- ${(0, import_chunk_SKRR5WT4.green)(`prisma migrate diff`)} is a read-only command that does not write to your datasource(s).
3206
- ${(0, import_chunk_SKRR5WT4.green)(`prisma db execute`)} can be used to execute its ${(0, import_chunk_SKRR5WT4.green)(`--script`)} output.
3204
+ ${(0, import_chunk_SKRR5WT4.green)(`${cliCommand} migrate diff`)} is a read-only command that does not write to your datasource(s).
3205
+ ${(0, import_chunk_SKRR5WT4.green)(`${cliCommand} db execute`)} can be used to execute its ${(0, import_chunk_SKRR5WT4.green)(`--script`)} output.
3207
3206
 
3208
3207
  The command takes a source ${(0, import_chunk_SKRR5WT4.green)(`--from-...`)} and a destination ${(0, import_chunk_SKRR5WT4.green)(`--to-...`)}.
3209
3208
  The source and destination must use the same provider,
@@ -3215,42 +3214,50 @@ The default output is a human readable diff, it can be rendered as SQL using \`-
3215
3214
 
3216
3215
  See the documentation for more information ${(0, import_internals.link)("https://pris.ly/d/migrate-diff")}
3217
3216
 
3218
- ${helpOptions}
3217
+ ${renderHelpOptions(cliCommand)}
3219
3218
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
3220
3219
 
3221
3220
  From the configured database to a Prisma datamodel
3222
3221
  e.g. roll forward after a migration failed in the middle
3223
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
3222
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff \\
3224
3223
  --from-config-datasource \\
3225
3224
  --to-schema=next_datamodel.prisma \\
3226
3225
  --script
3227
3226
 
3228
3227
  From a Prisma datamodel to the configured database
3229
3228
  e.g. roll forward after a migration failed in the middle
3230
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
3229
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff \\
3231
3230
  --from-schema=next_datamodel.prisma \\
3232
3231
  --to-config-datasource \\
3233
3232
  --script
3234
3233
 
3235
3234
  From a Prisma Migrate \`migrations\` directory to the configured database
3236
3235
  e.g. generate a migration for a hotfix already applied on production
3237
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
3236
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff \\
3238
3237
  --from-migrations ./migrations \\
3239
3238
  --to-config-datasource \\
3240
3239
  --script
3241
3240
 
3242
- Execute the --script output with \`prisma db execute\` using bash pipe \`|\`
3243
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
3241
+ Execute the --script output with \`${cliCommand} db execute\` using bash pipe \`|\`
3242
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff \\
3244
3243
  --from-[...] \\
3245
3244
  --to-[...] \\
3246
- --script | prisma db execute --stdin --url="$DATABASE_URL"
3245
+ --script | ${cliCommand} db execute --stdin --url="$DATABASE_URL"
3247
3246
 
3248
3247
  Detect if both sources are in sync, it will exit with exit code 2 if changes are detected
3249
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
3248
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} migrate diff \\
3250
3249
  --exit-code \\
3251
3250
  --from-[...] \\
3252
3251
  --to-[...]
3253
3252
  `);
3253
+ }
3254
+ var MigrateDiff = class _MigrateDiff {
3255
+ constructor(cliCommand) {
3256
+ this.cliCommand = cliCommand;
3257
+ }
3258
+ static new(cliCommand) {
3259
+ return new _MigrateDiff(cliCommand);
3260
+ }
3254
3261
  async parse(argv, config, baseDir) {
3255
3262
  const args = (0, import_internals.arg)(
3256
3263
  argv,
@@ -3378,7 +3385,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
3378
3385
  externalTables: config.tables?.external ?? [],
3379
3386
  externalEnums: config.enums?.external ?? []
3380
3387
  };
3381
- const migrate = await import_chunk_RGXJYLMD.Migrate.setup({
3388
+ const migrate = await import_chunk_ZOYXSZ2J.Migrate.setup({
3382
3389
  schemaEngineConfig: config,
3383
3390
  baseDir,
3384
3391
  schemaFilter,
@@ -3423,9 +3430,9 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
3423
3430
  throw new import_internals.HelpError(`
3424
3431
  ${error}
3425
3432
 
3426
- ${helpOptions}`);
3433
+ ${renderHelpOptions(this.cliCommand)}`);
3427
3434
  }
3428
- return _MigrateDiff.help;
3435
+ return renderHelp(this.cliCommand);
3429
3436
  }
3430
3437
  };
3431
3438
  function getRemovedTargetParameterHint(parameter) {
@@ -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_NGEWTXY6_exports = {};
20
- __export(chunk_NGEWTXY6_exports, {
19
+ var chunk_J6BC6QDB_exports = {};
20
+ __export(chunk_J6BC6QDB_exports, {
21
21
  migrateCompletion: () => migrateCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_NGEWTXY6_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_J6BC6QDB_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateCompletion = {
26
26
  name: "migrate",
27
27
  description: "Migrate 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: "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
  };
@@ -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_6DDIA3ZD_exports = {};
30
- __export(chunk_6DDIA3ZD_exports, {
29
+ var chunk_KDAXJMEP_exports = {};
30
+ __export(chunk_KDAXJMEP_exports, {
31
31
  EngineError: () => EngineError,
32
32
  SchemaEngineCLI: () => SchemaEngineCLI
33
33
  });
34
- module.exports = __toCommonJS(chunk_6DDIA3ZD_exports);
35
- var import_chunk_PEUHUCS4 = require("./chunk-PEUHUCS4.js");
34
+ module.exports = __toCommonJS(chunk_KDAXJMEP_exports);
35
+ var import_chunk_T25WPL3D = require("./chunk-T25WPL3D.js");
36
36
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
37
37
  var import_node_readline = __toESM(require("node:readline"));
38
38
  var import_debug = __toESM(require("@prisma/debug"));
@@ -187,7 +187,7 @@ var SchemaEngineCLI = class _SchemaEngineCLI {
187
187
  );
188
188
  const { views } = introspectResult;
189
189
  if (views) {
190
- await (0, import_chunk_PEUHUCS4.handleViewsIO)({ views, viewsDirectoryPath });
190
+ await (0, import_chunk_T25WPL3D.handleViewsIO)({ views, viewsDirectoryPath });
191
191
  }
192
192
  return introspectResult;
193
193
  } finally {
@@ -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_ZUHJASAP_exports = {};
20
- __export(chunk_ZUHJASAP_exports, {
19
+ var chunk_KYZDCMJW_exports = {};
20
+ __export(chunk_KYZDCMJW_exports, {
21
21
  ConfigValidationError: () => ConfigValidationError,
22
22
  DbDropNeedsForceError: () => DbDropNeedsForceError,
23
23
  DbPushIgnoreWarningsWithFlagError: () => DbPushIgnoreWarningsWithFlagError,
@@ -26,7 +26,7 @@ __export(chunk_ZUHJASAP_exports, {
26
26
  MigrateResetEnvNonInteractiveError: () => MigrateResetEnvNonInteractiveError,
27
27
  NoSchemaFoundError: () => NoSchemaFoundError
28
28
  });
29
- module.exports = __toCommonJS(chunk_ZUHJASAP_exports);
29
+ module.exports = __toCommonJS(chunk_KYZDCMJW_exports);
30
30
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
31
31
  var import_internals = require("@prisma/internals");
32
32
  var ConfigValidationError = class extends Error {
@@ -51,20 +51,20 @@ You can either provide it with ${(0, import_chunk_SKRR5WT4.green)(
51
51
  };
52
52
  (0, import_internals.setClassName)(NoSchemaFoundError, "NoSchemaFoundError");
53
53
  var DbPushIgnoreWarningsWithFlagError = class extends Error {
54
- constructor() {
54
+ constructor(cliCommand) {
55
55
  super(
56
56
  `Use the --accept-data-loss flag to ignore the data loss warnings like ${(0, import_chunk_SKRR5WT4.bold)(
57
- (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db push --accept-data-loss"))
57
+ (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${cliCommand} db push --accept-data-loss`))
58
58
  )}`
59
59
  );
60
60
  }
61
61
  };
62
62
  (0, import_internals.setClassName)(DbPushIgnoreWarningsWithFlagError, "DbPushIgnoreWarningsWithFlagError");
63
63
  var MigrateNeedsForceError = class extends Error {
64
- constructor(subcommand) {
64
+ constructor(subcommand, cliCommand) {
65
65
  super(
66
66
  `Use the --force flag to use the ${subcommand} command in an unattended environment like ${(0, import_chunk_SKRR5WT4.bold)(
67
- (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`prisma migrate ${subcommand} --force`))
67
+ (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${cliCommand} migrate ${subcommand} --force`))
68
68
  )}`
69
69
  );
70
70
  }
@@ -82,22 +82,22 @@ See ${(0, import_internals.link)("https://pris.ly/d/migrate-reset")}`
82
82
  };
83
83
  (0, import_internals.setClassName)(MigrateResetEnvNonInteractiveError, "MigrateResetEnvNonInteractiveError");
84
84
  var MigrateDevEnvNonInteractiveError = class extends Error {
85
- constructor() {
85
+ constructor(cliCommand) {
86
86
  super(
87
87
  `Prisma Migrate has detected that the environment is non-interactive, which is not supported.
88
88
 
89
- \`prisma migrate dev\` is an interactive command designed to create new migrations and evolve the database in development.
90
- To apply existing migrations in deployments, use ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)(`prisma migrate deploy`))}.
89
+ \`${cliCommand} migrate dev\` is an interactive command designed to create new migrations and evolve the database in development.
90
+ To apply existing migrations in deployments, use ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${cliCommand} migrate deploy`)))}.
91
91
  See ${(0, import_internals.link)("https://pris.ly/d/migrate-deploy")}`
92
92
  );
93
93
  }
94
94
  };
95
95
  (0, import_internals.setClassName)(MigrateDevEnvNonInteractiveError, "MigrateDevEnvNonInteractiveError");
96
96
  var DbDropNeedsForceError = class extends Error {
97
- constructor(subcommand) {
97
+ constructor(subcommand, cliCommand) {
98
98
  super(
99
99
  `Use the --force flag to use the ${subcommand} command in an unattended environment like ${(0, import_chunk_SKRR5WT4.bold)(
100
- (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`prisma db ${subcommand} --force --preview-feature`))
100
+ (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${cliCommand} db ${subcommand} --force --preview-feature`))
101
101
  )}`
102
102
  );
103
103
  }
@@ -26,24 +26,21 @@ 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_UA3FFRRV_exports = {};
30
- __export(chunk_UA3FFRRV_exports, {
29
+ var chunk_NSQ3NTDD_exports = {};
30
+ __export(chunk_NSQ3NTDD_exports, {
31
31
  DbDrop: () => DbDrop
32
32
  });
33
- module.exports = __toCommonJS(chunk_UA3FFRRV_exports);
33
+ module.exports = __toCommonJS(chunk_NSQ3NTDD_exports);
34
34
  var import_chunk_IHDN3L3R = require("./chunk-IHDN3L3R.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
39
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
40
40
  var import_internals = require("@prisma/internals");
41
41
  var import_prompts = __toESM(require("prompts"));
42
- var DbDrop = class _DbDrop {
43
- static new() {
44
- return new _DbDrop();
45
- }
46
- static help = (0, import_internals.format)(`
42
+ function renderHelp(cliCommand) {
43
+ return (0, import_internals.format)(`
47
44
  ${process.platform === "win32" ? "" : "\u{1F4A3} "}Drop the database
48
45
 
49
46
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.yellow)("WARNING"))} ${(0, import_chunk_SKRR5WT4.bold)(
@@ -54,9 +51,9 @@ ${(0, import_chunk_SKRR5WT4.dim)("When using any of the subcommands below you ne
54
51
 
55
52
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
56
53
 
57
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop [options] --preview-feature
54
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db drop [options] --preview-feature
58
55
 
59
- The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma.config.ts")}).
56
+ The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma7.config.ts")}).
60
57
 
61
58
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
62
59
 
@@ -68,14 +65,22 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
68
65
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
69
66
 
70
67
  Drop the database
71
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature
68
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db drop --preview-feature
72
69
 
73
70
  Specify a schema
74
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --schema=./schema.prisma
71
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db drop --preview-feature --schema=./schema.prisma
75
72
 
76
73
  Use --force to skip the confirmation prompt
77
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --force
74
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db drop --preview-feature --force
78
75
  `);
76
+ }
77
+ var DbDrop = class _DbDrop {
78
+ constructor(cliCommand) {
79
+ this.cliCommand = cliCommand;
80
+ }
81
+ static new(cliCommand) {
82
+ return new _DbDrop(cliCommand);
83
+ }
79
84
  async parse(argv, config, baseDir) {
80
85
  const args = (0, import_internals.arg)(argv, {
81
86
  "--help": Boolean,
@@ -103,15 +108,15 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
103
108
  baseDir
104
109
  })
105
110
  });
106
- const cmd = "db drop";
107
- const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config, cmd });
108
- (0, import_internals.checkUnsupportedDataProxy)({ cmd, validatedConfig });
111
+ const cmd = `${this.cliCommand} db drop`;
112
+ const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config, command: cmd });
113
+ (0, import_internals.checkUnsupportedDataProxy)({ command: cmd, validatedConfig });
109
114
  const datasourceInfo = (0, import_chunk_BRPS327A.parseDatasourceInfo)(schemaContext.primaryDatasource, validatedConfig);
110
115
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
111
116
  process.stdout.write("\n");
112
117
  if (!args["--force"]) {
113
118
  if (!(0, import_internals.canPrompt)()) {
114
- throw new import_chunk_ZUHJASAP.DbDropNeedsForceError("drop");
119
+ throw new import_chunk_KYZDCMJW.DbDropNeedsForceError("drop", this.cliCommand);
115
120
  }
116
121
  const confirmation = await (0, import_prompts.default)({
117
122
  type: "text",
@@ -140,11 +145,12 @@ ${(0, import_chunk_SKRR5WT4.red)("All data will be lost")}.`
140
145
  }
141
146
  }
142
147
  help(error) {
148
+ const help = renderHelp(this.cliCommand);
143
149
  if (error) {
144
150
  return new import_internals.HelpError(`
145
151
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
146
- ${_DbDrop.help}`);
152
+ ${help}`);
147
153
  }
148
- return _DbDrop.help;
154
+ return help;
149
155
  }
150
156
  };
@@ -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_VEBRKA5H_exports = {};
20
- __export(chunk_VEBRKA5H_exports, {
19
+ var chunk_OQKFK65J_exports = {};
20
+ __export(chunk_OQKFK65J_exports, {
21
21
  migrateStatusCompletion: () => migrateStatusCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_VEBRKA5H_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_OQKFK65J_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateStatusCompletion = {
26
26
  name: "migrate status",
27
27
  description: "Check the status of your database 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
  ]
33
33
  };
@@ -16,25 +16,25 @@ 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_YNB3IN6Q_exports = {};
20
- __export(chunk_YNB3IN6Q_exports, {
19
+ var chunk_OXZFIZV6_exports = {};
20
+ __export(chunk_OXZFIZV6_exports, {
21
21
  migrateDevCompletion: () => migrateDevCompletion
22
22
  });
23
- module.exports = __toCommonJS(chunk_YNB3IN6Q_exports);
24
- var import_completion_values = require("@prisma/internals/src/cli/completion-values");
23
+ module.exports = __toCommonJS(chunk_OXZFIZV6_exports);
24
+ var import_internals = require("@prisma/internals");
25
25
  var migrateDevCompletion = {
26
26
  name: "migrate dev",
27
27
  description: "Create and apply migrations in development",
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
  {
33
33
  name: "url",
34
34
  description: "Override the datasource URL from the Prisma config file",
35
- values: import_completion_values.completionDatasourceUrls
35
+ values: import_internals.completionDatasourceUrls
36
36
  },
37
- { name: "name", alias: "n", description: "Name the migration", values: import_completion_values.completionMigrationNames },
37
+ { name: "name", alias: "n", description: "Name the migration", values: import_internals.completionMigrationNames },
38
38
  { name: "create-only", description: "Create a new migration but do not apply it" }
39
39
  ]
40
40
  };
@@ -26,31 +26,28 @@ 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_WP5M3D4N_exports = {};
30
- __export(chunk_WP5M3D4N_exports, {
29
+ var chunk_PCCMNZGX_exports = {};
30
+ __export(chunk_PCCMNZGX_exports, {
31
31
  DbPush: () => DbPush
32
32
  });
33
- module.exports = __toCommonJS(chunk_WP5M3D4N_exports);
33
+ module.exports = __toCommonJS(chunk_PCCMNZGX_exports);
34
34
  var import_chunk_PHX6STZ3 = require("./chunk-PHX6STZ3.js");
35
- var import_chunk_ZUHJASAP = require("./chunk-ZUHJASAP.js");
35
+ var import_chunk_KYZDCMJW = require("./chunk-KYZDCMJW.js");
36
36
  var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
37
37
  var import_chunk_BRPS327A = require("./chunk-BRPS327A.js");
38
- var import_chunk_RGXJYLMD = require("./chunk-RGXJYLMD.js");
38
+ var import_chunk_ZOYXSZ2J = require("./chunk-ZOYXSZ2J.js");
39
39
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
40
40
  var import_internals = require("@prisma/internals");
41
41
  var import_prompts = __toESM(require("prompts"));
42
- var DbPush = class _DbPush {
43
- static new() {
44
- return new _DbPush();
45
- }
46
- static help = (0, import_internals.format)(`
42
+ function renderHelp(cliCommand) {
43
+ return (0, import_internals.format)(`
47
44
  ${process.platform === "win32" ? "" : "\u{1F64C} "}Push the state from your Prisma schema to your database
48
45
 
49
46
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
50
47
 
51
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push [options]
48
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db push [options]
52
49
 
53
- The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma.config.ts")}).
50
+ The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma7.config.ts")}).
54
51
 
55
52
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
56
53
 
@@ -64,14 +61,22 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
64
61
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
65
62
 
66
63
  Push the Prisma schema state to the database
67
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
64
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db push
68
65
 
69
66
  Specify a schema
70
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --schema=./schema.prisma
67
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db push --schema=./schema.prisma
71
68
 
72
69
  Ignore data loss warnings
73
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --accept-data-loss
70
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db push --accept-data-loss
74
71
  `);
72
+ }
73
+ var DbPush = class _DbPush {
74
+ constructor(cliCommand) {
75
+ this.cliCommand = cliCommand;
76
+ }
77
+ static new(cliCommand) {
78
+ return new _DbPush(cliCommand);
79
+ }
75
80
  async parse(argv, config, baseDir) {
76
81
  const args = (0, import_internals.arg)(
77
82
  argv,
@@ -111,16 +116,17 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
111
116
  }
112
117
  };
113
118
  }
114
- const cmd = "db push";
115
- const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config: cmdSpecificConfig, cmd });
116
- (0, import_internals.checkUnsupportedDataProxy)({ cmd, validatedConfig });
119
+ const cmd = `${this.cliCommand} db push`;
120
+ const validatedConfig = (0, import_internals.validatePrismaConfigWithDatasource)({ config: cmdSpecificConfig, command: cmd });
121
+ (0, import_internals.checkUnsupportedDataProxy)({ command: cmd, validatedConfig });
122
+ const datasourceProvider = (0, import_internals.getSchemaDatasourceProvider)(schemaContext);
117
123
  const datasourceInfo = (0, import_chunk_BRPS327A.parseDatasourceInfo)(schemaContext.primaryDatasource, validatedConfig);
118
124
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
119
125
  const schemaFilter = {
120
126
  externalTables: cmdSpecificConfig.tables?.external ?? [],
121
127
  externalEnums: cmdSpecificConfig.enums?.external ?? []
122
128
  };
123
- const migrate = await import_chunk_RGXJYLMD.Migrate.setup({
129
+ const migrate = await import_chunk_ZOYXSZ2J.Migrate.setup({
124
130
  schemaEngineConfig: cmdSpecificConfig,
125
131
  baseDir,
126
132
  migrationsDirPath,
@@ -129,11 +135,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
129
135
  extensions: cmdSpecificConfig["extensions"]
130
136
  });
131
137
  try {
132
- const successMessage = await (0, import_chunk_BRPS327A.ensureDatabaseExists)(
133
- baseDir,
134
- (0, import_internals.getSchemaDatasourceProvider)(schemaContext),
135
- validatedConfig
136
- );
138
+ const successMessage = await (0, import_chunk_BRPS327A.ensureDatabaseExists)(baseDir, datasourceProvider, validatedConfig);
137
139
  if (successMessage) {
138
140
  process.stdout.write("\n" + successMessage + "\n");
139
141
  }
@@ -193,7 +195,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
193
195
  throw new Error(`${messages.join("\n")}
194
196
 
195
197
  You may use the --force-reset flag to drop the database before push like ${(0, import_chunk_SKRR5WT4.bold)(
196
- (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db push --force-reset"))
198
+ (0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)(`${this.cliCommand} db push --force-reset`))
197
199
  )}
198
200
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will be lost."))}
199
201
  `);
@@ -212,7 +214,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will
212
214
  if (!args["--accept-data-loss"]) {
213
215
  if (!(0, import_internals.canPrompt)()) {
214
216
  await migrate.stop();
215
- throw new import_chunk_ZUHJASAP.DbPushIgnoreWarningsWithFlagError();
217
+ throw new import_chunk_KYZDCMJW.DbPushIgnoreWarningsWithFlagError(this.cliCommand);
216
218
  }
217
219
  process.stdout.write("\n");
218
220
  const confirmation = await (0, import_prompts.default)({
@@ -226,6 +228,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will
226
228
  process.exit(130);
227
229
  }
228
230
  try {
231
+ (0, import_chunk_PHX6STZ3.aiAgentConfirmationCheckpoint)();
229
232
  await migrate.push({
230
233
  force: true
231
234
  });
@@ -258,8 +261,8 @@ ${rocketEmoji}${provider === "mongodb" ? migrationSuccessMongoMessage : migratio
258
261
  if (error) {
259
262
  return new import_internals.HelpError(`
260
263
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
261
- ${_DbPush.help}`);
264
+ ${renderHelp(this.cliCommand)}`);
262
265
  }
263
- return _DbPush.help;
266
+ return renderHelp(this.cliCommand);
264
267
  }
265
268
  };