@prisma/migrate 6.5.0-dev.5 → 6.5.0-dev.50

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 (31) hide show
  1. package/dist/bin.js +19 -19
  2. package/dist/{chunk-J77IRNPE.js → chunk-5VDXAE53.js} +45 -31
  3. package/dist/{chunk-D74DU52C.js → chunk-DFSEPNOM.js} +441 -1322
  4. package/dist/{chunk-73OPZA7N.js → chunk-EGPJABTW.js} +136 -81
  5. package/dist/{chunk-J5FHVALZ.js → chunk-ERPAJVG7.js} +5 -5
  6. package/dist/{chunk-6DFJIBJX.js → chunk-GKDFIHM2.js} +3 -3
  7. package/dist/{chunk-RQFGRXJI.js → chunk-H6XF7657.js} +5 -5
  8. package/dist/{chunk-LVLRGTYH.js → chunk-MQJGOKF4.js} +5 -5
  9. package/dist/{chunk-PSYS5XVH.js → chunk-NVUTECND.js} +18 -28
  10. package/dist/{chunk-TM3ETZES.js → chunk-OHKW356Q.js} +5 -5
  11. package/dist/{chunk-LWN7RVNT.js → chunk-ONOWNX2Z.js} +442 -1323
  12. package/dist/{chunk-4EV2RVXY.js → chunk-TPQ5YBLK.js} +27 -34
  13. package/dist/{chunk-YZVZCC3I.js → chunk-UZQIWTO5.js} +5 -5
  14. package/dist/{chunk-I4EY55DC.js → chunk-YPCOLI3I.js} +5 -5
  15. package/dist/commands/DbDrop.js +3 -3
  16. package/dist/commands/DbExecute.js +2 -2
  17. package/dist/commands/DbPush.js +3 -3
  18. package/dist/commands/MigrateDeploy.js +3 -3
  19. package/dist/commands/MigrateDev.js +3 -3
  20. package/dist/commands/MigrateDiff.js +2 -2
  21. package/dist/commands/MigrateReset.js +3 -3
  22. package/dist/commands/MigrateResolve.js +3 -3
  23. package/dist/commands/MigrateStatus.js +3 -3
  24. package/dist/index.js +21 -21
  25. package/dist/internals/src/errorReporting.d.ts +1 -0
  26. package/dist/utils/getSchemaPathAndPrint.js +3 -3
  27. package/dist/utils/setupCockroach.js +2 -2
  28. package/dist/utils/setupMSSQL.js +13 -13
  29. package/dist/utils/setupMongo.js +3 -3
  30. package/dist/utils/setupPostgres.js +2 -2
  31. package/package.json +13 -13
@@ -26,11 +26,11 @@ 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_PSYS5XVH_exports = {};
30
- __export(chunk_PSYS5XVH_exports, {
29
+ var chunk_NVUTECND_exports = {};
30
+ __export(chunk_NVUTECND_exports, {
31
31
  MigrateDev: () => MigrateDev
32
32
  });
33
- module.exports = __toCommonJS(chunk_PSYS5XVH_exports);
33
+ module.exports = __toCommonJS(chunk_NVUTECND_exports);
34
34
  var import_chunk_OCQGHQED = require("./chunk-OCQGHQED.js");
35
35
  var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
36
36
  var import_chunk_V3ZMNXZC = require("./chunk-V3ZMNXZC.js");
@@ -38,7 +38,7 @@ var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
38
38
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
39
39
  var import_chunk_DDHPSYC4 = require("./chunk-DDHPSYC4.js");
40
40
  var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
41
- var import_chunk_6DFJIBJX = require("./chunk-6DFJIBJX.js");
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");
@@ -63,8 +63,7 @@ var _MigrateDev = class _MigrateDev2 {
63
63
  "--config": String,
64
64
  "--skip-generate": Boolean,
65
65
  "--skip-seed": Boolean,
66
- "--telemetry-information": String,
67
- "--allow-reset": Boolean
66
+ "--telemetry-information": String
68
67
  });
69
68
  if ((0, import_internals.isError)(args)) {
70
69
  return this.help(args.message);
@@ -74,7 +73,7 @@ var _MigrateDev = class _MigrateDev2 {
74
73
  return this.help();
75
74
  }
76
75
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
77
- const { schemaPath, schemas } = await (0, import_chunk_6DFJIBJX.getSchemaPathAndPrint)(args["--schema"], config.schema);
76
+ const { schemaPath, schemas } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
78
77
  const datasourceInfo = await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath });
79
78
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
80
79
  process.stdout.write("\n");
@@ -104,22 +103,14 @@ var _MigrateDev = class _MigrateDev2 {
104
103
  datasourceInfo,
105
104
  reason: devDiagnostic.action.reason
106
105
  });
107
- if (!args["--allow-reset"]) {
108
- process.stdout.write(
109
- `
110
- You may use --allow-reset to drop the database. ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will be lost."))}
106
+ process.stdout.write(
107
+ `
108
+ You may use ${(0, import_chunk_SKRR5WT4.red)("prisma migrate reset")} to drop the development database.
109
+ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will be lost."))}
111
110
  `
112
- );
113
- migrate.stop();
114
- process.exit(130);
115
- }
116
- process.stdout.write("\nReceived --allow-reset, dropping the database. All data is lost.\n\n");
117
- try {
118
- await migrate.reset();
119
- } catch (e) {
120
- migrate.stop();
121
- throw e;
122
- }
111
+ );
112
+ migrate.stop();
113
+ process.exit(130);
123
114
  }
124
115
  try {
125
116
  const { appliedMigrationNames } = await migrate.applyMigrations();
@@ -160,10 +151,6 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
160
151
  throw new Error(unexecutableStepsError);
161
152
  }
162
153
  if (evaluateDataLossResult.warnings && evaluateDataLossResult.warnings.length > 0) {
163
- if (!(0, import_internals.canPrompt)()) {
164
- migrate.stop();
165
- throw new import_chunk_3WC4XD74.MigrateDevEnvNonInteractiveError();
166
- }
167
154
  process.stdout.write((0, import_chunk_SKRR5WT4.bold)(`
168
155
  \u26A0\uFE0F Warnings for the current datasource:
169
156
 
@@ -174,6 +161,10 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
174
161
  }
175
162
  process.stdout.write("\n");
176
163
  if (!args["--force"]) {
164
+ if (!(0, import_internals.canPrompt)()) {
165
+ migrate.stop();
166
+ throw new import_chunk_3WC4XD74.MigrateDevEnvNonInteractiveError();
167
+ }
177
168
  const message = args["--create-only"] ? "Are you sure you want to create this migration?" : "Are you sure you want to create and apply this migration?";
178
169
  const confirmation = await (0, import_prompts.default)({
179
170
  type: "confirm",
@@ -250,7 +241,7 @@ ${(0, import_chunk_SKRR5WT4.green)("Your database is now in sync with your schem
250
241
  await migrate.tryToRunGenerate(datasourceInfo);
251
242
  process.stdout.write("\n");
252
243
  }
253
- if ((wasDbCreated || devDiagnostic.action.tag === "reset") && !process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
244
+ if (wasDbCreated && !process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
254
245
  try {
255
246
  const seedCommandFromPkgJson = await (0, import_chunk_V3ZMNXZC.getSeedCommandFromPackageJson)(process.cwd());
256
247
  if (seedCommandFromPkgJson) {
@@ -319,7 +310,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
319
310
  The migration will be empty if there are no changes in Prisma schema
320
311
  --skip-generate Skip triggering generators (e.g. Prisma Client)
321
312
  --skip-seed Skip triggering seed
322
- --allow-reset Allow resetting the database on incompatible schema change (accept data loss)
323
313
 
324
314
  ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
325
315
 
@@ -16,13 +16,13 @@ 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_TM3ETZES_exports = {};
20
- __export(chunk_TM3ETZES_exports, {
19
+ var chunk_OHKW356Q_exports = {};
20
+ __export(chunk_OHKW356Q_exports, {
21
21
  MigrateResolve: () => MigrateResolve
22
22
  });
23
- module.exports = __toCommonJS(chunk_TM3ETZES_exports);
23
+ module.exports = __toCommonJS(chunk_OHKW356Q_exports);
24
24
  var import_chunk_DDHPSYC4 = require("./chunk-DDHPSYC4.js");
25
- var import_chunk_6DFJIBJX = require("./chunk-6DFJIBJX.js");
25
+ var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
26
26
  var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
27
27
  var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
28
28
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
@@ -53,7 +53,7 @@ var _MigrateResolve = class _MigrateResolve2 {
53
53
  return this.help();
54
54
  }
55
55
  await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
56
- const { schemaPath } = await (0, import_chunk_6DFJIBJX.getSchemaPathAndPrint)(args["--schema"], config.schema);
56
+ const { schemaPath } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
57
57
  (0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath }) });
58
58
  if (!args["--applied"] && !args["--rolled-back"]) {
59
59
  throw new Error(