@prisma/migrate 6.17.0-dev.4 → 6.17.0-dev.6
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/Migrate.js +4 -3
- package/dist/bin.js +28 -27
- package/dist/{chunk-F3JIZWIS.js → chunk-3BC6W7CG.js} +13 -13
- package/dist/chunk-3WDCTXHL.js +270 -0
- package/dist/{chunk-U62JTEME.js → chunk-4GL5WXCD.js} +5 -5
- package/dist/{chunk-YEUENY2G.js → chunk-6OQEB4QQ.js} +5 -5
- package/dist/{chunk-R2YKCEAN.js → chunk-7E5C5GNE.js} +5 -5
- package/dist/{chunk-UQEITMMV.js → chunk-CWXY4DCV.js} +7 -7
- package/dist/{chunk-DYXEUKV3.js → chunk-D4TRX77Y.js} +6 -6
- package/dist/{chunk-YQ6GTOKJ.js → chunk-NI5KWETZ.js} +8 -8
- package/dist/{chunk-RNQEWSLQ.js → chunk-NL3WCYT3.js} +6 -6
- package/dist/{chunk-BKW5AGJV.js → chunk-NXWNFR5U.js} +5 -5
- package/dist/chunk-PHXLQVPT.js +1890 -0
- package/dist/{chunk-WXE3X4AN.js → chunk-R7B3TZ5A.js} +5 -5
- package/dist/{chunk-G56DQP5E.js → chunk-UPOG7SD7.js} +5 -5
- package/dist/{chunk-QF5OMSPA.js → chunk-USJF4W7L.js} +5 -5
- package/dist/{chunk-IINN7QUV.js → chunk-VU5BLQUI.js} +8 -8
- package/dist/{chunk-URKH6SE2.js → chunk-VV4M6AN7.js} +5 -251
- package/dist/{chunk-B64PYCYC.js → chunk-ZYGQLUWA.js} +8 -8
- package/dist/commands/DbExecute.js +5 -4
- package/dist/commands/DbPull.js +6 -5
- package/dist/commands/DbPush.js +5 -4
- package/dist/commands/DbSeed.js +4 -3
- package/dist/commands/MigrateDeploy.js +5 -4
- package/dist/commands/MigrateDev.js +6 -5
- package/dist/commands/MigrateDiff.js +5 -4
- package/dist/commands/MigrateReset.js +6 -5
- package/dist/commands/MigrateResolve.js +5 -4
- package/dist/commands/MigrateStatus.js +5 -4
- package/dist/index.js +30 -29
- package/dist/utils/getDatabaseVersionSafe.js +5 -4
- package/dist/utils/introspectSql.js +5 -4
- package/dist/utils/seed.js +4 -3
- package/dist/utils/spinner.js +4 -3
- package/package.json +10 -10
- package/dist/chunk-HFXUQT52.js +0 -1982
package/dist/Migrate.js
CHANGED
|
@@ -18,14 +18,15 @@ 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_3BC6W7CG.Migrate
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Migrate_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
25
25
|
var import_chunk_PCTCQIOH = require("./chunk-PCTCQIOH.js");
|
|
26
|
-
var
|
|
26
|
+
var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
|
|
27
27
|
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
28
28
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
29
|
+
var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
|
|
29
30
|
var import_chunk_ORBFWBKN = require("./chunk-ORBFWBKN.js");
|
|
30
31
|
var import_chunk_CD4AWGFA = require("./chunk-CD4AWGFA.js");
|
|
31
32
|
var import_chunk_AXR7LS2N = require("./chunk-AXR7LS2N.js");
|
package/dist/bin.js
CHANGED
|
@@ -23,19 +23,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
mod
|
|
24
24
|
));
|
|
25
25
|
var import_chunk_NGQA5JTN = require("./chunk-NGQA5JTN.js");
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var import_chunk_7E5C5GNE = require("./chunk-7E5C5GNE.js");
|
|
27
|
+
var import_chunk_NI5KWETZ = require("./chunk-NI5KWETZ.js");
|
|
28
28
|
var import_chunk_C3722PDA = require("./chunk-C3722PDA.js");
|
|
29
29
|
var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
30
|
+
var import_chunk_USJF4W7L = require("./chunk-USJF4W7L.js");
|
|
31
|
+
var import_chunk_ZYGQLUWA = require("./chunk-ZYGQLUWA.js");
|
|
32
|
+
var import_chunk_NL3WCYT3 = require("./chunk-NL3WCYT3.js");
|
|
33
|
+
var import_chunk_6OQEB4QQ = require("./chunk-6OQEB4QQ.js");
|
|
34
34
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
35
35
|
var import_chunk_EJG7GKM7 = require("./chunk-EJG7GKM7.js");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
36
|
+
var import_chunk_4GL5WXCD = require("./chunk-4GL5WXCD.js");
|
|
37
|
+
var import_chunk_CWXY4DCV = require("./chunk-CWXY4DCV.js");
|
|
38
|
+
var import_chunk_VU5BLQUI = require("./chunk-VU5BLQUI.js");
|
|
39
39
|
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
40
40
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
41
41
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
@@ -43,24 +43,25 @@ var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
|
43
43
|
var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
44
44
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
45
45
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
46
|
-
var
|
|
46
|
+
var import_chunk_R7B3TZ5A = require("./chunk-R7B3TZ5A.js");
|
|
47
47
|
var import_chunk_EXY2VDLY = require("./chunk-EXY2VDLY.js");
|
|
48
48
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
49
|
-
var
|
|
50
|
-
var
|
|
49
|
+
var import_chunk_D4TRX77Y = require("./chunk-D4TRX77Y.js");
|
|
50
|
+
var import_chunk_PHXLQVPT = require("./chunk-PHXLQVPT.js");
|
|
51
51
|
var import_chunk_LLO7YF56 = require("./chunk-LLO7YF56.js");
|
|
52
|
-
var
|
|
52
|
+
var import_chunk_NXWNFR5U = require("./chunk-NXWNFR5U.js");
|
|
53
53
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
54
54
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
55
55
|
var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
|
|
56
56
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
57
57
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
58
58
|
var import_chunk_TWPTG4XS = require("./chunk-TWPTG4XS.js");
|
|
59
|
-
var
|
|
59
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
60
60
|
var import_chunk_PCTCQIOH = require("./chunk-PCTCQIOH.js");
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
|
|
62
62
|
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
63
63
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
64
|
+
var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
|
|
64
65
|
var import_chunk_ORBFWBKN = require("./chunk-ORBFWBKN.js");
|
|
65
66
|
var import_chunk_CD4AWGFA = require("./chunk-CD4AWGFA.js");
|
|
66
67
|
var import_chunk_AXR7LS2N = require("./chunk-AXR7LS2N.js");
|
|
@@ -71,7 +72,7 @@ var import_config = require("@prisma/config");
|
|
|
71
72
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
72
73
|
var import_engines_version = require("@prisma/engines-version");
|
|
73
74
|
var import_internals = require("@prisma/internals");
|
|
74
|
-
var version = "6.17.0-dev.
|
|
75
|
+
var version = "6.17.0-dev.6";
|
|
75
76
|
process.on("uncaughtException", (e) => {
|
|
76
77
|
console.log(e);
|
|
77
78
|
});
|
|
@@ -93,19 +94,19 @@ var args = (0, import_internals.arg)(
|
|
|
93
94
|
async function main() {
|
|
94
95
|
const cli = import_chunk_NGQA5JTN.CLI.new({
|
|
95
96
|
migrate: import_chunk_LLO7YF56.MigrateCommand.new({
|
|
96
|
-
dev:
|
|
97
|
-
status:
|
|
98
|
-
resolve:
|
|
99
|
-
reset:
|
|
100
|
-
deploy:
|
|
101
|
-
diff:
|
|
97
|
+
dev: import_chunk_NI5KWETZ.MigrateDev.new(),
|
|
98
|
+
status: import_chunk_6OQEB4QQ.MigrateStatus.new(),
|
|
99
|
+
resolve: import_chunk_NL3WCYT3.MigrateResolve.new(),
|
|
100
|
+
reset: import_chunk_ZYGQLUWA.MigrateReset.new(),
|
|
101
|
+
deploy: import_chunk_NXWNFR5U.MigrateDeploy.new(),
|
|
102
|
+
diff: import_chunk_USJF4W7L.MigrateDiff.new()
|
|
102
103
|
}),
|
|
103
104
|
db: import_chunk_EJG7GKM7.DbCommand.new({
|
|
104
|
-
execute:
|
|
105
|
-
pull:
|
|
106
|
-
push:
|
|
105
|
+
execute: import_chunk_4GL5WXCD.DbExecute.new(),
|
|
106
|
+
pull: import_chunk_CWXY4DCV.DbPull.new(),
|
|
107
|
+
push: import_chunk_R7B3TZ5A.DbPush.new(),
|
|
107
108
|
// drop: DbDrop.new(),
|
|
108
|
-
seed:
|
|
109
|
+
seed: import_chunk_D4TRX77Y.DbSeed.new()
|
|
109
110
|
})
|
|
110
111
|
});
|
|
111
112
|
const { config, error } = await (0, import_config.loadConfigFromFile)({ configFile: args["--config"] });
|
|
@@ -135,7 +136,7 @@ main().then((code) => {
|
|
|
135
136
|
cliVersion: version,
|
|
136
137
|
enginesVersion: import_engines_version.enginesVersion,
|
|
137
138
|
command: commandArray.join(" "),
|
|
138
|
-
getDatabaseVersionSafe:
|
|
139
|
+
getDatabaseVersionSafe: import_chunk_7E5C5GNE.getDatabaseVersionSafe
|
|
139
140
|
}).catch((e) => {
|
|
140
141
|
if (import_debug.default.enabled("migrate")) {
|
|
141
142
|
console.error((0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)("Error: ")) + e.stack);
|
|
@@ -26,13 +26,13 @@ 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_3BC6W7CG_exports = {};
|
|
30
|
+
__export(chunk_3BC6W7CG_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_3BC6W7CG_exports);
|
|
34
34
|
var import_chunk_PCTCQIOH = require("./chunk-PCTCQIOH.js");
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
|
|
36
36
|
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
37
37
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
38
38
|
var import_chunk_ORBFWBKN = require("./chunk-ORBFWBKN.js");
|
|
@@ -406,14 +406,14 @@ var ANSI_SGR_TERMINATOR = "m";
|
|
|
406
406
|
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
407
407
|
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
408
408
|
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
409
|
-
var wordLengths = (string) => string.split(" ").map((character) => (0,
|
|
409
|
+
var wordLengths = (string) => string.split(" ").map((character) => (0, import_chunk_VV4M6AN7.stringWidth)(character));
|
|
410
410
|
var wrapWord = (rows, word, columns) => {
|
|
411
411
|
const characters = [...word];
|
|
412
412
|
let isInsideEscape = false;
|
|
413
413
|
let isInsideLinkEscape = false;
|
|
414
|
-
let visible = (0,
|
|
414
|
+
let visible = (0, import_chunk_VV4M6AN7.stringWidth)((0, import_chunk_VV4M6AN7.stripAnsi)(rows.at(-1)));
|
|
415
415
|
for (const [index, character] of characters.entries()) {
|
|
416
|
-
const characterLength = (0,
|
|
416
|
+
const characterLength = (0, import_chunk_VV4M6AN7.stringWidth)(character);
|
|
417
417
|
if (visible + characterLength <= columns) {
|
|
418
418
|
rows[rows.length - 1] += character;
|
|
419
419
|
} else {
|
|
@@ -450,7 +450,7 @@ var stringVisibleTrimSpacesRight = (string) => {
|
|
|
450
450
|
const words = string.split(" ");
|
|
451
451
|
let last = words.length;
|
|
452
452
|
while (last > 0) {
|
|
453
|
-
if ((0,
|
|
453
|
+
if ((0, import_chunk_VV4M6AN7.stringWidth)(words[last - 1]) > 0) {
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
456
|
last--;
|
|
@@ -473,7 +473,7 @@ var exec = (string, columns, options = {}) => {
|
|
|
473
473
|
if (options.trim !== false) {
|
|
474
474
|
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
475
475
|
}
|
|
476
|
-
let rowLength = (0,
|
|
476
|
+
let rowLength = (0, import_chunk_VV4M6AN7.stringWidth)(rows.at(-1));
|
|
477
477
|
if (index !== 0) {
|
|
478
478
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
479
479
|
rows.push("");
|
|
@@ -551,7 +551,7 @@ function isFullwidthCodePoint(codePoint) {
|
|
|
551
551
|
if (!Number.isInteger(codePoint)) {
|
|
552
552
|
return false;
|
|
553
553
|
}
|
|
554
|
-
return (0,
|
|
554
|
+
return (0, import_chunk_VV4M6AN7.eastAsianWidth)(codePoint) === 2;
|
|
555
555
|
}
|
|
556
556
|
var ESCAPES2 = /* @__PURE__ */ new Set([27, 155]);
|
|
557
557
|
var CODE_POINT_0 = "0".codePointAt(0);
|
|
@@ -687,7 +687,7 @@ var fitToTerminalHeight = (stream, text) => {
|
|
|
687
687
|
const terminalHeight = stream.rows ?? defaultTerminalHeight;
|
|
688
688
|
const lines = text.split("\n");
|
|
689
689
|
const toRemove = Math.max(0, lines.length - terminalHeight);
|
|
690
|
-
return toRemove ? sliceAnsi(text, (0,
|
|
690
|
+
return toRemove ? sliceAnsi(text, (0, import_chunk_VV4M6AN7.stripAnsi)(lines.slice(0, toRemove).join("\n")).length + 1) : text;
|
|
691
691
|
};
|
|
692
692
|
function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
693
693
|
let previousLineCount = 0;
|
|
@@ -700,7 +700,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
700
700
|
};
|
|
701
701
|
const render = (...arguments_) => {
|
|
702
702
|
if (!showCursor) {
|
|
703
|
-
|
|
703
|
+
import_chunk_VV4M6AN7.cli_cursor_default.hide();
|
|
704
704
|
}
|
|
705
705
|
let output = fitToTerminalHeight(stream, arguments_.join(" ") + "\n");
|
|
706
706
|
const width = getWidth(stream);
|
|
@@ -720,7 +720,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
720
720
|
render.done = () => {
|
|
721
721
|
reset();
|
|
722
722
|
if (!showCursor) {
|
|
723
|
-
|
|
723
|
+
import_chunk_VV4M6AN7.cli_cursor_default.show();
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
726
|
return render;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_3WDCTXHL_exports = {};
|
|
20
|
+
__export(chunk_3WDCTXHL_exports, {
|
|
21
|
+
onExit: () => onExit
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(chunk_3WDCTXHL_exports);
|
|
24
|
+
var signals = [];
|
|
25
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
26
|
+
if (process.platform !== "win32") {
|
|
27
|
+
signals.push(
|
|
28
|
+
"SIGALRM",
|
|
29
|
+
"SIGABRT",
|
|
30
|
+
"SIGVTALRM",
|
|
31
|
+
"SIGXCPU",
|
|
32
|
+
"SIGXFSZ",
|
|
33
|
+
"SIGUSR2",
|
|
34
|
+
"SIGTRAP",
|
|
35
|
+
"SIGSYS",
|
|
36
|
+
"SIGQUIT",
|
|
37
|
+
"SIGIOT"
|
|
38
|
+
// should detect profiler and enable/disable accordingly.
|
|
39
|
+
// see #21
|
|
40
|
+
// 'SIGPROF'
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (process.platform === "linux") {
|
|
44
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
45
|
+
}
|
|
46
|
+
var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
|
|
47
|
+
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
48
|
+
var global = globalThis;
|
|
49
|
+
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
50
|
+
var Emitter = class {
|
|
51
|
+
emitted = {
|
|
52
|
+
afterExit: false,
|
|
53
|
+
exit: false
|
|
54
|
+
};
|
|
55
|
+
listeners = {
|
|
56
|
+
afterExit: [],
|
|
57
|
+
exit: []
|
|
58
|
+
};
|
|
59
|
+
count = 0;
|
|
60
|
+
id = Math.random();
|
|
61
|
+
constructor() {
|
|
62
|
+
if (global[kExitEmitter]) {
|
|
63
|
+
return global[kExitEmitter];
|
|
64
|
+
}
|
|
65
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
66
|
+
value: this,
|
|
67
|
+
writable: false,
|
|
68
|
+
enumerable: false,
|
|
69
|
+
configurable: false
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
on(ev, fn) {
|
|
73
|
+
this.listeners[ev].push(fn);
|
|
74
|
+
}
|
|
75
|
+
removeListener(ev, fn) {
|
|
76
|
+
const list = this.listeners[ev];
|
|
77
|
+
const i = list.indexOf(fn);
|
|
78
|
+
if (i === -1) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (i === 0 && list.length === 1) {
|
|
82
|
+
list.length = 0;
|
|
83
|
+
} else {
|
|
84
|
+
list.splice(i, 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
emit(ev, code, signal) {
|
|
88
|
+
if (this.emitted[ev]) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
this.emitted[ev] = true;
|
|
92
|
+
let ret = false;
|
|
93
|
+
for (const fn of this.listeners[ev]) {
|
|
94
|
+
ret = fn(code, signal) === true || ret;
|
|
95
|
+
}
|
|
96
|
+
if (ev === "exit") {
|
|
97
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
98
|
+
}
|
|
99
|
+
return ret;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var SignalExitBase = class {
|
|
103
|
+
};
|
|
104
|
+
var signalExitWrap = (handler) => {
|
|
105
|
+
return {
|
|
106
|
+
onExit(cb, opts) {
|
|
107
|
+
return handler.onExit(cb, opts);
|
|
108
|
+
},
|
|
109
|
+
load() {
|
|
110
|
+
return handler.load();
|
|
111
|
+
},
|
|
112
|
+
unload() {
|
|
113
|
+
return handler.unload();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
var SignalExitFallback = class extends SignalExitBase {
|
|
118
|
+
onExit() {
|
|
119
|
+
return () => {
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
load() {
|
|
123
|
+
}
|
|
124
|
+
unload() {
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var SignalExit = class extends SignalExitBase {
|
|
128
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
129
|
+
// so use a supported signal instead
|
|
130
|
+
/* c8 ignore start */
|
|
131
|
+
#hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
132
|
+
/* c8 ignore stop */
|
|
133
|
+
#emitter = new Emitter();
|
|
134
|
+
#process;
|
|
135
|
+
#originalProcessEmit;
|
|
136
|
+
#originalProcessReallyExit;
|
|
137
|
+
#sigListeners = {};
|
|
138
|
+
#loaded = false;
|
|
139
|
+
constructor(process3) {
|
|
140
|
+
super();
|
|
141
|
+
this.#process = process3;
|
|
142
|
+
this.#sigListeners = {};
|
|
143
|
+
for (const sig of signals) {
|
|
144
|
+
this.#sigListeners[sig] = () => {
|
|
145
|
+
const listeners = this.#process.listeners(sig);
|
|
146
|
+
let { count } = this.#emitter;
|
|
147
|
+
const p = process3;
|
|
148
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
149
|
+
count += p.__signal_exit_emitter__.count;
|
|
150
|
+
}
|
|
151
|
+
if (listeners.length === count) {
|
|
152
|
+
this.unload();
|
|
153
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
154
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
155
|
+
if (!ret)
|
|
156
|
+
process3.kill(process3.pid, s);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
this.#originalProcessReallyExit = process3.reallyExit;
|
|
161
|
+
this.#originalProcessEmit = process3.emit;
|
|
162
|
+
}
|
|
163
|
+
onExit(cb, opts) {
|
|
164
|
+
if (!processOk(this.#process)) {
|
|
165
|
+
return () => {
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (this.#loaded === false) {
|
|
169
|
+
this.load();
|
|
170
|
+
}
|
|
171
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
172
|
+
this.#emitter.on(ev, cb);
|
|
173
|
+
return () => {
|
|
174
|
+
this.#emitter.removeListener(ev, cb);
|
|
175
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
176
|
+
this.unload();
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
load() {
|
|
181
|
+
if (this.#loaded) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.#loaded = true;
|
|
185
|
+
this.#emitter.count += 1;
|
|
186
|
+
for (const sig of signals) {
|
|
187
|
+
try {
|
|
188
|
+
const fn = this.#sigListeners[sig];
|
|
189
|
+
if (fn)
|
|
190
|
+
this.#process.on(sig, fn);
|
|
191
|
+
} catch (_) {
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
this.#process.emit = (ev, ...a) => {
|
|
195
|
+
return this.#processEmit(ev, ...a);
|
|
196
|
+
};
|
|
197
|
+
this.#process.reallyExit = (code) => {
|
|
198
|
+
return this.#processReallyExit(code);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
unload() {
|
|
202
|
+
if (!this.#loaded) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.#loaded = false;
|
|
206
|
+
signals.forEach((sig) => {
|
|
207
|
+
const listener = this.#sigListeners[sig];
|
|
208
|
+
if (!listener) {
|
|
209
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
this.#process.removeListener(sig, listener);
|
|
213
|
+
} catch (_) {
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
217
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
218
|
+
this.#emitter.count -= 1;
|
|
219
|
+
}
|
|
220
|
+
#processReallyExit(code) {
|
|
221
|
+
if (!processOk(this.#process)) {
|
|
222
|
+
return 0;
|
|
223
|
+
}
|
|
224
|
+
this.#process.exitCode = code || 0;
|
|
225
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
226
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
227
|
+
}
|
|
228
|
+
#processEmit(ev, ...args) {
|
|
229
|
+
const og = this.#originalProcessEmit;
|
|
230
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
231
|
+
if (typeof args[0] === "number") {
|
|
232
|
+
this.#process.exitCode = args[0];
|
|
233
|
+
}
|
|
234
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
235
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
236
|
+
return ret;
|
|
237
|
+
} else {
|
|
238
|
+
return og.call(this.#process, ev, ...args);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
var process2 = globalThis.process;
|
|
243
|
+
var {
|
|
244
|
+
/**
|
|
245
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
246
|
+
* exit, or running out of stuff to do.
|
|
247
|
+
*
|
|
248
|
+
* If the global process object is not suitable for instrumentation,
|
|
249
|
+
* then this will be a no-op.
|
|
250
|
+
*
|
|
251
|
+
* Returns a function that may be used to unload signal-exit.
|
|
252
|
+
*/
|
|
253
|
+
onExit,
|
|
254
|
+
/**
|
|
255
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
256
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
257
|
+
* Mostly exposed for the benefit of testing.
|
|
258
|
+
*
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
261
|
+
load,
|
|
262
|
+
/**
|
|
263
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
264
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
265
|
+
* Mostly exposed for the benefit of testing.
|
|
266
|
+
*
|
|
267
|
+
* @internal
|
|
268
|
+
*/
|
|
269
|
+
unload
|
|
270
|
+
} = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback());
|
|
@@ -26,12 +26,12 @@ 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_4GL5WXCD_exports = {};
|
|
30
|
+
__export(chunk_4GL5WXCD_exports, {
|
|
31
31
|
DbExecute: () => DbExecute
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_4GL5WXCD_exports);
|
|
34
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
35
35
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
36
36
|
var import_consumers = __toESM(require("node:stream/consumers"));
|
|
37
37
|
var import_internals = require("@prisma/internals");
|
|
@@ -188,7 +188,7 @@ See \`${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExec
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
const adapter = await config.adapter?.();
|
|
191
|
-
const migrate = await
|
|
191
|
+
const migrate = await import_chunk_3BC6W7CG.Migrate.setup({ adapter });
|
|
192
192
|
try {
|
|
193
193
|
await migrate.engine.dbExecute({
|
|
194
194
|
script,
|
|
@@ -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
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_6OQEB4QQ_exports = {};
|
|
30
|
+
__export(chunk_6OQEB4QQ_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_6OQEB4QQ_exports);
|
|
34
34
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
35
35
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
37
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
38
38
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
39
39
|
var import_internals = require("@prisma/internals");
|
|
@@ -94,7 +94,7 @@ Check the status of your database migrations
|
|
|
94
94
|
externalTables: config.tables?.external ?? [],
|
|
95
95
|
externalEnums: config.enums?.external ?? []
|
|
96
96
|
};
|
|
97
|
-
const migrate = await
|
|
97
|
+
const migrate = await import_chunk_3BC6W7CG.Migrate.setup({ adapter, migrationsDirPath, schemaContext, schemaFilter });
|
|
98
98
|
if (!adapter) {
|
|
99
99
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
100
100
|
}
|
|
@@ -26,19 +26,19 @@ 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_7E5C5GNE_exports = {};
|
|
30
|
+
__export(chunk_7E5C5GNE_exports, {
|
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_7E5C5GNE_exports);
|
|
34
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
35
35
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
36
36
|
var debug = (0, import_debug.default)("prisma:cli");
|
|
37
37
|
async function getDatabaseVersionSafe(args) {
|
|
38
38
|
let migrate;
|
|
39
39
|
let dbVersion;
|
|
40
40
|
try {
|
|
41
|
-
migrate = await
|
|
41
|
+
migrate = await import_chunk_3BC6W7CG.Migrate.setup({});
|
|
42
42
|
dbVersion = await migrate.engine.getDatabaseVersion(args);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
debug(e);
|
|
@@ -26,12 +26,12 @@ 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_CWXY4DCV_exports = {};
|
|
30
|
+
__export(chunk_CWXY4DCV_exports, {
|
|
31
31
|
DbPull: () => DbPull
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_CWXY4DCV_exports);
|
|
34
|
+
var import_chunk_VU5BLQUI = require("./chunk-VU5BLQUI.js");
|
|
35
35
|
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
36
36
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
37
37
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
@@ -42,7 +42,7 @@ var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
|
42
42
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
43
43
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
44
44
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
45
|
-
var
|
|
45
|
+
var import_chunk_3BC6W7CG = require("./chunk-3BC6W7CG.js");
|
|
46
46
|
var import_chunk_AXR7LS2N = require("./chunk-AXR7LS2N.js");
|
|
47
47
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
48
48
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -118,7 +118,7 @@ Set composite types introspection depth to 2 levels
|
|
|
118
118
|
"--local-d1": Boolean
|
|
119
119
|
// optional, only on cloudflare D1
|
|
120
120
|
});
|
|
121
|
-
const spinnerFactory = (0,
|
|
121
|
+
const spinnerFactory = (0, import_chunk_VU5BLQUI.createSpinner)(!args["--print"]);
|
|
122
122
|
if (args instanceof Error) {
|
|
123
123
|
return this.help(args.message);
|
|
124
124
|
}
|
|
@@ -234,7 +234,7 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
|
234
234
|
)} for more info.`);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
const migrate = await
|
|
237
|
+
const migrate = await import_chunk_3BC6W7CG.Migrate.setup({ adapter, schemaContext: schemaContext ?? void 0 });
|
|
238
238
|
const engine = migrate.engine;
|
|
239
239
|
const basedOn = !args["--url"] && schemaContext?.primaryDatasource ? ` based on datasource defined in ${(0, import_chunk_SKRR5WT4.underline)(schemaContext.loadedFromPathForLogMessages)}` : "";
|
|
240
240
|
const introspectionSpinner = spinnerFactory(`Introspecting${basedOn}`);
|
|
@@ -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_D4TRX77Y_exports = {};
|
|
20
|
+
__export(chunk_D4TRX77Y_exports, {
|
|
21
21
|
DbSeed: () => DbSeed
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_D4TRX77Y_exports);
|
|
24
|
+
var import_chunk_PHXLQVPT = require("./chunk-PHXLQVPT.js");
|
|
25
25
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
26
26
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
@@ -215,11 +215,11 @@ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 va
|
|
|
215
215
|
}
|
|
216
216
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
217
217
|
const seedCommandFromPrismaConfig = config.migrations?.seed;
|
|
218
|
-
const seedCommandFromPkgJson = await (0,
|
|
218
|
+
const seedCommandFromPkgJson = await (0, import_chunk_PHXLQVPT.getSeedCommandFromPackageJson)(process.cwd());
|
|
219
219
|
const seedCommand = seedCommandFromPrismaConfig ?? seedCommandFromPkgJson;
|
|
220
220
|
if (!seedCommand) return ``;
|
|
221
221
|
const extraArgs = args._.join(" ");
|
|
222
|
-
const successfulSeeding = await (0,
|
|
222
|
+
const successfulSeeding = await (0, import_chunk_PHXLQVPT.executeSeedCommand)({ commandFromConfig: seedCommand, extraArgs });
|
|
223
223
|
if (successfulSeeding) {
|
|
224
224
|
return `
|
|
225
225
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.`;
|