@prisma/migrate 6.6.0-dev.24 → 6.6.0-dev.26

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 (91) hide show
  1. package/dist/CLI.js +3 -3
  2. package/dist/Migrate.js +6 -6
  3. package/dist/SchemaEngine.js +5 -5
  4. package/dist/bin.js +43 -43
  5. package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
  6. package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
  7. package/dist/{chunk-J4DAOTRR.js → chunk-324Z6HS7.js} +41 -43
  8. package/dist/chunk-33LPBNDX.js +1399 -0
  9. package/dist/{chunk-3WTXX6CQ.js → chunk-5LKIRKDL.js} +60 -60
  10. package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
  11. package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
  12. package/dist/{chunk-F62CN63F.js → chunk-B4SUSDC2.js} +30 -31
  13. package/dist/{chunk-ODH7XYW7.js → chunk-BURHAP6O.js} +46 -48
  14. package/dist/{chunk-7X4MPZIO.js → chunk-DQMYH4YE.js} +323 -337
  15. package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
  16. package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
  17. package/dist/{chunk-MREGRQDD.js → chunk-FBWTUBJC.js} +46 -45
  18. package/dist/{chunk-MATFO4ZW.js → chunk-G7PJKEOV.js} +33 -33
  19. package/dist/{chunk-PW3LNSDM.js → chunk-GPNGRJAR.js} +33 -35
  20. package/dist/{chunk-NAXFX7K7.js → chunk-HJFSTAJX.js} +30 -32
  21. package/dist/{chunk-4ZFVT4RS.js → chunk-IINN7QUV.js} +165 -190
  22. package/dist/{chunk-IR55GBON.js → chunk-IWC5MH4R.js} +5 -5
  23. package/dist/{chunk-ZOEKRXDP.js → chunk-K43RXWQY.js} +21 -18
  24. package/dist/{chunk-LQO5JIBW.js → chunk-KBAYLL3V.js} +324 -338
  25. package/dist/{chunk-3OQIC7NW.js → chunk-KMHFSDY6.js} +43 -45
  26. package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
  27. package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
  28. package/dist/{chunk-MKK3GSDF.js → chunk-MKS2ZJJ5.js} +5 -5
  29. package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
  30. package/dist/{chunk-IY67YUOD.js → chunk-NJYZPNB4.js} +54 -56
  31. package/dist/{chunk-EGPJABTW.js → chunk-TGV6QGEF.js} +69 -69
  32. package/dist/{chunk-3VFKYWQZ.js → chunk-URKH6SE2.js} +73 -80
  33. package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
  34. package/dist/{chunk-N5UBDQRA.js → chunk-VVP3QZ7Q.js} +21 -21
  35. package/dist/{chunk-DAYMMAJB.js → chunk-YBNDKPPO.js} +36 -38
  36. package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
  37. package/dist/{chunk-A6PMXMMT.js → chunk-ZB5NPOJW.js} +13 -13
  38. package/dist/{chunk-V5TUSOJX.js → chunk-ZGR2WQ62.js} +38 -40
  39. package/dist/commands/DbCommand.js +3 -3
  40. package/dist/commands/DbDrop.js +3 -3
  41. package/dist/commands/DbExecute.js +7 -7
  42. package/dist/commands/DbPull.js +9 -9
  43. package/dist/commands/DbPush.js +7 -7
  44. package/dist/commands/DbSeed.js +4 -4
  45. package/dist/commands/MigrateCommand.js +3 -3
  46. package/dist/commands/MigrateDeploy.js +9 -9
  47. package/dist/commands/MigrateDev.js +11 -11
  48. package/dist/commands/MigrateDiff.js +10 -10
  49. package/dist/commands/MigrateReset.js +10 -10
  50. package/dist/commands/MigrateResolve.js +7 -7
  51. package/dist/commands/MigrateStatus.js +7 -7
  52. package/dist/index.js +46 -46
  53. package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
  54. package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
  55. package/dist/types.js +1 -1
  56. package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
  57. package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
  58. package/dist/utils/byline.js +1 -1
  59. package/dist/utils/captureStdout.js +3 -3
  60. package/dist/utils/countModelsAndTypes.js +1 -1
  61. package/dist/utils/customColors.js +1 -1
  62. package/dist/utils/ensureDatabaseExists.js +1 -1
  63. package/dist/utils/errors.js +1 -1
  64. package/dist/utils/flagErrors.js +1 -1
  65. package/dist/utils/getDatabaseVersionSafe.js +5 -5
  66. package/dist/utils/getSchemaPathAndPrint.js +1 -1
  67. package/dist/utils/handleEvaluateDataloss.js +1 -1
  68. package/dist/utils/introspectSql.js +5 -5
  69. package/dist/utils/isSchemaEmpty.js +1 -1
  70. package/dist/utils/now.js +1 -1
  71. package/dist/utils/printDatasource.js +1 -1
  72. package/dist/utils/printDatasources.js +5 -5
  73. package/dist/utils/printFiles.js +5 -5
  74. package/dist/utils/printIntrospectedSchema.js +1 -1
  75. package/dist/utils/printMigrationId.js +1 -1
  76. package/dist/utils/promptForMigrationName.js +3 -3
  77. package/dist/utils/removeSchemaFiles.js +1 -1
  78. package/dist/utils/replaceOrAddDatasource.js +1 -1
  79. package/dist/utils/replaceOrAddDatasource.test.js +1 -1
  80. package/dist/utils/saveSchemaFiles.js +1 -1
  81. package/dist/utils/seed.js +4 -4
  82. package/dist/utils/setupCockroach.js +3 -3
  83. package/dist/utils/setupMSSQL.js +759 -675
  84. package/dist/utils/setupMongo.js +552 -552
  85. package/dist/utils/setupMysql.js +508 -563
  86. package/dist/utils/setupPostgres.js +3 -3
  87. package/dist/utils/spinner.js +4 -4
  88. package/dist/utils/unixSocket.js +1 -1
  89. package/dist/views/handleViewsIO.js +3 -3
  90. package/package.json +7 -7
  91. package/dist/chunk-YYPMC5FN.js +0 -1407
