@prisma/migrate 6.5.0-dev.6 → 6.5.0-dev.61
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 +2 -2
- package/dist/Migrate.js +3 -3
- package/dist/SchemaEngine.js +3 -3
- package/dist/bin.js +35 -35
- package/dist/{chunk-J77IRNPE.js → chunk-5VDXAE53.js} +45 -31
- package/dist/{chunk-PSYS5XVH.js → chunk-A4BCLP6K.js} +23 -32
- package/dist/{chunk-CTPONE6G.js → chunk-DLLXDCI2.js} +6 -3
- package/dist/{chunk-4EV2RVXY.js → chunk-E7OXHCDR.js} +31 -37
- package/dist/{chunk-73OPZA7N.js → chunk-EGPJABTW.js} +136 -81
- package/dist/{chunk-TM3ETZES.js → chunk-EX2UWGES.js} +11 -10
- package/dist/{chunk-FRTPDRF2.js → chunk-G2XUUMKH.js} +5 -5
- package/dist/{chunk-6DFJIBJX.js → chunk-GKDFIHM2.js} +3 -3
- package/dist/{chunk-2NMFKGXM.js → chunk-IR55GBON.js} +5 -5
- package/dist/{chunk-CHBE43L6.js → chunk-KEDRN7ZM.js} +464 -1335
- package/dist/{chunk-DDHPSYC4.js → chunk-KXMACMQC.js} +9 -6
- package/dist/{chunk-I4EY55DC.js → chunk-LZOZZRHB.js} +10 -9
- package/dist/{chunk-4JQIX6O7.js → chunk-MKK3GSDF.js} +5 -5
- package/dist/{chunk-D74DU52C.js → chunk-QBA7W2BT.js} +463 -1334
- package/dist/{chunk-LVLRGTYH.js → chunk-TPJISPJ5.js} +10 -9
- package/dist/{chunk-YZVZCC3I.js → chunk-V5TUSOJX.js} +8 -7
- package/dist/{chunk-WNH2ACJS.js → chunk-VVKOFN3Y.js} +6 -5
- package/dist/{chunk-QTAIWPLH.js → chunk-VZ23KD5C.js} +5 -4
- package/dist/{chunk-HIFVDK2U.js → chunk-W2SZNLK4.js} +6 -5
- package/dist/{chunk-WLPX3672.js → chunk-X5N72JHI.js} +8 -7
- package/dist/{chunk-RQFGRXJI.js → chunk-X6KW7BYP.js} +10 -9
- package/dist/{chunk-XRTNIFND.js → chunk-YYPMC5FN.js} +203 -108
- package/dist/{chunk-ORL3LJOT.js → chunk-ZOEKRXDP.js} +16 -7
- package/dist/{chunk-J5FHVALZ.js → chunk-ZQ3OWSVS.js} +10 -9
- package/dist/commands/DbCommand.js +2 -2
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +4 -4
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/DbPush.js +5 -5
- package/dist/commands/DbSeed.js +2 -2
- package/dist/commands/MigrateCommand.js +2 -2
- package/dist/commands/MigrateDeploy.js +5 -5
- package/dist/commands/MigrateDev.js +5 -5
- package/dist/commands/MigrateDiff.js +6 -6
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/MigrateResolve.js +5 -5
- package/dist/commands/MigrateStatus.js +5 -5
- package/dist/index.js +39 -39
- package/dist/internals/src/errorReporting.d.ts +1 -0
- package/dist/utils/captureStdout.js +2 -2
- package/dist/utils/getDatabaseVersionSafe.js +3 -3
- package/dist/utils/getSchemaPathAndPrint.js +3 -3
- package/dist/utils/introspectSql.js +3 -3
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +13 -13
- package/dist/utils/setupMongo.js +3 -3
- package/dist/utils/setupMysql.js +231 -99
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +14 -14
package/dist/CLI.js
CHANGED
|
@@ -18,9 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var CLI_exports = {};
|
|
20
20
|
__export(CLI_exports, {
|
|
21
|
-
CLI: () =>
|
|
21
|
+
CLI: () => import_chunk_VZ23KD5C.CLI
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(CLI_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_VZ23KD5C = require("./chunk-VZ23KD5C.js");
|
|
25
25
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
package/dist/Migrate.js
CHANGED
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var Migrate_exports = {};
|
|
20
20
|
__export(Migrate_exports, {
|
|
21
|
-
Migrate: () =>
|
|
21
|
+
Migrate: () => import_chunk_KXMACMQC.Migrate
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Migrate_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
25
25
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
26
26
|
var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
|
|
27
|
-
var
|
|
27
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
28
28
|
var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
|
|
29
29
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
30
30
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
package/dist/SchemaEngine.js
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var SchemaEngine_exports = {};
|
|
20
20
|
__export(SchemaEngine_exports, {
|
|
21
|
-
EngineError: () =>
|
|
22
|
-
SchemaEngine: () =>
|
|
21
|
+
EngineError: () => import_chunk_ZOEKRXDP.EngineError,
|
|
22
|
+
SchemaEngine: () => import_chunk_ZOEKRXDP.SchemaEngine
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(SchemaEngine_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
26
26
|
var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
|
|
27
27
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
28
28
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
package/dist/bin.js
CHANGED
|
@@ -22,13 +22,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
23
|
mod
|
|
24
24
|
));
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
25
|
+
var import_chunk_VZ23KD5C = require("./chunk-VZ23KD5C.js");
|
|
26
|
+
var import_chunk_MKK3GSDF = require("./chunk-MKK3GSDF.js");
|
|
27
|
+
var import_chunk_X6KW7BYP = require("./chunk-X6KW7BYP.js");
|
|
28
|
+
var import_chunk_EX2UWGES = require("./chunk-EX2UWGES.js");
|
|
29
|
+
var import_chunk_LZOZZRHB = require("./chunk-LZOZZRHB.js");
|
|
30
|
+
var import_chunk_E7OXHCDR = require("./chunk-E7OXHCDR.js");
|
|
31
|
+
var import_chunk_X5N72JHI = require("./chunk-X5N72JHI.js");
|
|
32
32
|
var import_chunk_DIAO4W7O = require("./chunk-DIAO4W7O.js");
|
|
33
33
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
34
34
|
var import_chunk_YUCPBDWV = require("./chunk-YUCPBDWV.js");
|
|
@@ -39,30 +39,30 @@ var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
|
39
39
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
40
40
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
41
41
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
42
|
+
var import_chunk_ZQ3OWSVS = require("./chunk-ZQ3OWSVS.js");
|
|
43
|
+
var import_chunk_G2XUUMKH = require("./chunk-G2XUUMKH.js");
|
|
44
|
+
var import_chunk_VVKOFN3Y = require("./chunk-VVKOFN3Y.js");
|
|
45
|
+
var import_chunk_TPJISPJ5 = require("./chunk-TPJISPJ5.js");
|
|
46
|
+
var import_chunk_A4BCLP6K = require("./chunk-A4BCLP6K.js");
|
|
47
47
|
var import_chunk_OCQGHQED = require("./chunk-OCQGHQED.js");
|
|
48
48
|
var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
|
|
49
49
|
var import_chunk_V3ZMNXZC = require("./chunk-V3ZMNXZC.js");
|
|
50
50
|
var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
|
|
51
51
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
52
52
|
var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
|
|
53
|
-
var
|
|
53
|
+
var import_chunk_KEDRN7ZM = require("./chunk-KEDRN7ZM.js");
|
|
54
54
|
var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
55
|
+
var import_chunk_YYPMC5FN = require("./chunk-YYPMC5FN.js");
|
|
56
|
+
var import_chunk_DLLXDCI2 = require("./chunk-DLLXDCI2.js");
|
|
57
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
58
58
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
59
59
|
var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
|
|
60
|
-
var
|
|
60
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
61
61
|
var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
|
|
62
62
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
63
|
-
var
|
|
63
|
+
var import_chunk_W2SZNLK4 = require("./chunk-W2SZNLK4.js");
|
|
64
64
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
65
|
-
var
|
|
65
|
+
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
66
66
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
67
67
|
var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
|
|
68
68
|
var import_chunk_TWPTG4XS = require("./chunk-TWPTG4XS.js");
|
|
@@ -72,7 +72,7 @@ var import_config = require("@prisma/config");
|
|
|
72
72
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
73
73
|
var import_engines_version = require("@prisma/engines-version");
|
|
74
74
|
var import_internals = require("@prisma/internals");
|
|
75
|
-
var version = "6.5.0-dev.
|
|
75
|
+
var version = "6.5.0-dev.61";
|
|
76
76
|
process.on("uncaughtException", (e) => {
|
|
77
77
|
console.log(e);
|
|
78
78
|
});
|
|
@@ -92,21 +92,21 @@ var args = (0, import_internals.arg)(
|
|
|
92
92
|
true
|
|
93
93
|
);
|
|
94
94
|
async function main() {
|
|
95
|
-
const cli =
|
|
96
|
-
migrate:
|
|
97
|
-
dev:
|
|
98
|
-
status:
|
|
99
|
-
resolve:
|
|
100
|
-
reset:
|
|
101
|
-
deploy:
|
|
102
|
-
diff:
|
|
95
|
+
const cli = import_chunk_VZ23KD5C.CLI.new({
|
|
96
|
+
migrate: import_chunk_VVKOFN3Y.MigrateCommand.new({
|
|
97
|
+
dev: import_chunk_A4BCLP6K.MigrateDev.new(),
|
|
98
|
+
status: import_chunk_LZOZZRHB.MigrateStatus.new(),
|
|
99
|
+
resolve: import_chunk_EX2UWGES.MigrateResolve.new(),
|
|
100
|
+
reset: import_chunk_X6KW7BYP.MigrateReset.new(),
|
|
101
|
+
deploy: import_chunk_TPJISPJ5.MigrateDeploy.new(),
|
|
102
|
+
diff: import_chunk_KEDRN7ZM.MigrateDiff.new()
|
|
103
103
|
}),
|
|
104
|
-
db:
|
|
105
|
-
execute:
|
|
106
|
-
pull:
|
|
107
|
-
push:
|
|
104
|
+
db: import_chunk_W2SZNLK4.DbCommand.new({
|
|
105
|
+
execute: import_chunk_E7OXHCDR.DbExecute.new(),
|
|
106
|
+
pull: import_chunk_X5N72JHI.DbPull.new(),
|
|
107
|
+
push: import_chunk_ZQ3OWSVS.DbPush.new(),
|
|
108
108
|
// drop: DbDrop.new(),
|
|
109
|
-
seed:
|
|
109
|
+
seed: import_chunk_G2XUUMKH.DbSeed.new()
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
const { config, error } = await (0, import_config.loadConfigFromFile)({ configFile: args["--config"] });
|
|
@@ -114,7 +114,7 @@ async function main() {
|
|
|
114
114
|
console.error(`Failed to load config file: ${error._tag}`);
|
|
115
115
|
return 1;
|
|
116
116
|
}
|
|
117
|
-
const result = await cli.parse(commandArray,
|
|
117
|
+
const result = await cli.parse(commandArray, config);
|
|
118
118
|
if (result instanceof import_internals.HelpError) {
|
|
119
119
|
console.error(result);
|
|
120
120
|
return 1;
|
|
@@ -136,7 +136,7 @@ main().then((code) => {
|
|
|
136
136
|
cliVersion: version,
|
|
137
137
|
enginesVersion: import_engines_version.enginesVersion,
|
|
138
138
|
command: commandArray.join(" "),
|
|
139
|
-
getDatabaseVersionSafe:
|
|
139
|
+
getDatabaseVersionSafe: import_chunk_MKK3GSDF.getDatabaseVersionSafe
|
|
140
140
|
}).catch((e) => {
|
|
141
141
|
if (import_debug.default.enabled("migrate")) {
|
|
142
142
|
console.error((0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)("Error: ")) + e.stack);
|
|
@@ -16,12 +16,12 @@ 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_5VDXAE53_exports = {};
|
|
20
|
+
__export(chunk_5VDXAE53_exports, {
|
|
21
21
|
require_ms: () => require_ms,
|
|
22
22
|
require_src: () => require_src
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(chunk_5VDXAE53_exports);
|
|
25
25
|
var import_chunk_RM5LJIEV = require("./chunk-RM5LJIEV.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
27
27
|
var require_ms = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
@@ -140,7 +140,7 @@ var require_ms = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
var require_common = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
143
|
-
"../../node_modules/.pnpm/debug@4.
|
|
143
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports, module2) {
|
|
144
144
|
"use strict";
|
|
145
145
|
function setup(env) {
|
|
146
146
|
createDebug.debug = createDebug;
|
|
@@ -242,50 +242,64 @@ var require_common = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
242
242
|
createDebug.namespaces = namespaces;
|
|
243
243
|
createDebug.names = [];
|
|
244
244
|
createDebug.skips = [];
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
246
|
+
for (const ns of split) {
|
|
247
|
+
if (ns[0] === "-") {
|
|
248
|
+
createDebug.skips.push(ns.slice(1));
|
|
249
|
+
} else {
|
|
250
|
+
createDebug.names.push(ns);
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function matchesTemplate(search, template) {
|
|
255
|
+
let searchIndex = 0;
|
|
256
|
+
let templateIndex = 0;
|
|
257
|
+
let starIndex = -1;
|
|
258
|
+
let matchIndex = 0;
|
|
259
|
+
while (searchIndex < search.length) {
|
|
260
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
261
|
+
if (template[templateIndex] === "*") {
|
|
262
|
+
starIndex = templateIndex;
|
|
263
|
+
matchIndex = searchIndex;
|
|
264
|
+
templateIndex++;
|
|
265
|
+
} else {
|
|
266
|
+
searchIndex++;
|
|
267
|
+
templateIndex++;
|
|
268
|
+
}
|
|
269
|
+
} else if (starIndex !== -1) {
|
|
270
|
+
templateIndex = starIndex + 1;
|
|
271
|
+
matchIndex++;
|
|
272
|
+
searchIndex = matchIndex;
|
|
255
273
|
} else {
|
|
256
|
-
|
|
274
|
+
return false;
|
|
257
275
|
}
|
|
258
276
|
}
|
|
277
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
278
|
+
templateIndex++;
|
|
279
|
+
}
|
|
280
|
+
return templateIndex === template.length;
|
|
259
281
|
}
|
|
260
282
|
function disable() {
|
|
261
283
|
const namespaces = [
|
|
262
|
-
...createDebug.names
|
|
263
|
-
...createDebug.skips.map(
|
|
284
|
+
...createDebug.names,
|
|
285
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
264
286
|
].join(",");
|
|
265
287
|
createDebug.enable("");
|
|
266
288
|
return namespaces;
|
|
267
289
|
}
|
|
268
290
|
function enabled(name) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
let i;
|
|
273
|
-
let len;
|
|
274
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
275
|
-
if (createDebug.skips[i].test(name)) {
|
|
291
|
+
for (const skip of createDebug.skips) {
|
|
292
|
+
if (matchesTemplate(name, skip)) {
|
|
276
293
|
return false;
|
|
277
294
|
}
|
|
278
295
|
}
|
|
279
|
-
for (
|
|
280
|
-
if (
|
|
296
|
+
for (const ns of createDebug.names) {
|
|
297
|
+
if (matchesTemplate(name, ns)) {
|
|
281
298
|
return true;
|
|
282
299
|
}
|
|
283
300
|
}
|
|
284
301
|
return false;
|
|
285
302
|
}
|
|
286
|
-
function toNamespace(regexp) {
|
|
287
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
288
|
-
}
|
|
289
303
|
function coerce(val) {
|
|
290
304
|
if (val instanceof Error) {
|
|
291
305
|
return val.stack || val.message;
|
|
@@ -302,7 +316,7 @@ var require_common = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
302
316
|
}
|
|
303
317
|
});
|
|
304
318
|
var require_browser = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
305
|
-
"../../node_modules/.pnpm/debug@4.
|
|
319
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports, module2) {
|
|
306
320
|
"use strict";
|
|
307
321
|
exports.formatArgs = formatArgs;
|
|
308
322
|
exports.save = save;
|
|
@@ -583,7 +597,7 @@ var require_supports_color = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
583
597
|
}
|
|
584
598
|
});
|
|
585
599
|
var require_node = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
586
|
-
"../../node_modules/.pnpm/debug@4.
|
|
600
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports, module2) {
|
|
587
601
|
"use strict";
|
|
588
602
|
var tty = (0, import_chunk_WWAWV7DQ.__require)("tty");
|
|
589
603
|
var util = (0, import_chunk_WWAWV7DQ.__require)("util");
|
|
@@ -756,7 +770,7 @@ var require_node = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
756
770
|
}
|
|
757
771
|
});
|
|
758
772
|
var require_src = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
759
|
-
"../../node_modules/.pnpm/debug@4.
|
|
773
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports, module2) {
|
|
760
774
|
"use strict";
|
|
761
775
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
762
776
|
module2.exports = require_browser();
|
|
@@ -26,22 +26,23 @@ 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_A4BCLP6K_exports = {};
|
|
30
|
+
__export(chunk_A4BCLP6K_exports, {
|
|
31
31
|
MigrateDev: () => MigrateDev
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_A4BCLP6K_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");
|
|
37
37
|
var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
|
|
38
38
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
40
40
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
41
|
-
var
|
|
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");
|
|
45
46
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
46
47
|
var import_internals = require("@prisma/internals");
|
|
47
48
|
var import_prompts = __toESM(require("prompts"));
|
|
@@ -63,8 +64,7 @@ var _MigrateDev = class _MigrateDev2 {
|
|
|
63
64
|
"--config": String,
|
|
64
65
|
"--skip-generate": Boolean,
|
|
65
66
|
"--skip-seed": Boolean,
|
|
66
|
-
"--telemetry-information": String
|
|
67
|
-
"--allow-reset": Boolean
|
|
67
|
+
"--telemetry-information": String
|
|
68
68
|
});
|
|
69
69
|
if ((0, import_internals.isError)(args)) {
|
|
70
70
|
return this.help(args.message);
|
|
@@ -74,7 +74,7 @@ var _MigrateDev = class _MigrateDev2 {
|
|
|
74
74
|
return this.help();
|
|
75
75
|
}
|
|
76
76
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
77
|
-
const { schemaPath, schemas } = await (0,
|
|
77
|
+
const { schemaPath, schemas } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
78
78
|
const datasourceInfo = await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath });
|
|
79
79
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
80
80
|
process.stdout.write("\n");
|
|
@@ -89,7 +89,7 @@ var _MigrateDev = class _MigrateDev2 {
|
|
|
89
89
|
if (wasDbCreated) {
|
|
90
90
|
process.stdout.write(wasDbCreated + "\n\n");
|
|
91
91
|
}
|
|
92
|
-
const migrate = new
|
|
92
|
+
const migrate = new import_chunk_KXMACMQC.Migrate(schemaPath);
|
|
93
93
|
let devDiagnostic;
|
|
94
94
|
try {
|
|
95
95
|
devDiagnostic = await migrate.devDiagnostic();
|
|
@@ -104,22 +104,14 @@ var _MigrateDev = class _MigrateDev2 {
|
|
|
104
104
|
datasourceInfo,
|
|
105
105
|
reason: devDiagnostic.action.reason
|
|
106
106
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
process.stdout.write(
|
|
108
|
+
`
|
|
109
|
+
You may use ${(0, import_chunk_SKRR5WT4.red)("prisma migrate reset")} to drop the development database.
|
|
110
|
+
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)("All data will be lost."))}
|
|
111
111
|
`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
}
|
|
112
|
+
);
|
|
113
|
+
migrate.stop();
|
|
114
|
+
process.exit(130);
|
|
123
115
|
}
|
|
124
116
|
try {
|
|
125
117
|
const { appliedMigrationNames } = await migrate.applyMigrations();
|
|
@@ -160,10 +152,6 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
|
|
|
160
152
|
throw new Error(unexecutableStepsError);
|
|
161
153
|
}
|
|
162
154
|
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
155
|
process.stdout.write((0, import_chunk_SKRR5WT4.bold)(`
|
|
168
156
|
\u26A0\uFE0F Warnings for the current datasource:
|
|
169
157
|
|
|
@@ -174,6 +162,10 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)(
|
|
|
174
162
|
}
|
|
175
163
|
process.stdout.write("\n");
|
|
176
164
|
if (!args["--force"]) {
|
|
165
|
+
if (!(0, import_internals.canPrompt)()) {
|
|
166
|
+
migrate.stop();
|
|
167
|
+
throw new import_chunk_3WC4XD74.MigrateDevEnvNonInteractiveError();
|
|
168
|
+
}
|
|
177
169
|
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
170
|
const confirmation = await (0, import_prompts.default)({
|
|
179
171
|
type: "confirm",
|
|
@@ -250,7 +242,7 @@ ${(0, import_chunk_SKRR5WT4.green)("Your database is now in sync with your schem
|
|
|
250
242
|
await migrate.tryToRunGenerate(datasourceInfo);
|
|
251
243
|
process.stdout.write("\n");
|
|
252
244
|
}
|
|
253
|
-
if (
|
|
245
|
+
if (wasDbCreated && !process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
|
|
254
246
|
try {
|
|
255
247
|
const seedCommandFromPkgJson = await (0, import_chunk_V3ZMNXZC.getSeedCommandFromPackageJson)(process.cwd());
|
|
256
248
|
if (seedCommandFromPkgJson) {
|
|
@@ -302,7 +294,7 @@ ${_MigrateDev2.help}`);
|
|
|
302
294
|
return _MigrateDev2.help;
|
|
303
295
|
}
|
|
304
296
|
};
|
|
305
|
-
_MigrateDev
|
|
297
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(_MigrateDev, "help", (0, import_internals.format)(`
|
|
306
298
|
${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)
|
|
307
299
|
|
|
308
300
|
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
@@ -319,7 +311,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
|
319
311
|
The migration will be empty if there are no changes in Prisma schema
|
|
320
312
|
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
321
313
|
--skip-seed Skip triggering seed
|
|
322
|
-
--allow-reset Allow resetting the database on incompatible schema change (accept data loss)
|
|
323
314
|
|
|
324
315
|
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
325
316
|
|
|
@@ -331,5 +322,5 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
331
322
|
|
|
332
323
|
Create a migration without applying it
|
|
333
324
|
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate dev --create-only
|
|
334
|
-
`);
|
|
325
|
+
`));
|
|
335
326
|
var MigrateDev = _MigrateDev;
|
|
@@ -16,13 +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_DLLXDCI2_exports = {};
|
|
20
|
+
__export(chunk_DLLXDCI2_exports, {
|
|
21
21
|
CaptureStdout: () => CaptureStdout
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_DLLXDCI2_exports);
|
|
24
|
+
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
24
25
|
var CaptureStdout = class {
|
|
25
26
|
constructor() {
|
|
27
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "_capturedText");
|
|
28
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "_orig_stdout_write");
|
|
26
29
|
this._capturedText = [];
|
|
27
30
|
this._orig_stdout_write = null;
|
|
28
31
|
}
|
|
@@ -26,47 +26,41 @@ 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_E7OXHCDR_exports = {};
|
|
30
|
+
__export(chunk_E7OXHCDR_exports, {
|
|
31
31
|
DbExecute: () => DbExecute
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_E7OXHCDR_exports);
|
|
34
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
35
35
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
36
36
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
37
37
|
var import_internals = require("@prisma/internals");
|
|
38
38
|
var import_fs = __toESM(require("fs"));
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
let result = "";
|
|
46
|
-
if (stdin.isTTY) {
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
stdin.setEncoding("utf8");
|
|
50
|
-
for await (const chunk of stdin) {
|
|
51
|
-
result += chunk;
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
};
|
|
55
|
-
module2.exports.buffer = async () => {
|
|
56
|
-
const result = [];
|
|
57
|
-
let length = 0;
|
|
58
|
-
if (stdin.isTTY) {
|
|
59
|
-
return Buffer.concat([]);
|
|
60
|
-
}
|
|
61
|
-
for await (const chunk of stdin) {
|
|
62
|
-
result.push(chunk);
|
|
63
|
-
length += chunk.length;
|
|
64
|
-
}
|
|
65
|
-
return Buffer.concat(result, length);
|
|
66
|
-
};
|
|
40
|
+
var { stdin } = process;
|
|
41
|
+
async function getStdin() {
|
|
42
|
+
let result = "";
|
|
43
|
+
if (stdin.isTTY) {
|
|
44
|
+
return result;
|
|
67
45
|
}
|
|
68
|
-
|
|
69
|
-
|
|
46
|
+
stdin.setEncoding("utf8");
|
|
47
|
+
for await (const chunk of stdin) {
|
|
48
|
+
result += chunk;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
getStdin.buffer = async () => {
|
|
53
|
+
const result = [];
|
|
54
|
+
let length = 0;
|
|
55
|
+
if (stdin.isTTY) {
|
|
56
|
+
return Buffer.concat([]);
|
|
57
|
+
}
|
|
58
|
+
for await (const chunk of stdin) {
|
|
59
|
+
result.push(chunk);
|
|
60
|
+
length += chunk.length;
|
|
61
|
+
}
|
|
62
|
+
return Buffer.concat(result, length);
|
|
63
|
+
};
|
|
70
64
|
var helpOptions = (0, import_internals.format)(
|
|
71
65
|
`${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
72
66
|
|
|
@@ -151,7 +145,7 @@ See \`${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExec
|
|
|
151
145
|
}
|
|
152
146
|
}
|
|
153
147
|
if (args["--stdin"]) {
|
|
154
|
-
script = await (
|
|
148
|
+
script = await getStdin();
|
|
155
149
|
}
|
|
156
150
|
let datasourceType;
|
|
157
151
|
if (args["--url"]) {
|
|
@@ -167,7 +161,7 @@ See \`${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExec
|
|
|
167
161
|
...(0, import_internals.toSchemasWithConfigDir)(schemaWithPath, engineConfig)
|
|
168
162
|
};
|
|
169
163
|
}
|
|
170
|
-
const migrate = new
|
|
164
|
+
const migrate = new import_chunk_KXMACMQC.Migrate();
|
|
171
165
|
try {
|
|
172
166
|
await migrate.engine.dbExecute({
|
|
173
167
|
script,
|
|
@@ -188,7 +182,7 @@ ${helpOptions}`);
|
|
|
188
182
|
return _DbExecute2.help;
|
|
189
183
|
}
|
|
190
184
|
};
|
|
191
|
-
_DbExecute
|
|
185
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(_DbExecute, "help", (0, import_internals.format)(`
|
|
192
186
|
${process.platform === "win32" ? "" : "\u{1F4DD} "}Execute native commands to your database
|
|
193
187
|
|
|
194
188
|
This command takes as input a datasource, using ${(0, import_chunk_SKRR5WT4.green)(`--url`)} or ${(0, import_chunk_SKRR5WT4.green)(`--schema`)} and a script, using ${(0, import_chunk_SKRR5WT4.green)(
|
|
@@ -222,5 +216,5 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
222
216
|
prisma db execute \\
|
|
223
217
|
--stdin \\
|
|
224
218
|
--url="mysql://root:root@localhost/mydb"
|
|
225
|
-
`);
|
|
219
|
+
`));
|
|
226
220
|
var DbExecute = _DbExecute;
|