@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.
- package/dist/CLI.js +3 -3
- package/dist/Migrate.js +6 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +43 -43
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/{chunk-J4DAOTRR.js → chunk-324Z6HS7.js} +41 -43
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-3WTXX6CQ.js → chunk-5LKIRKDL.js} +60 -60
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-F62CN63F.js → chunk-B4SUSDC2.js} +30 -31
- package/dist/{chunk-ODH7XYW7.js → chunk-BURHAP6O.js} +46 -48
- package/dist/{chunk-7X4MPZIO.js → chunk-DQMYH4YE.js} +323 -337
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-MREGRQDD.js → chunk-FBWTUBJC.js} +46 -45
- package/dist/{chunk-MATFO4ZW.js → chunk-G7PJKEOV.js} +33 -33
- package/dist/{chunk-PW3LNSDM.js → chunk-GPNGRJAR.js} +33 -35
- package/dist/{chunk-NAXFX7K7.js → chunk-HJFSTAJX.js} +30 -32
- package/dist/{chunk-4ZFVT4RS.js → chunk-IINN7QUV.js} +165 -190
- package/dist/{chunk-IR55GBON.js → chunk-IWC5MH4R.js} +5 -5
- package/dist/{chunk-ZOEKRXDP.js → chunk-K43RXWQY.js} +21 -18
- package/dist/{chunk-LQO5JIBW.js → chunk-KBAYLL3V.js} +324 -338
- package/dist/{chunk-3OQIC7NW.js → chunk-KMHFSDY6.js} +43 -45
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-MKK3GSDF.js → chunk-MKS2ZJJ5.js} +5 -5
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-IY67YUOD.js → chunk-NJYZPNB4.js} +54 -56
- package/dist/{chunk-EGPJABTW.js → chunk-TGV6QGEF.js} +69 -69
- package/dist/{chunk-3VFKYWQZ.js → chunk-URKH6SE2.js} +73 -80
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-N5UBDQRA.js → chunk-VVP3QZ7Q.js} +21 -21
- package/dist/{chunk-DAYMMAJB.js → chunk-YBNDKPPO.js} +36 -38
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-A6PMXMMT.js → chunk-ZB5NPOJW.js} +13 -13
- package/dist/{chunk-V5TUSOJX.js → chunk-ZGR2WQ62.js} +38 -40
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +7 -7
- package/dist/commands/DbPull.js +9 -9
- package/dist/commands/DbPush.js +7 -7
- package/dist/commands/DbSeed.js +4 -4
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +9 -9
- package/dist/commands/MigrateDev.js +11 -11
- package/dist/commands/MigrateDiff.js +10 -10
- package/dist/commands/MigrateReset.js +10 -10
- package/dist/commands/MigrateResolve.js +7 -7
- package/dist/commands/MigrateStatus.js +7 -7
- package/dist/index.js +46 -46
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/getSchemaPathAndPrint.js +1 -1
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -4
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +759 -675
- package/dist/utils/setupMongo.js +552 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -4
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +7 -7
- 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
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_B4SUSDC2_exports = {};
|
|
20
|
+
__export(chunk_B4SUSDC2_exports, {
|
|
21
21
|
DbSeed: () => DbSeed
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
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
|
|
26
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
28
|
-
var require_arg = (0,
|
|
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,
|
|
172
|
-
var
|
|
171
|
+
var import_arg = (0, import_chunk_2ESYSVXG.__toESM)(require_arg());
|
|
172
|
+
var DbSeed = class _DbSeed {
|
|
173
173
|
static new() {
|
|
174
|
-
return new
|
|
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,
|
|
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,
|
|
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
|
-
${
|
|
232
|
+
${_DbSeed.help}`);
|
|
216
233
|
}
|
|
217
|
-
return
|
|
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
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_BURHAP6O_exports = {};
|
|
30
|
+
__export(chunk_BURHAP6O_exports, {
|
|
31
31
|
MigrateDev: () => MigrateDev
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
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
|
|
37
|
-
var
|
|
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
|
|
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
|
|
49
|
+
var MigrateDev = class _MigrateDev {
|
|
51
50
|
static new() {
|
|
52
|
-
return new
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
${
|
|
317
|
+
${_MigrateDev.help}`);
|
|
290
318
|
}
|
|
291
|
-
return
|
|
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;
|