@prisma/migrate 7.10.0-dev.8 → 7.10.0-integration-prisma7-project-closeout.10

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 +41 -35
  5. package/dist/{chunk-FXSCTGN2.js → chunk-3C5DQOOW.js} +5 -5
  6. package/dist/{chunk-HWBQGGZH.js → chunk-3NKLI5KP.js} +9 -9
  7. package/dist/{chunk-6TSRRBNA.js → chunk-57S5K3DX.js} +7 -7
  8. package/dist/{chunk-UA3FFRRV.js → chunk-5YSI4XSU.js} +25 -19
  9. package/dist/{chunk-7CQBDP4H.js → chunk-6F7CAPL7.js} +9 -10
  10. package/dist/{chunk-GBUW4I6U.js → chunk-7KCEXIB2.js} +6 -6
  11. package/dist/{chunk-TEOIOJ7P.js → chunk-A6PUWLVN.js} +6 -6
  12. package/dist/{chunk-LZ2DWYUY.js → chunk-BWFPKWBD.js} +7 -7
  13. package/dist/{chunk-QCPYZUFF.js → chunk-BZ2JSF42.js} +31 -29
  14. package/dist/{chunk-DPRQXN36.js → chunk-DTSU3YZP.js} +6 -6
  15. package/dist/{chunk-WA2SOLDQ.js → chunk-EGNBSKBG.js} +8 -8
  16. package/dist/{chunk-DNNMOG7A.js → chunk-F2LZOLZK.js} +25 -24
  17. package/dist/{chunk-PPE4XDUL.js → chunk-GD52HTMX.js} +10 -10
  18. package/dist/{chunk-2HCAA4GX.js → chunk-GHPP2B5T.js} +27 -23
  19. package/dist/{chunk-XTEEOIUV.js → chunk-HMVLLUKH.js} +18 -13
  20. package/dist/{chunk-WP5M3D4N.js → chunk-I3UQXXYF.js} +30 -27
  21. package/dist/{chunk-RM4WK3ML.js → chunk-I7UMFS37.js} +33 -26
  22. package/dist/{chunk-CQTYRADU.js → chunk-IKF6HBHH.js} +23 -18
  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-AL3XYISJ.js → chunk-MQ76MQ53.js} +55 -50
  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-THJ7K72W.js → chunk-SFFTVLXC.js} +6 -6
  30. package/dist/{chunk-PEUHUCS4.js → chunk-T25WPL3D.js} +632 -625
  31. package/dist/{chunk-NHSJJSXU.js → chunk-TKQMAG6L.js} +5 -5
  32. package/dist/{chunk-6EQA63NM.js → chunk-UWVWZK5Z.js} +38 -32
  33. package/dist/{chunk-TW5MYPTK.js → chunk-VJKZQVKX.js} +26 -21
  34. package/dist/{chunk-DL2W77GY.js → chunk-W4WHE5HS.js} +33 -30
  35. package/dist/{chunk-TDN3QQTH.js → chunk-Y3QVFDLE.js} +29 -24
  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,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",
@@ -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
  };
@@ -16,11 +16,11 @@ 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_XTEEOIUV_exports = {};
20
- __export(chunk_XTEEOIUV_exports, {
19
+ var chunk_HMVLLUKH_exports = {};
20
+ __export(chunk_HMVLLUKH_exports, {
21
21
  DbSeed: () => DbSeed
22
22
  });
23
- module.exports = __toCommonJS(chunk_XTEEOIUV_exports);
23
+ module.exports = __toCommonJS(chunk_HMVLLUKH_exports);
24
24
  var import_chunk_L7EZFBB4 = require("./chunk-L7EZFBB4.js");
25
25
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
26
26
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
@@ -169,16 +169,13 @@ var require_arg = (0, import_chunk_2ESYSVXG.__commonJS)({
169
169
  }
170
170
  });
171
171
  var import_arg = (0, import_chunk_2ESYSVXG.__toESM)(require_arg());
172
- var DbSeed = class _DbSeed {
173
- static new() {
174
- return new _DbSeed();
175
- }
176
- static help = (0, import_internals.format)(`
172
+ function renderHelp(cliCommand) {
173
+ return (0, import_internals.format)(`
177
174
  ${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
178
175
 
179
176
  ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
180
177
 
181
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed [options]
178
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db seed [options]
182
179
 
183
180
  ${(0, import_chunk_SKRR5WT4.bold)("Options")}
184
181
 
@@ -188,8 +185,16 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
188
185
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
189
186
 
190
187
  Passing extra arguments to the seed command
191
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
188
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${cliCommand} db seed -- --arg1 value1 --arg2 value2
192
189
  `);
190
+ }
191
+ var DbSeed = class _DbSeed {
192
+ constructor(cliCommand) {
193
+ this.cliCommand = cliCommand;
194
+ }
195
+ static new(cliCommand) {
196
+ return new _DbSeed(cliCommand);
197
+ }
193
198
  async parse(argv, config) {
194
199
  const args = (0, import_internals.arg)(
195
200
  argv,
@@ -206,7 +211,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
206
211
  if (args instanceof import_arg.ArgError && args.code === "ARG_UNKNOWN_OPTION") {
207
212
  throw new Error(`${args.message}
208
213
  Did you mean to pass these as arguments to your seed script? If so, add a -- separator before them:
209
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2`);
214
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} ${this.cliCommand} db seed -- --arg1 value1 --arg2 value2`);
210
215
  }
211
216
  return this.help(args.message);
212
217
  }
@@ -245,8 +250,8 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
245
250
  if (error) {
246
251
  return new import_internals.HelpError(`
247
252
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
248
- ${_DbSeed.help}`);
253
+ ${renderHelp(this.cliCommand)}`);
249
254
  }
250
- return _DbSeed.help;
255
+ return renderHelp(this.cliCommand);
251
256
  }
252
257
  };
@@ -26,29 +26,26 @@ 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_I3UQXXYF_exports = {};
30
+ __export(chunk_I3UQXXYF_exports, {
31
31
  DbPush: () => DbPush
32
32
  });
33
- module.exports = __toCommonJS(chunk_WP5M3D4N_exports);
33
+ module.exports = __toCommonJS(chunk_I3UQXXYF_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
50
  The datasource URL configuration is read from the Prisma config file (e.g., ${(0, import_chunk_SKRR5WT4.italic)("prisma.config.ts")}).
54
51
 
@@ -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
  };
@@ -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) {