@@ -16,16 +16,16 @@ 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_F62CN63F_exports = {};
20
- __export(chunk_F62CN63F_exports, {
19
+ var chunk_B4SUSDC2_exports = {};
20
+ __export(chunk_B4SUSDC2_exports, {
21
21
  DbSeed: () => DbSeed
22
22
  });
23
- module.exports = __toCommonJS(chunk_F62CN63F_exports);
24
- var import_chunk_3WTXX6CQ = require("./chunk-3WTXX6CQ.js");
23
+ module.exports = __toCommonJS(chunk_B4SUSDC2_exports);
24
+ var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
25
25
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
26
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
26
+ var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
27
27
  var import_internals = require("@prisma/internals");
28
- var require_arg = (0, import_chunk_WWAWV7DQ.__commonJS)({
28
+ var require_arg = (0, import_chunk_2ESYSVXG.__commonJS)({
29
29
  "../../node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.js"(exports, module2) {
30
30
  "use strict";
31
31
  var flagSymbol = Symbol("arg flag");
@@ -168,11 +168,28 @@ var require_arg = (0, import_chunk_WWAWV7DQ.__commonJS)({
168
168
  module2.exports = arg2;
169
169
  }
170
170
  });
171
- var import_arg = (0, import_chunk_WWAWV7DQ.__toESM)(require_arg());
172
- var _DbSeed = class _DbSeed2 {
171
+ var import_arg = (0, import_chunk_2ESYSVXG.__toESM)(require_arg());
172
+ var DbSeed = class _DbSeed {
173
173
  static new() {
174
- return new _DbSeed2();
174
+ return new _DbSeed();
175
175
  }
176
+ static help = (0, import_internals.format)(`
177
+ ${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
178
+
179
+ ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
180
+
181
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed [options]
182
+
183
+ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
184
+
185
+ -h, --help Display this help message
186
+ --config Custom path to your Prisma config file
187
+
188
+ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
189
+
190
+ Passing extra arguments to the seed command
191
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
192
+ `);
176
193
  async parse(argv, config) {
177
194
  const args = (0, import_internals.arg)(
178
195
  argv,
@@ -197,10 +214,10 @@ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 va
197
214
  return this.help();
198
215
  }
199
216
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
200
- const seedCommandFromPkgJson = await (0, import_chunk_3WTXX6CQ.getSeedCommandFromPackageJson)(process.cwd());
217
+ const seedCommandFromPkgJson = await (0, import_chunk_5LKIRKDL.getSeedCommandFromPackageJson)(process.cwd());
201
218
  if (!seedCommandFromPkgJson) return ``;
202
219
  const extraArgs = args._.join(" ");
203
- const successfulSeeding = await (0, import_chunk_3WTXX6CQ.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson, extraArgs });
220
+ const successfulSeeding = await (0, import_chunk_5LKIRKDL.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson, extraArgs });
204
221
  if (successfulSeeding) {
205
222
  return `
206
223
  ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.`;
@@ -212,26 +229,8 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
212
229
  if (error) {
213
230
  return new import_internals.HelpError(`
214
231
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
215
- ${_DbSeed2.help}`);
232
+ ${_DbSeed.help}`);
216
233
  }
217
- return _DbSeed2.help;
234
+ return _DbSeed.help;
218
235
  }
219
236
  };
220
- (0, import_chunk_WWAWV7DQ.__publicField)(_DbSeed, "help", (0, import_internals.format)(`
221
- ${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
222
-
223
- ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
224
-
225
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed [options]
226
-
227
- ${(0, import_chunk_SKRR5WT4.bold)("Options")}
228
-
229
- -h, --help Display this help message
230
- --config Custom path to your Prisma config file
231
-
232
- ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
233
-
234
- Passing extra arguments to the seed command
235
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
236
- `));
237
- var DbSeed = _DbSeed;
@@ -26,31 +26,59 @@ 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_ODH7XYW7_exports = {};
30
- __export(chunk_ODH7XYW7_exports, {
29
+ var chunk_BURHAP6O_exports = {};
30
+ __export(chunk_BURHAP6O_exports, {
31
31
  MigrateDev: () => MigrateDev
32
32
  });
33
- module.exports = __toCommonJS(chunk_ODH7XYW7_exports);
34
- var import_chunk_OCQGHQED = require("./chunk-OCQGHQED.js");
33
+ module.exports = __toCommonJS(chunk_BURHAP6O_exports);
34
+ var import_chunk_YBX7R3MT = require("./chunk-YBX7R3MT.js");
35
35
  var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
36
- var import_chunk_3WTXX6CQ = require("./chunk-3WTXX6CQ.js");
37
- var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
36
+ var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
37
+ var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
38
38
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
39
- var import_chunk_N5UBDQRA = require("./chunk-N5UBDQRA.js");
39
+ var import_chunk_VVP3QZ7Q = require("./chunk-VVP3QZ7Q.js");
40
40
  var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
41
41
  var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
42
42
  var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
43
43
  var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
44
44
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
45
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
46
45
  var import_debug = __toESM(require("@prisma/debug"));
47
46
  var import_internals = require("@prisma/internals");
48
47
  var import_prompts = __toESM(require("prompts"));
49
48
  var debug = (0, import_debug.default)("prisma:migrate:dev");
50
- var _MigrateDev = class _MigrateDev2 {
49
+ var MigrateDev = class _MigrateDev {
51
50
  static new() {
52
- return new _MigrateDev2();
51
+ return new _MigrateDev();
53
52
  }
53
+ static help = (0, import_internals.format)(`
54
+ ${process.platform === "win32" ? "" : "\u{1F3CB}\uFE0F "}Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
55
+
56
+ ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
57
+
58
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev [options]
59
+
60
+ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
61
+
62
+ -h, --help Display this help message
63
+ --config Custom path to your Prisma config file
64
+ --schema Custom path to your Prisma schema
65
+ -n, --name Name the migration
66
+ --create-only Create a new migration but do not apply it
67
+ The migration will be empty if there are no changes in Prisma schema
68
+ --skip-generate Skip triggering generators (e.g. Prisma Client)
69
+ --skip-seed Skip triggering seed
70
+
71
+ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
72
+
73
+ Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
74
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev
75
+
76
+ Specify a schema
77
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev --schema=./schema.prisma
78
+
79
+ Create a migration without applying it
80
+ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev --create-only
81
+ `);
54
82
  async parse(argv, config) {
55
83
  const args = (0, import_internals.arg)(argv, {
56
84
  "--help": Boolean,
@@ -89,7 +117,7 @@ var _MigrateDev = class _MigrateDev2 {
89
117
  if (wasDbCreated) {
90
118
  process.stdout.write(wasDbCreated + "\n\n");
91
119
  }
92
- const migrate = new import_chunk_N5UBDQRA.Migrate(schemaPath);
120
+ const migrate = new import_chunk_VVP3QZ7Q.Migrate(schemaPath);
93
121
  let devDiagnostic;
94
122
  try {
95
123
  devDiagnostic = await migrate.devDiagnostic();
@@ -121,7 +149,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will
121
149
  `
122
150
  The following migration(s) have been applied:
123
151
 
124
- ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
152
+ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)(
125
153
  "migrations",
126
154
  appliedMigrationNames,
127
155
  {
@@ -181,7 +209,7 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
181
209
  }
182
210
  let migrationName = void 0;
183
211
  if (evaluateDataLossResult.migrationSteps > 0 || args["--create-only"]) {
184
- const getMigrationNameResult = await (0, import_chunk_OCQGHQED.getMigrationName)(args["--name"]);
212
+ const getMigrationNameResult = await (0, import_chunk_YBX7R3MT.getMigrationName)(args["--name"]);
185
213
  if (getMigrationNameResult.userCancelled) {
186
214
  process.stdout.write(getMigrationNameResult.userCancelled + "\n");
187
215
  migrate.stop();
@@ -226,7 +254,7 @@ You can now edit it and apply it by running ${(0, import_chunk_SKRR5WT4.green)((
226
254
  `
227
255
  The following migration(s) have been created and applied from new schema changes:
228
256
 
229
- ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
257
+ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)(
230
258
  "migrations",
231
259
  migrationIds,
232
260
  {
@@ -244,10 +272,10 @@ ${(0, import_chunk_SKRR5WT4.green)("Your database is now in sync with your schem
244
272
  }
245
273
  if (wasDbCreated && !process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
246
274
  try {
247
- const seedCommandFromPkgJson = await (0, import_chunk_3WTXX6CQ.getSeedCommandFromPackageJson)(process.cwd());
275
+ const seedCommandFromPkgJson = await (0, import_chunk_5LKIRKDL.getSeedCommandFromPackageJson)(process.cwd());
248
276
  if (seedCommandFromPkgJson) {
249
277
  process.stdout.write("\n");
250
- const successfulSeeding = await (0, import_chunk_3WTXX6CQ.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson });
278
+ const successfulSeeding = await (0, import_chunk_5LKIRKDL.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson });
251
279
  if (successfulSeeding) {
252
280
  process.stdout.write(`
253
281
  ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
@@ -286,38 +314,8 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
286
314
  if (error) {
287
315
  return new import_internals.HelpError(`
288
316
  ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
289
- ${_MigrateDev2.help}`);
317
+ ${_MigrateDev.help}`);
290
318
  }
291
- return _MigrateDev2.help;
319
+ return _MigrateDev.help;
292
320
  }
293
321
  };
294
- (0, import_chunk_WWAWV7DQ.__publicField)(_MigrateDev, "help", (0, import_internals.format)(`
295
- ${process.platform === "win32" ? "" : "\u{1F3CB}\uFE0F "}Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
296
-
297
- ${(0, import_chunk_SKRR5WT4.bold)("Usage")}
298
-
299
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev [options]
300
-
301
- ${(0, import_chunk_SKRR5WT4.bold)("Options")}
302
-
303
- -h, --help Display this help message
304
- --config Custom path to your Prisma config file
305
- --schema Custom path to your Prisma schema
306
- -n, --name Name the migration
307
- --create-only Create a new migration but do not apply it
308
- The migration will be empty if there are no changes in Prisma schema
309
- --skip-generate Skip triggering generators (e.g. Prisma Client)
310
- --skip-seed Skip triggering seed
311
-
312
- ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
313
-
314
- Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
315
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev
316
-
317
- Specify a schema
318
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev --schema=./schema.prisma
319
-
320
- Create a migration without applying it
321
- ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev --create-only
322
- `));
323
- var MigrateDev = _MigrateDev;