@prisma/migrate 6.5.0-dev.1 → 6.5.0-dev.2
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 -4
- package/dist/Migrate.js +6 -7
- package/dist/SchemaEngine.js +6 -7
- package/dist/bin.js +116 -146
- package/dist/{chunk-WOOPRG54.js → chunk-255BRND3.js} +7 -14
- package/dist/{chunk-75EIHNAH.js → chunk-2NMFKGXM.js} +5 -6
- package/dist/chunk-3WC4XD74.js +98 -0
- package/dist/chunk-4EV2RVXY.js +226 -0
- package/dist/{chunk-YWWOSXMY.js → chunk-4JQIX6O7.js} +7 -15
- package/dist/{chunk-M5YNQ2NP.js → chunk-6DFJIBJX.js} +5 -12
- package/dist/{chunk-SGCF5OHF.js → chunk-7CQBDP4H.js} +6 -13
- package/dist/{chunk-7IT2ZO3D.js → chunk-AHJ2N6BJ.js} +3 -9
- package/dist/chunk-C2PR6JQR.js +266 -0
- package/dist/chunk-CTPONE6G.js +65 -0
- package/dist/{chunk-DUCG3NRP.js → chunk-D74DU52C.js} +633 -806
- package/dist/{chunk-UVNSK22K.js → chunk-DDHPSYC4.js} +122 -130
- package/dist/{chunk-CUDKD32S.js → chunk-DIAO4W7O.js} +11 -17
- package/dist/{chunk-XJQP3B4W.js → chunk-DJMFXNR4.js} +7 -15
- package/dist/{chunk-YD7GG4WS.js → chunk-FRTPDRF2.js} +66 -74
- package/dist/chunk-HIFVDK2U.js +96 -0
- package/dist/chunk-I4EY55DC.js +195 -0
- package/dist/{chunk-WLJHGKMK.js → chunk-IHDN3L3R.js} +7 -8
- package/dist/{chunk-V5LEZ5BX.js → chunk-IIBRYI63.js} +634 -807
- package/dist/{chunk-INC2OACE.js → chunk-JFKDSUIE.js} +3 -9
- package/dist/{chunk-V7DE6JTG.js → chunk-JZ75RIMZ.js} +3 -9
- package/dist/{chunk-AAATUOV6.js → chunk-L6KOIJJ5.js} +53 -59
- package/dist/{chunk-GN5BY5N2.js → chunk-LGYRZ6CV.js} +4 -10
- package/dist/chunk-LVLRGTYH.js +148 -0
- package/dist/{chunk-CQQQ436N.js → chunk-MATFO4ZW.js} +186 -200
- package/dist/{chunk-IFCV5MY4.js → chunk-OCQGHQED.js} +5 -11
- package/dist/chunk-ORL3LJOT.js +470 -0
- package/dist/{chunk-Q7ACZDDT.js → chunk-QOPTDDIH.js} +5 -12
- package/dist/chunk-QTAIWPLH.js +78 -0
- package/dist/{chunk-35LAJN5S.js → chunk-RP2N6UXA.js} +23 -29
- package/dist/chunk-RQFGRXJI.js +174 -0
- package/dist/{chunk-QBK5XTJE.js → chunk-RR6BKMNO.js} +3 -9
- package/dist/{chunk-ILJRJJ3S.js → chunk-RTGQXNX6.js} +3 -9
- package/dist/chunk-SKRR5WT4.js +76 -0
- package/dist/chunk-TM3ETZES.js +153 -0
- package/dist/{chunk-KPUNMK5W.js → chunk-TWPTG4XS.js} +5 -12
- package/dist/{chunk-6QFE3AWR.js → chunk-UP6FVCDK.js} +6 -13
- package/dist/{chunk-YKUZUAXA.js → chunk-V3ZMNXZC.js} +16 -23
- package/dist/chunk-WLPX3672.js +365 -0
- package/dist/chunk-WNH2ACJS.js +122 -0
- package/dist/chunk-XSNOKQTD.js +347 -0
- package/dist/{chunk-X6XGFLEF.js → chunk-YZVZCC3I.js} +25 -30
- package/dist/commands/DbCommand.js +3 -4
- package/dist/commands/DbDrop.js +9 -9
- package/dist/commands/DbExecute.js +7 -8
- package/dist/commands/DbPull.js +18 -19
- package/dist/commands/DbPush.js +12 -13
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -4
- package/dist/commands/MigrateDeploy.js +13 -14
- package/dist/commands/MigrateDev.js +17 -18
- package/dist/commands/MigrateDiff.js +8 -9
- package/dist/commands/MigrateReset.js +15 -16
- package/dist/commands/MigrateResolve.js +11 -12
- package/dist/commands/MigrateStatus.js +11 -12
- package/dist/index.js +60 -77
- package/dist/{multipart-parser-73VM3J4A.js → multipart-parser-NDLECNMN.js} +527 -561
- package/dist/utils/byline.js +5 -6
- package/dist/utils/captureStdout.js +2 -3
- package/dist/utils/countModelsAndTypes.js +2 -3
- package/dist/utils/ensureDatabaseExists.js +8 -9
- package/dist/utils/errors.js +8 -9
- package/dist/utils/flagErrors.js +5 -5
- package/dist/utils/getDatabaseVersionSafe.js +6 -7
- package/dist/utils/getSchemaPathAndPrint.js +4 -5
- package/dist/utils/handleEvaluateDataloss.js +3 -4
- package/dist/utils/introspectSql.js +6 -6
- package/dist/utils/isSchemaEmpty.js +2 -3
- package/dist/utils/printDatasource.js +3 -4
- package/dist/utils/printDatasources.js +3 -4
- package/dist/utils/printFiles.js +5 -6
- package/dist/utils/printIntrospectedSchema.js +2 -3
- package/dist/utils/printMigrationId.js +4 -5
- package/dist/utils/promptForMigrationName.js +2 -3
- package/dist/utils/removeSchemaFiles.js +2 -3
- package/dist/utils/replaceOrAddDatasource.js +2 -3
- package/dist/utils/replaceOrAddDatasource.test.js +7 -8
- package/dist/utils/saveSchemaFiles.js +2 -3
- package/dist/utils/seed.js +6 -7
- package/dist/utils/spinner.js +2 -3
- package/dist/utils/unixSocket.js +2 -3
- package/dist/views/handleViewsIO.js +2 -3
- package/package.json +6 -6
- package/dist/chunk-26XQQ4AG.js +0 -386
- package/dist/chunk-2RSEPJFX.js +0 -165
- package/dist/chunk-4B2LXK4R.js +0 -207
- package/dist/chunk-4UJBOCZJ.js +0 -130
- package/dist/chunk-5HZLCY6X.js +0 -161
- package/dist/chunk-6TE2RIPN.js +0 -80
- package/dist/chunk-7S3Q4MCN.js +0 -480
- package/dist/chunk-AOX7CJAS.js +0 -234
- package/dist/chunk-FF3526PX.js +0 -279
- package/dist/chunk-FUSFURVP.js +0 -86
- package/dist/chunk-GCTCQLOF.js +0 -365
- package/dist/chunk-K44VNAFW.js +0 -189
- package/dist/chunk-O4BT6W33.js +0 -104
- package/dist/chunk-TKAGMA5K.js +0 -72
- package/dist/chunk-U374EXYQ.js +0 -106
|
@@ -26,38 +26,37 @@ 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(
|
|
31
|
-
MigrateDiff: () => MigrateDiff
|
|
32
|
-
init_MigrateDiff: () => init_MigrateDiff
|
|
29
|
+
var chunk_IIBRYI63_exports = {};
|
|
30
|
+
__export(chunk_IIBRYI63_exports, {
|
|
31
|
+
MigrateDiff: () => MigrateDiff
|
|
33
32
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_IIBRYI63_exports);
|
|
35
34
|
var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
|
|
36
35
|
var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
36
|
+
var import_chunk_CTPONE6G = require("./chunk-CTPONE6G.js");
|
|
37
|
+
var import_chunk_DDHPSYC4 = require("./chunk-DDHPSYC4.js");
|
|
38
|
+
var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
|
|
39
|
+
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
41
40
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
41
|
+
var import_debug = __toESM(require("@prisma/debug"));
|
|
42
|
+
var import_internals = require("@prisma/internals");
|
|
43
|
+
var import_path = __toESM(require("path"));
|
|
44
|
+
var import_debug2 = require("@prisma/debug");
|
|
45
|
+
var import_fs = __toESM(require("fs"));
|
|
46
|
+
var import_path2 = __toESM(require("path"));
|
|
47
|
+
var import_node_path = __toESM(require("node:path"));
|
|
42
48
|
var import_node_process = __toESM(require("node:process"));
|
|
43
49
|
var import_promises = __toESM(require("node:fs/promises"));
|
|
44
50
|
var import_node_url = require("node:url");
|
|
45
|
-
var import_node_path = __toESM(require("node:path"));
|
|
46
|
-
var import_node_url2 = require("node:url");
|
|
47
|
-
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
48
51
|
var import_node_path2 = __toESM(require("node:path"));
|
|
52
|
+
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
49
53
|
var import_node_path3 = __toESM(require("node:path"));
|
|
50
|
-
var
|
|
51
|
-
var import_node_path4 = __toESM(require("node:path"));
|
|
52
|
-
var import_debug = __toESM(require("@prisma/debug"));
|
|
53
|
-
var import_get_platform = require("@prisma/get-platform");
|
|
54
|
-
var import_debug2 = require("@prisma/debug");
|
|
55
|
-
var import_fs = __toESM(require("fs"));
|
|
56
|
-
var import_path = __toESM(require("path"));
|
|
54
|
+
var import_node_url2 = require("node:url");
|
|
57
55
|
var import_util = require("util");
|
|
58
56
|
var import_debug3 = __toESM(require("@prisma/debug"));
|
|
59
|
-
var
|
|
60
|
-
var
|
|
57
|
+
var import_get_platform = require("@prisma/get-platform");
|
|
58
|
+
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
|
59
|
+
var import_node_path4 = __toESM(require("node:path"));
|
|
61
60
|
var require_promisify = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
62
61
|
"../../node_modules/.pnpm/fs-jetpack@5.1.0/node_modules/fs-jetpack/lib/utils/promisify.js"(exports, module2) {
|
|
63
62
|
"use strict";
|
|
@@ -6415,33 +6414,6 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6415
6414
|
}
|
|
6416
6415
|
}
|
|
6417
6416
|
});
|
|
6418
|
-
async function findUp(name, {
|
|
6419
|
-
cwd = import_node_process.default.cwd(),
|
|
6420
|
-
type = "file",
|
|
6421
|
-
stopAt
|
|
6422
|
-
} = {}) {
|
|
6423
|
-
let directory = import_node_path.default.resolve(toPath(cwd) ?? "");
|
|
6424
|
-
const { root } = import_node_path.default.parse(directory);
|
|
6425
|
-
stopAt = import_node_path.default.resolve(directory, toPath(stopAt ?? root));
|
|
6426
|
-
while (directory && directory !== stopAt && directory !== root) {
|
|
6427
|
-
const filePath = import_node_path.default.isAbsolute(name) ? name : import_node_path.default.join(directory, name);
|
|
6428
|
-
try {
|
|
6429
|
-
const stats = await import_promises.default.stat(filePath);
|
|
6430
|
-
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) {
|
|
6431
|
-
return filePath;
|
|
6432
|
-
}
|
|
6433
|
-
} catch {
|
|
6434
|
-
}
|
|
6435
|
-
directory = import_node_path.default.dirname(directory);
|
|
6436
|
-
}
|
|
6437
|
-
}
|
|
6438
|
-
var toPath;
|
|
6439
|
-
var init_find_up_simple = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
6440
|
-
"../../node_modules/.pnpm/find-up-simple@1.0.0/node_modules/find-up-simple/index.js"() {
|
|
6441
|
-
"use strict";
|
|
6442
|
-
toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
6443
|
-
}
|
|
6444
|
-
});
|
|
6445
6417
|
var require_js_tokens = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
6446
6418
|
"../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js"(exports) {
|
|
6447
6419
|
"use strict";
|
|
@@ -8453,115 +8425,6 @@ ${frame}`;
|
|
|
8453
8425
|
}
|
|
8454
8426
|
}
|
|
8455
8427
|
});
|
|
8456
|
-
function getPosition(text, textIndex) {
|
|
8457
|
-
const lineBreakBefore = safeLastIndexOf(text, "\n", textIndex - 1);
|
|
8458
|
-
const column = textIndex - lineBreakBefore - 1;
|
|
8459
|
-
let line = 0;
|
|
8460
|
-
for (let index = lineBreakBefore; index >= 0; index = safeLastIndexOf(text, "\n", index - 1)) {
|
|
8461
|
-
line++;
|
|
8462
|
-
}
|
|
8463
|
-
return { line, column };
|
|
8464
|
-
}
|
|
8465
|
-
function indexToLineColumn(text, textIndex, { oneBased = false } = {}) {
|
|
8466
|
-
if (textIndex < 0 || textIndex >= text.length && text.length > 0) {
|
|
8467
|
-
throw new RangeError("Index out of bounds");
|
|
8468
|
-
}
|
|
8469
|
-
const position = getPosition(text, textIndex);
|
|
8470
|
-
return oneBased ? { line: position.line + 1, column: position.column + 1 } : position;
|
|
8471
|
-
}
|
|
8472
|
-
var safeLastIndexOf;
|
|
8473
|
-
var init_index_to_position = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
8474
|
-
"../../node_modules/.pnpm/index-to-position@0.1.2/node_modules/index-to-position/index.js"() {
|
|
8475
|
-
"use strict";
|
|
8476
|
-
safeLastIndexOf = (string, searchString, index) => index < 0 ? -1 : string.lastIndexOf(searchString, index);
|
|
8477
|
-
}
|
|
8478
|
-
});
|
|
8479
|
-
function parseJson(string, reviver, fileName) {
|
|
8480
|
-
if (typeof reviver === "string") {
|
|
8481
|
-
fileName = reviver;
|
|
8482
|
-
reviver = void 0;
|
|
8483
|
-
}
|
|
8484
|
-
let message;
|
|
8485
|
-
try {
|
|
8486
|
-
return JSON.parse(string, reviver);
|
|
8487
|
-
} catch (error) {
|
|
8488
|
-
message = error.message;
|
|
8489
|
-
}
|
|
8490
|
-
let location;
|
|
8491
|
-
if (string) {
|
|
8492
|
-
location = getErrorLocation(string, message);
|
|
8493
|
-
message = addCodePointToUnexpectedToken(message);
|
|
8494
|
-
} else {
|
|
8495
|
-
message += " while parsing empty string";
|
|
8496
|
-
}
|
|
8497
|
-
const jsonError = new JSONError(message);
|
|
8498
|
-
jsonError.fileName = fileName;
|
|
8499
|
-
if (location) {
|
|
8500
|
-
jsonError.codeFrame = generateCodeFrame(string, location);
|
|
8501
|
-
jsonError.rawCodeFrame = generateCodeFrame(
|
|
8502
|
-
string,
|
|
8503
|
-
location,
|
|
8504
|
-
/* highlightCode */
|
|
8505
|
-
false
|
|
8506
|
-
);
|
|
8507
|
-
}
|
|
8508
|
-
throw jsonError;
|
|
8509
|
-
}
|
|
8510
|
-
var import_code_frame, getCodePoint, _message, _JSONError, JSONError, generateCodeFrame, getErrorLocation, addCodePointToUnexpectedToken;
|
|
8511
|
-
var init_parse_json = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
8512
|
-
"../../node_modules/.pnpm/parse-json@8.1.0/node_modules/parse-json/index.js"() {
|
|
8513
|
-
"use strict";
|
|
8514
|
-
import_code_frame = (0, import_chunk_WWAWV7DQ.__toESM)(require_lib4(), 1);
|
|
8515
|
-
init_index_to_position();
|
|
8516
|
-
getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`;
|
|
8517
|
-
_JSONError = class _JSONError2 extends Error {
|
|
8518
|
-
constructor(message) {
|
|
8519
|
-
super();
|
|
8520
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "name", "JSONError");
|
|
8521
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "fileName");
|
|
8522
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "codeFrame");
|
|
8523
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "rawCodeFrame");
|
|
8524
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _message);
|
|
8525
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _message, message);
|
|
8526
|
-
Error.captureStackTrace?.(this, _JSONError2);
|
|
8527
|
-
}
|
|
8528
|
-
get message() {
|
|
8529
|
-
const { fileName, codeFrame } = this;
|
|
8530
|
-
return `${(0, import_chunk_WWAWV7DQ.__privateGet)(this, _message)}${fileName ? ` in ${fileName}` : ""}${codeFrame ? `
|
|
8531
|
-
|
|
8532
|
-
${codeFrame}
|
|
8533
|
-
` : ""}`;
|
|
8534
|
-
}
|
|
8535
|
-
set message(message) {
|
|
8536
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _message, message);
|
|
8537
|
-
}
|
|
8538
|
-
};
|
|
8539
|
-
_message = /* @__PURE__ */ new WeakMap();
|
|
8540
|
-
JSONError = _JSONError;
|
|
8541
|
-
generateCodeFrame = (string, location, highlightCode = true) => (0, import_code_frame.codeFrameColumns)(string, { start: location }, { highlightCode });
|
|
8542
|
-
getErrorLocation = (string, message) => {
|
|
8543
|
-
const match = message.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);
|
|
8544
|
-
if (!match) {
|
|
8545
|
-
return;
|
|
8546
|
-
}
|
|
8547
|
-
let { index, line, column } = match.groups;
|
|
8548
|
-
if (line && column) {
|
|
8549
|
-
return { line: Number(line), column: Number(column) };
|
|
8550
|
-
}
|
|
8551
|
-
index = Number(index);
|
|
8552
|
-
if (index === string.length) {
|
|
8553
|
-
const { line: line2, column: column2 } = indexToLineColumn(string, string.length - 1, { oneBased: true });
|
|
8554
|
-
return { line: line2, column: column2 + 1 };
|
|
8555
|
-
}
|
|
8556
|
-
return indexToLineColumn(string, index, { oneBased: true });
|
|
8557
|
-
};
|
|
8558
|
-
addCodePointToUnexpectedToken = (message) => message.replace(
|
|
8559
|
-
// TODO[engine:node@>=20]: The token always quoted after Node.js 20
|
|
8560
|
-
/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,
|
|
8561
|
-
(_, _quote, token) => `"${token}"(${getCodePoint(token)})`
|
|
8562
|
-
);
|
|
8563
|
-
}
|
|
8564
|
-
});
|
|
8565
8428
|
var require_spdx_license_ids = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
8566
8429
|
"../../node_modules/.pnpm/spdx-license-ids@3.0.21/node_modules/spdx-license-ids/index.json"(exports, module2) {
|
|
8567
8430
|
module2.exports = [
|
|
@@ -11268,60 +11131,270 @@ var require_normalize = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11268
11131
|
}
|
|
11269
11132
|
}
|
|
11270
11133
|
});
|
|
11271
|
-
var
|
|
11272
|
-
"
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11134
|
+
var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
11135
|
+
"../internals/package.json"(exports, module2) {
|
|
11136
|
+
module2.exports = {
|
|
11137
|
+
name: "@prisma/internals",
|
|
11138
|
+
version: "6.5.0-dev.2",
|
|
11139
|
+
description: "This package is intended for Prisma's internal use",
|
|
11140
|
+
main: "dist/index.js",
|
|
11141
|
+
types: "dist/index.d.ts",
|
|
11142
|
+
repository: {
|
|
11143
|
+
type: "git",
|
|
11144
|
+
url: "https://github.com/prisma/prisma.git",
|
|
11145
|
+
directory: "packages/internals"
|
|
11146
|
+
},
|
|
11147
|
+
homepage: "https://www.prisma.io",
|
|
11148
|
+
author: "Tim Suchanek <suchanek@prisma.io>",
|
|
11149
|
+
bugs: "https://github.com/prisma/prisma/issues",
|
|
11150
|
+
license: "Apache-2.0",
|
|
11151
|
+
scripts: {
|
|
11152
|
+
dev: "DEV=true tsx helpers/build.ts",
|
|
11153
|
+
build: "tsx helpers/build.ts",
|
|
11154
|
+
test: "dotenv -e ../../.db.env -- jest --silent",
|
|
11155
|
+
prepublishOnly: "pnpm run build"
|
|
11156
|
+
},
|
|
11157
|
+
files: [
|
|
11158
|
+
"README.md",
|
|
11159
|
+
"dist",
|
|
11160
|
+
"!**/libquery_engine*",
|
|
11161
|
+
"!dist/get-generators/engines/*",
|
|
11162
|
+
"scripts"
|
|
11163
|
+
],
|
|
11164
|
+
devDependencies: {
|
|
11165
|
+
"@antfu/ni": "0.21.12",
|
|
11166
|
+
"@babel/helper-validator-identifier": "7.24.7",
|
|
11167
|
+
"@opentelemetry/api": "1.9.0",
|
|
11168
|
+
"@swc/core": "1.2.204",
|
|
11169
|
+
"@swc/jest": "0.2.37",
|
|
11170
|
+
"@types/babel__helper-validator-identifier": "7.15.2",
|
|
11171
|
+
"@types/jest": "29.5.14",
|
|
11172
|
+
"@types/node": "18.19.31",
|
|
11173
|
+
"@types/resolve": "1.20.6",
|
|
11174
|
+
archiver: "6.0.2",
|
|
11175
|
+
"checkpoint-client": "1.1.33",
|
|
11176
|
+
"cli-truncate": "2.1.0",
|
|
11177
|
+
dotenv: "16.4.7",
|
|
11178
|
+
esbuild: "0.24.2",
|
|
11179
|
+
"escape-string-regexp": "4.0.0",
|
|
11180
|
+
execa: "5.1.1",
|
|
11181
|
+
"fast-glob": "3.3.3",
|
|
11182
|
+
"find-up": "5.0.0",
|
|
11183
|
+
"fp-ts": "2.16.9",
|
|
11184
|
+
"fs-extra": "11.1.1",
|
|
11185
|
+
"fs-jetpack": "5.1.0",
|
|
11186
|
+
"global-dirs": "4.0.0",
|
|
11187
|
+
globby: "11.1.0",
|
|
11188
|
+
"identifier-regex": "1.0.0",
|
|
11189
|
+
"indent-string": "4.0.0",
|
|
11190
|
+
"is-windows": "1.0.2",
|
|
11191
|
+
"is-wsl": "3.1.0",
|
|
11192
|
+
jest: "29.7.0",
|
|
11193
|
+
"jest-junit": "16.0.0",
|
|
11194
|
+
kleur: "4.1.5",
|
|
11195
|
+
"mock-stdin": "1.0.0",
|
|
11196
|
+
"new-github-issue-url": "0.2.1",
|
|
11197
|
+
"node-fetch": "3.3.2",
|
|
11198
|
+
"npm-packlist": "5.1.3",
|
|
11199
|
+
open: "7.4.2",
|
|
11200
|
+
"p-map": "4.0.0",
|
|
11201
|
+
"read-package-up": "11.0.0",
|
|
11202
|
+
"replace-string": "3.1.0",
|
|
11203
|
+
resolve: "1.22.10",
|
|
11204
|
+
"string-width": "4.2.3",
|
|
11205
|
+
"strip-ansi": "6.0.1",
|
|
11206
|
+
"strip-indent": "3.0.0",
|
|
11207
|
+
"temp-dir": "2.0.0",
|
|
11208
|
+
tempy: "1.0.1",
|
|
11209
|
+
"terminal-link": "2.1.1",
|
|
11210
|
+
tmp: "0.2.3",
|
|
11211
|
+
"ts-node": "10.9.2",
|
|
11212
|
+
"ts-pattern": "5.6.2",
|
|
11213
|
+
"ts-toolbelt": "9.6.0",
|
|
11214
|
+
typescript: "5.4.5",
|
|
11215
|
+
yarn: "1.22.22"
|
|
11216
|
+
},
|
|
11217
|
+
dependencies: {
|
|
11218
|
+
"@prisma/config": "workspace:*",
|
|
11219
|
+
"@prisma/debug": "workspace:*",
|
|
11220
|
+
"@prisma/engines": "workspace:*",
|
|
11221
|
+
"@prisma/fetch-engine": "workspace:*",
|
|
11222
|
+
"@prisma/generator-helper": "workspace:*",
|
|
11223
|
+
"@prisma/get-platform": "workspace:*",
|
|
11224
|
+
"@prisma/prisma-schema-wasm": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d",
|
|
11225
|
+
"@prisma/schema-files-loader": "workspace:*",
|
|
11226
|
+
arg: "5.0.2",
|
|
11227
|
+
prompts: "2.4.2"
|
|
11228
|
+
},
|
|
11229
|
+
peerDependencies: {
|
|
11230
|
+
typescript: ">=5.1.0"
|
|
11231
|
+
},
|
|
11232
|
+
peerDependenciesMeta: {
|
|
11233
|
+
typescript: {
|
|
11234
|
+
optional: true
|
|
11235
|
+
}
|
|
11236
|
+
},
|
|
11237
|
+
sideEffects: false
|
|
11303
11238
|
};
|
|
11304
11239
|
}
|
|
11305
11240
|
});
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11241
|
+
var import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
|
|
11242
|
+
var import_schema_files_loader = (0, import_chunk_WWAWV7DQ.__toESM)(require_dist());
|
|
11243
|
+
var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
11244
|
+
async function findUp(name, {
|
|
11245
|
+
cwd = import_node_process.default.cwd(),
|
|
11246
|
+
type = "file",
|
|
11247
|
+
stopAt
|
|
11248
|
+
} = {}) {
|
|
11249
|
+
let directory = import_node_path2.default.resolve(toPath(cwd) ?? "");
|
|
11250
|
+
const { root } = import_node_path2.default.parse(directory);
|
|
11251
|
+
stopAt = import_node_path2.default.resolve(directory, toPath(stopAt ?? root));
|
|
11252
|
+
while (directory && directory !== stopAt && directory !== root) {
|
|
11253
|
+
const filePath = import_node_path2.default.isAbsolute(name) ? name : import_node_path2.default.join(directory, name);
|
|
11254
|
+
try {
|
|
11255
|
+
const stats = await import_promises.default.stat(filePath);
|
|
11256
|
+
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) {
|
|
11257
|
+
return filePath;
|
|
11258
|
+
}
|
|
11259
|
+
} catch {
|
|
11260
|
+
}
|
|
11261
|
+
directory = import_node_path2.default.dirname(directory);
|
|
11310
11262
|
}
|
|
11311
|
-
return {
|
|
11312
|
-
packageJson: await readPackage({ ...options, cwd: import_node_path3.default.dirname(filePath) }),
|
|
11313
|
-
path: filePath
|
|
11314
|
-
};
|
|
11315
11263
|
}
|
|
11316
|
-
var
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11264
|
+
var import_code_frame = (0, import_chunk_WWAWV7DQ.__toESM)(require_lib4(), 1);
|
|
11265
|
+
var safeLastIndexOf = (string, searchString, index) => index < 0 ? -1 : string.lastIndexOf(searchString, index);
|
|
11266
|
+
function getPosition(text, textIndex) {
|
|
11267
|
+
const lineBreakBefore = safeLastIndexOf(text, "\n", textIndex - 1);
|
|
11268
|
+
const column = textIndex - lineBreakBefore - 1;
|
|
11269
|
+
let line = 0;
|
|
11270
|
+
for (let index = lineBreakBefore; index >= 0; index = safeLastIndexOf(text, "\n", index - 1)) {
|
|
11271
|
+
line++;
|
|
11321
11272
|
}
|
|
11322
|
-
}
|
|
11323
|
-
|
|
11324
|
-
|
|
11273
|
+
return { line, column };
|
|
11274
|
+
}
|
|
11275
|
+
function indexToLineColumn(text, textIndex, { oneBased = false } = {}) {
|
|
11276
|
+
if (textIndex < 0 || textIndex >= text.length && text.length > 0) {
|
|
11277
|
+
throw new RangeError("Index out of bounds");
|
|
11278
|
+
}
|
|
11279
|
+
const position = getPosition(text, textIndex);
|
|
11280
|
+
return oneBased ? { line: position.line + 1, column: position.column + 1 } : position;
|
|
11281
|
+
}
|
|
11282
|
+
var getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`;
|
|
11283
|
+
var _message;
|
|
11284
|
+
var _JSONError = class _JSONError2 extends Error {
|
|
11285
|
+
constructor(message) {
|
|
11286
|
+
super();
|
|
11287
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "name", "JSONError");
|
|
11288
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "fileName");
|
|
11289
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "codeFrame");
|
|
11290
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "rawCodeFrame");
|
|
11291
|
+
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _message);
|
|
11292
|
+
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _message, message);
|
|
11293
|
+
Error.captureStackTrace?.(this, _JSONError2);
|
|
11294
|
+
}
|
|
11295
|
+
get message() {
|
|
11296
|
+
const { fileName, codeFrame } = this;
|
|
11297
|
+
return `${(0, import_chunk_WWAWV7DQ.__privateGet)(this, _message)}${fileName ? ` in ${fileName}` : ""}${codeFrame ? `
|
|
11298
|
+
|
|
11299
|
+
${codeFrame}
|
|
11300
|
+
` : ""}`;
|
|
11301
|
+
}
|
|
11302
|
+
set message(message) {
|
|
11303
|
+
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _message, message);
|
|
11304
|
+
}
|
|
11305
|
+
};
|
|
11306
|
+
_message = /* @__PURE__ */ new WeakMap();
|
|
11307
|
+
var JSONError = _JSONError;
|
|
11308
|
+
var generateCodeFrame = (string, location, highlightCode = true) => (0, import_code_frame.codeFrameColumns)(string, { start: location }, { highlightCode });
|
|
11309
|
+
var getErrorLocation = (string, message) => {
|
|
11310
|
+
const match = message.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);
|
|
11311
|
+
if (!match) {
|
|
11312
|
+
return;
|
|
11313
|
+
}
|
|
11314
|
+
let { index, line, column } = match.groups;
|
|
11315
|
+
if (line && column) {
|
|
11316
|
+
return { line: Number(line), column: Number(column) };
|
|
11317
|
+
}
|
|
11318
|
+
index = Number(index);
|
|
11319
|
+
if (index === string.length) {
|
|
11320
|
+
const { line: line2, column: column2 } = indexToLineColumn(string, string.length - 1, { oneBased: true });
|
|
11321
|
+
return { line: line2, column: column2 + 1 };
|
|
11322
|
+
}
|
|
11323
|
+
return indexToLineColumn(string, index, { oneBased: true });
|
|
11324
|
+
};
|
|
11325
|
+
var addCodePointToUnexpectedToken = (message) => message.replace(
|
|
11326
|
+
// TODO[engine:node@>=20]: The token always quoted after Node.js 20
|
|
11327
|
+
/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,
|
|
11328
|
+
(_, _quote, token) => `"${token}"(${getCodePoint(token)})`
|
|
11329
|
+
);
|
|
11330
|
+
function parseJson(string, reviver, fileName) {
|
|
11331
|
+
if (typeof reviver === "string") {
|
|
11332
|
+
fileName = reviver;
|
|
11333
|
+
reviver = void 0;
|
|
11334
|
+
}
|
|
11335
|
+
let message;
|
|
11336
|
+
try {
|
|
11337
|
+
return JSON.parse(string, reviver);
|
|
11338
|
+
} catch (error) {
|
|
11339
|
+
message = error.message;
|
|
11340
|
+
}
|
|
11341
|
+
let location;
|
|
11342
|
+
if (string) {
|
|
11343
|
+
location = getErrorLocation(string, message);
|
|
11344
|
+
message = addCodePointToUnexpectedToken(message);
|
|
11345
|
+
} else {
|
|
11346
|
+
message += " while parsing empty string";
|
|
11347
|
+
}
|
|
11348
|
+
const jsonError = new JSONError(message);
|
|
11349
|
+
jsonError.fileName = fileName;
|
|
11350
|
+
if (location) {
|
|
11351
|
+
jsonError.codeFrame = generateCodeFrame(string, location);
|
|
11352
|
+
jsonError.rawCodeFrame = generateCodeFrame(
|
|
11353
|
+
string,
|
|
11354
|
+
location,
|
|
11355
|
+
/* highlightCode */
|
|
11356
|
+
false
|
|
11357
|
+
);
|
|
11358
|
+
}
|
|
11359
|
+
throw jsonError;
|
|
11360
|
+
}
|
|
11361
|
+
var import_normalize_package_data = (0, import_chunk_WWAWV7DQ.__toESM)(require_normalize(), 1);
|
|
11362
|
+
function toPath2(urlOrPath) {
|
|
11363
|
+
return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
11364
|
+
}
|
|
11365
|
+
var getPackagePath = (cwd) => import_node_path3.default.resolve(toPath2(cwd) ?? ".", "package.json");
|
|
11366
|
+
var _readPackage = (file, normalize) => {
|
|
11367
|
+
const json = typeof file === "string" ? parseJson(file) : file;
|
|
11368
|
+
if (normalize) {
|
|
11369
|
+
(0, import_normalize_package_data.default)(json);
|
|
11370
|
+
}
|
|
11371
|
+
return json;
|
|
11372
|
+
};
|
|
11373
|
+
async function readPackage({ cwd, normalize = true } = {}) {
|
|
11374
|
+
const packageFile = await import_promises2.default.readFile(getPackagePath(cwd), "utf8");
|
|
11375
|
+
return _readPackage(packageFile, normalize);
|
|
11376
|
+
}
|
|
11377
|
+
async function readPackageUp(options) {
|
|
11378
|
+
const filePath = await findUp("package.json", options);
|
|
11379
|
+
if (!filePath) {
|
|
11380
|
+
return;
|
|
11381
|
+
}
|
|
11382
|
+
return {
|
|
11383
|
+
packageJson: await readPackage({ ...options, cwd: import_node_path.default.dirname(filePath) }),
|
|
11384
|
+
path: filePath
|
|
11385
|
+
};
|
|
11386
|
+
}
|
|
11387
|
+
var __spreadArray = function(to, from, pack) {
|
|
11388
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
11389
|
+
if (ar || !(i in from)) {
|
|
11390
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
11391
|
+
ar[i] = from[i];
|
|
11392
|
+
}
|
|
11393
|
+
}
|
|
11394
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
11395
|
+
};
|
|
11396
|
+
function identity(a) {
|
|
11397
|
+
return a;
|
|
11325
11398
|
}
|
|
11326
11399
|
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
11327
11400
|
switch (arguments.length) {
|
|
@@ -11352,53 +11425,32 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
11352
11425
|
}
|
|
11353
11426
|
}
|
|
11354
11427
|
}
|
|
11355
|
-
var
|
|
11356
|
-
var
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
11367
|
-
};
|
|
11368
|
-
dual = function(arity, body) {
|
|
11369
|
-
var isDataFirst = typeof arity === "number" ? function(args) {
|
|
11370
|
-
return args.length >= arity;
|
|
11371
|
-
} : arity;
|
|
11372
|
-
return function() {
|
|
11373
|
-
var args = Array.from(arguments);
|
|
11374
|
-
if (isDataFirst(arguments)) {
|
|
11375
|
-
return body.apply(this, args);
|
|
11376
|
-
}
|
|
11377
|
-
return function(self) {
|
|
11378
|
-
return body.apply(void 0, __spreadArray([self], args, false));
|
|
11379
|
-
};
|
|
11380
|
-
};
|
|
11428
|
+
var dual = function(arity, body) {
|
|
11429
|
+
var isDataFirst = typeof arity === "number" ? function(args) {
|
|
11430
|
+
return args.length >= arity;
|
|
11431
|
+
} : arity;
|
|
11432
|
+
return function() {
|
|
11433
|
+
var args = Array.from(arguments);
|
|
11434
|
+
if (isDataFirst(arguments)) {
|
|
11435
|
+
return body.apply(this, args);
|
|
11436
|
+
}
|
|
11437
|
+
return function(self) {
|
|
11438
|
+
return body.apply(void 0, __spreadArray([self], args, false));
|
|
11381
11439
|
};
|
|
11382
|
-
}
|
|
11383
|
-
}
|
|
11384
|
-
var isLeft
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
};
|
|
11397
|
-
right = function(a) {
|
|
11398
|
-
return { _tag: "Right", right: a };
|
|
11399
|
-
};
|
|
11400
|
-
}
|
|
11401
|
-
});
|
|
11440
|
+
};
|
|
11441
|
+
};
|
|
11442
|
+
var isLeft = function(ma) {
|
|
11443
|
+
return ma._tag === "Left";
|
|
11444
|
+
};
|
|
11445
|
+
var isRight = function(ma) {
|
|
11446
|
+
return ma._tag === "Right";
|
|
11447
|
+
};
|
|
11448
|
+
var left = function(e) {
|
|
11449
|
+
return { _tag: "Left", left: e };
|
|
11450
|
+
};
|
|
11451
|
+
var right = function(a) {
|
|
11452
|
+
return { _tag: "Right", right: a };
|
|
11453
|
+
};
|
|
11402
11454
|
function as(F) {
|
|
11403
11455
|
return function(self, b) {
|
|
11404
11456
|
return F.map(self, function() {
|
|
@@ -11412,11 +11464,6 @@ function asUnit(F) {
|
|
|
11412
11464
|
return asM(self, void 0);
|
|
11413
11465
|
};
|
|
11414
11466
|
}
|
|
11415
|
-
var init_Functor = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
11416
|
-
"../../node_modules/.pnpm/fp-ts@2.16.9/node_modules/fp-ts/es6/Functor.js"() {
|
|
11417
|
-
"use strict";
|
|
11418
|
-
}
|
|
11419
|
-
});
|
|
11420
11467
|
function tap(M) {
|
|
11421
11468
|
return function(first, f) {
|
|
11422
11469
|
return M.chain(first, function(a) {
|
|
@@ -11426,79 +11473,78 @@ function tap(M) {
|
|
|
11426
11473
|
});
|
|
11427
11474
|
};
|
|
11428
11475
|
}
|
|
11429
|
-
var
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11476
|
+
var left2 = left;
|
|
11477
|
+
var right2 = right;
|
|
11478
|
+
var flatMap = /* @__PURE__ */ dual(2, function(ma, f) {
|
|
11479
|
+
return isLeft2(ma) ? ma : f(ma.right);
|
|
11433
11480
|
});
|
|
11434
|
-
var
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
return function(ma) {
|
|
11485
|
-
return isLeft2(ma) ? onLeft(ma.left) : ma.right;
|
|
11486
|
-
};
|
|
11487
|
-
};
|
|
11488
|
-
tap2 = /* @__PURE__ */ dual(2, tap(Chain));
|
|
11489
|
-
_FromEither = {
|
|
11490
|
-
fromEither: FromEither.fromEither
|
|
11491
|
-
};
|
|
11492
|
-
tryCatch = function(f, onThrow) {
|
|
11493
|
-
try {
|
|
11494
|
-
return right2(f());
|
|
11495
|
-
} catch (e) {
|
|
11496
|
-
return left2(onThrow(e));
|
|
11497
|
-
}
|
|
11498
|
-
};
|
|
11499
|
-
chainW = flatMap;
|
|
11481
|
+
var _map = function(fa, f) {
|
|
11482
|
+
return pipe(fa, map(f));
|
|
11483
|
+
};
|
|
11484
|
+
var _ap = function(fab, fa) {
|
|
11485
|
+
return pipe(fab, ap(fa));
|
|
11486
|
+
};
|
|
11487
|
+
var URI = "Either";
|
|
11488
|
+
var map = function(f) {
|
|
11489
|
+
return function(fa) {
|
|
11490
|
+
return isLeft2(fa) ? fa : right2(f(fa.right));
|
|
11491
|
+
};
|
|
11492
|
+
};
|
|
11493
|
+
var Functor = {
|
|
11494
|
+
URI,
|
|
11495
|
+
map: _map
|
|
11496
|
+
};
|
|
11497
|
+
var as2 = dual(2, as(Functor));
|
|
11498
|
+
var asUnit2 = asUnit(Functor);
|
|
11499
|
+
var apW = function(fa) {
|
|
11500
|
+
return function(fab) {
|
|
11501
|
+
return isLeft2(fab) ? fab : isLeft2(fa) ? fa : right2(fab.right(fa.right));
|
|
11502
|
+
};
|
|
11503
|
+
};
|
|
11504
|
+
var ap = apW;
|
|
11505
|
+
var Chain = {
|
|
11506
|
+
URI,
|
|
11507
|
+
map: _map,
|
|
11508
|
+
ap: _ap,
|
|
11509
|
+
chain: flatMap
|
|
11510
|
+
};
|
|
11511
|
+
var FromEither = {
|
|
11512
|
+
URI,
|
|
11513
|
+
fromEither: identity
|
|
11514
|
+
};
|
|
11515
|
+
var isLeft2 = isLeft;
|
|
11516
|
+
var isRight2 = isRight;
|
|
11517
|
+
var getOrElseW = function(onLeft) {
|
|
11518
|
+
return function(ma) {
|
|
11519
|
+
return isLeft2(ma) ? onLeft(ma.left) : ma.right;
|
|
11520
|
+
};
|
|
11521
|
+
};
|
|
11522
|
+
var tap2 = /* @__PURE__ */ dual(2, tap(Chain));
|
|
11523
|
+
var _FromEither = {
|
|
11524
|
+
fromEither: FromEither.fromEither
|
|
11525
|
+
};
|
|
11526
|
+
var tryCatch = function(f, onThrow) {
|
|
11527
|
+
try {
|
|
11528
|
+
return right2(f());
|
|
11529
|
+
} catch (e) {
|
|
11530
|
+
return left2(onThrow(e));
|
|
11500
11531
|
}
|
|
11501
|
-
}
|
|
11532
|
+
};
|
|
11533
|
+
var chainW = flatMap;
|
|
11534
|
+
var import_function3 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_MATFO4ZW.require_function)());
|
|
11535
|
+
var RustPanic = class extends Error {
|
|
11536
|
+
constructor(message, rustStack, request, area, schemaPath, schema, introspectionUrl) {
|
|
11537
|
+
super(message);
|
|
11538
|
+
this.__typename = "RustPanic";
|
|
11539
|
+
this.name = "RustPanic";
|
|
11540
|
+
this.rustStack = rustStack;
|
|
11541
|
+
this.request = request;
|
|
11542
|
+
this.area = area;
|
|
11543
|
+
this.schemaPath = schemaPath;
|
|
11544
|
+
this.schema = schema;
|
|
11545
|
+
this.introspectionUrl = introspectionUrl;
|
|
11546
|
+
}
|
|
11547
|
+
};
|
|
11502
11548
|
function isWasmPanic(error) {
|
|
11503
11549
|
return error.name === "RuntimeError";
|
|
11504
11550
|
}
|
|
@@ -11507,25 +11553,6 @@ function getWasmError(error) {
|
|
|
11507
11553
|
const stack = [message, ...(error.stack || "NO_BACKTRACE").split("\n").slice(1)].join("\n");
|
|
11508
11554
|
return { message, stack };
|
|
11509
11555
|
}
|
|
11510
|
-
var RustPanic;
|
|
11511
|
-
var init_panic = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
11512
|
-
"../internals/src/panic.ts"() {
|
|
11513
|
-
"use strict";
|
|
11514
|
-
RustPanic = class extends Error {
|
|
11515
|
-
constructor(message, rustStack, request, area, schemaPath, schema, introspectionUrl) {
|
|
11516
|
-
super(message);
|
|
11517
|
-
this.__typename = "RustPanic";
|
|
11518
|
-
this.name = "RustPanic";
|
|
11519
|
-
this.rustStack = rustStack;
|
|
11520
|
-
this.request = request;
|
|
11521
|
-
this.area = area;
|
|
11522
|
-
this.schemaPath = schemaPath;
|
|
11523
|
-
this.schema = schema;
|
|
11524
|
-
this.introspectionUrl = introspectionUrl;
|
|
11525
|
-
}
|
|
11526
|
-
};
|
|
11527
|
-
}
|
|
11528
|
-
});
|
|
11529
11556
|
function toMultipleSchemas(input) {
|
|
11530
11557
|
if (typeof input === "undefined") {
|
|
11531
11558
|
return void 0;
|
|
@@ -11535,146 +11562,21 @@ function toMultipleSchemas(input) {
|
|
|
11535
11562
|
}
|
|
11536
11563
|
return input;
|
|
11537
11564
|
}
|
|
11538
|
-
var
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
}
|
|
11542
|
-
});
|
|
11543
|
-
var WasmPanicRegistry;
|
|
11544
|
-
var init_WasmPanicRegistry = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
11545
|
-
"../internals/src/WasmPanicRegistry.ts"() {
|
|
11546
|
-
"use strict";
|
|
11547
|
-
WasmPanicRegistry = class {
|
|
11548
|
-
constructor() {
|
|
11549
|
-
this.message = "";
|
|
11550
|
-
}
|
|
11551
|
-
get() {
|
|
11552
|
-
return `${this.message}`;
|
|
11553
|
-
}
|
|
11554
|
-
// Don't use this method directly, it's only used by the Wasm panic hook in @prisma/prisma-schema-wasm.
|
|
11555
|
-
set_message(value) {
|
|
11556
|
-
this.message = `RuntimeError: ${value}`;
|
|
11557
|
-
}
|
|
11558
|
-
};
|
|
11565
|
+
var WasmPanicRegistry = class {
|
|
11566
|
+
constructor() {
|
|
11567
|
+
this.message = "";
|
|
11559
11568
|
}
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
"../internals/package.json"(exports, module2) {
|
|
11563
|
-
module2.exports = {
|
|
11564
|
-
name: "@prisma/internals",
|
|
11565
|
-
version: "6.5.0-dev.1",
|
|
11566
|
-
description: "This package is intended for Prisma's internal use",
|
|
11567
|
-
main: "dist/index.js",
|
|
11568
|
-
types: "dist/index.d.ts",
|
|
11569
|
-
repository: {
|
|
11570
|
-
type: "git",
|
|
11571
|
-
url: "https://github.com/prisma/prisma.git",
|
|
11572
|
-
directory: "packages/internals"
|
|
11573
|
-
},
|
|
11574
|
-
homepage: "https://www.prisma.io",
|
|
11575
|
-
author: "Tim Suchanek <suchanek@prisma.io>",
|
|
11576
|
-
bugs: "https://github.com/prisma/prisma/issues",
|
|
11577
|
-
license: "Apache-2.0",
|
|
11578
|
-
scripts: {
|
|
11579
|
-
dev: "DEV=true tsx helpers/build.ts",
|
|
11580
|
-
build: "tsx helpers/build.ts",
|
|
11581
|
-
test: "dotenv -e ../../.db.env -- jest --silent",
|
|
11582
|
-
prepublishOnly: "pnpm run build"
|
|
11583
|
-
},
|
|
11584
|
-
files: [
|
|
11585
|
-
"README.md",
|
|
11586
|
-
"dist",
|
|
11587
|
-
"!**/libquery_engine*",
|
|
11588
|
-
"!dist/get-generators/engines/*",
|
|
11589
|
-
"scripts"
|
|
11590
|
-
],
|
|
11591
|
-
devDependencies: {
|
|
11592
|
-
"@antfu/ni": "0.21.12",
|
|
11593
|
-
"@babel/helper-validator-identifier": "7.24.7",
|
|
11594
|
-
"@opentelemetry/api": "1.9.0",
|
|
11595
|
-
"@swc/core": "1.2.204",
|
|
11596
|
-
"@swc/jest": "0.2.37",
|
|
11597
|
-
"@types/babel__helper-validator-identifier": "7.15.2",
|
|
11598
|
-
"@types/jest": "29.5.14",
|
|
11599
|
-
"@types/node": "18.19.31",
|
|
11600
|
-
"@types/resolve": "1.20.6",
|
|
11601
|
-
archiver: "6.0.2",
|
|
11602
|
-
"checkpoint-client": "1.1.33",
|
|
11603
|
-
"cli-truncate": "2.1.0",
|
|
11604
|
-
dotenv: "16.4.7",
|
|
11605
|
-
esbuild: "0.24.2",
|
|
11606
|
-
"escape-string-regexp": "4.0.0",
|
|
11607
|
-
execa: "5.1.1",
|
|
11608
|
-
"fast-glob": "3.3.3",
|
|
11609
|
-
"find-up": "5.0.0",
|
|
11610
|
-
"fp-ts": "2.16.9",
|
|
11611
|
-
"fs-extra": "11.1.1",
|
|
11612
|
-
"fs-jetpack": "5.1.0",
|
|
11613
|
-
"global-dirs": "4.0.0",
|
|
11614
|
-
globby: "11.1.0",
|
|
11615
|
-
"identifier-regex": "1.0.0",
|
|
11616
|
-
"indent-string": "4.0.0",
|
|
11617
|
-
"is-windows": "1.0.2",
|
|
11618
|
-
"is-wsl": "3.1.0",
|
|
11619
|
-
jest: "29.7.0",
|
|
11620
|
-
"jest-junit": "16.0.0",
|
|
11621
|
-
kleur: "4.1.5",
|
|
11622
|
-
"mock-stdin": "1.0.0",
|
|
11623
|
-
"new-github-issue-url": "0.2.1",
|
|
11624
|
-
"node-fetch": "3.3.2",
|
|
11625
|
-
"npm-packlist": "5.1.3",
|
|
11626
|
-
open: "7.4.2",
|
|
11627
|
-
"p-map": "4.0.0",
|
|
11628
|
-
"read-package-up": "11.0.0",
|
|
11629
|
-
"replace-string": "3.1.0",
|
|
11630
|
-
resolve: "1.22.10",
|
|
11631
|
-
"string-width": "4.2.3",
|
|
11632
|
-
"strip-ansi": "6.0.1",
|
|
11633
|
-
"strip-indent": "3.0.0",
|
|
11634
|
-
"temp-dir": "2.0.0",
|
|
11635
|
-
tempy: "1.0.1",
|
|
11636
|
-
"terminal-link": "2.1.1",
|
|
11637
|
-
tmp: "0.2.3",
|
|
11638
|
-
"ts-node": "10.9.2",
|
|
11639
|
-
"ts-pattern": "5.6.2",
|
|
11640
|
-
"ts-toolbelt": "9.6.0",
|
|
11641
|
-
typescript: "5.4.5",
|
|
11642
|
-
yarn: "1.22.22"
|
|
11643
|
-
},
|
|
11644
|
-
dependencies: {
|
|
11645
|
-
"@prisma/config": "workspace:*",
|
|
11646
|
-
"@prisma/debug": "workspace:*",
|
|
11647
|
-
"@prisma/engines": "workspace:*",
|
|
11648
|
-
"@prisma/fetch-engine": "workspace:*",
|
|
11649
|
-
"@prisma/generator-helper": "workspace:*",
|
|
11650
|
-
"@prisma/get-platform": "workspace:*",
|
|
11651
|
-
"@prisma/prisma-schema-wasm": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d",
|
|
11652
|
-
"@prisma/schema-files-loader": "workspace:*",
|
|
11653
|
-
arg: "5.0.2",
|
|
11654
|
-
prompts: "2.4.2"
|
|
11655
|
-
},
|
|
11656
|
-
peerDependencies: {
|
|
11657
|
-
typescript: ">=5.1.0"
|
|
11658
|
-
},
|
|
11659
|
-
peerDependenciesMeta: {
|
|
11660
|
-
typescript: {
|
|
11661
|
-
optional: true
|
|
11662
|
-
}
|
|
11663
|
-
},
|
|
11664
|
-
sideEffects: false
|
|
11665
|
-
};
|
|
11569
|
+
get() {
|
|
11570
|
+
return `${this.message}`;
|
|
11666
11571
|
}
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
"../internals/src/wasm.ts"() {
|
|
11671
|
-
"use strict";
|
|
11672
|
-
init_WasmPanicRegistry();
|
|
11673
|
-
({ dependencies } = require_package());
|
|
11674
|
-
prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
|
11675
|
-
globalThis.PRISMA_WASM_PANIC_REGISTRY = new WasmPanicRegistry();
|
|
11572
|
+
// Don't use this method directly, it's only used by the Wasm panic hook in @prisma/prisma-schema-wasm.
|
|
11573
|
+
set_message(value) {
|
|
11574
|
+
this.message = `RuntimeError: ${value}`;
|
|
11676
11575
|
}
|
|
11677
|
-
}
|
|
11576
|
+
};
|
|
11577
|
+
var { dependencies } = require_package();
|
|
11578
|
+
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
|
11579
|
+
globalThis.PRISMA_WASM_PANIC_REGISTRY = new WasmPanicRegistry();
|
|
11678
11580
|
function slugify(str) {
|
|
11679
11581
|
return str.toString().toLowerCase().replace(/\s+/g, "-");
|
|
11680
11582
|
}
|
|
@@ -11689,42 +11591,24 @@ function formatTable(rows, options = { json: false }) {
|
|
|
11689
11591
|
const maxPad = rows.reduce((acc, curr) => Math.max(acc, curr[0].length), 0);
|
|
11690
11592
|
return rows.map(([left3, right3]) => `${left3.padEnd(maxPad)} : ${right3}`).join("\n");
|
|
11691
11593
|
}
|
|
11692
|
-
var
|
|
11693
|
-
|
|
11694
|
-
"use strict";
|
|
11695
|
-
}
|
|
11696
|
-
});
|
|
11697
|
-
var packageJson, version;
|
|
11698
|
-
var init_getVersionFromPackageJson = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
11699
|
-
"../internals/src/utils/getVersionFromPackageJson.ts"() {
|
|
11700
|
-
"use strict";
|
|
11701
|
-
packageJson = require_package();
|
|
11702
|
-
version = packageJson.version;
|
|
11703
|
-
}
|
|
11704
|
-
});
|
|
11594
|
+
var packageJson = require_package();
|
|
11595
|
+
var version = packageJson.version;
|
|
11705
11596
|
function addVersionDetailsToErrorMessage(message) {
|
|
11706
11597
|
const rows = [["Prisma CLI Version", version]];
|
|
11707
11598
|
return `${message}
|
|
11708
11599
|
|
|
11709
11600
|
${formatTable(rows)}`;
|
|
11710
11601
|
}
|
|
11711
|
-
var
|
|
11712
|
-
"../internals/src/engine-commands/errorHelpers.ts"() {
|
|
11713
|
-
"use strict";
|
|
11714
|
-
init_formatTable();
|
|
11715
|
-
init_getVersionFromPackageJson();
|
|
11716
|
-
}
|
|
11717
|
-
});
|
|
11602
|
+
var import_function2 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_MATFO4ZW.require_function)());
|
|
11718
11603
|
function relativizePathInPSLError(error) {
|
|
11719
11604
|
return error.replaceAll(process.cwd() + import_node_path4.default.sep, "");
|
|
11720
11605
|
}
|
|
11721
|
-
var
|
|
11722
|
-
"
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
});
|
|
11606
|
+
var createDebugErrorType = (debug4, fnName) => ({ type, reason, error }) => {
|
|
11607
|
+
debug4(`error of type "${type}" in ${fnName}:
|
|
11608
|
+
`, { reason, error });
|
|
11609
|
+
};
|
|
11726
11610
|
function createSchemaValidationError(reason) {
|
|
11727
|
-
return `${(0,
|
|
11611
|
+
return `${(0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)("Prisma schema validation"))} - ${reason}`;
|
|
11728
11612
|
}
|
|
11729
11613
|
function parseQueryEngineError({ errorOutput, reason }) {
|
|
11730
11614
|
const actualError = (0, import_function2.pipe)(
|
|
@@ -11733,13 +11617,13 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
11733
11617
|
() => ({ _tag: "unparsed", message: errorOutput, reason })
|
|
11734
11618
|
),
|
|
11735
11619
|
map((errorOutputAsJSON) => {
|
|
11736
|
-
const defaultMessage = (0,
|
|
11737
|
-
const getConfigErrorInit = (0,
|
|
11620
|
+
const defaultMessage = (0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)(relativizePathInPSLError(errorOutputAsJSON.message)));
|
|
11621
|
+
const getConfigErrorInit = (0, import_chunk_MATFO4ZW.z)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
|
11738
11622
|
return {
|
|
11739
11623
|
reason: createSchemaValidationError(reason),
|
|
11740
11624
|
errorCode: eJSON.error_code
|
|
11741
11625
|
};
|
|
11742
|
-
}).with({ error_code:
|
|
11626
|
+
}).with({ error_code: import_chunk_MATFO4ZW.N.string }, (eJSON) => {
|
|
11743
11627
|
return {
|
|
11744
11628
|
reason,
|
|
11745
11629
|
errorCode: eJSON.error_code
|
|
@@ -11755,21 +11639,26 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
11755
11639
|
);
|
|
11756
11640
|
return actualError;
|
|
11757
11641
|
}
|
|
11758
|
-
var
|
|
11759
|
-
var
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11642
|
+
var debug = (0, import_debug3.default)("prisma:getConfig");
|
|
11643
|
+
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
|
11644
|
+
var GetConfigError = class extends Error {
|
|
11645
|
+
constructor(params) {
|
|
11646
|
+
const constructedErrorMessage = (0, import_chunk_MATFO4ZW.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
11647
|
+
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
11648
|
+
return `${reason}
|
|
11649
|
+
${errorCodeMessage}
|
|
11650
|
+
${message}`;
|
|
11651
|
+
}).with({ _tag: "unparsed" }, ({ message, reason }) => {
|
|
11652
|
+
const detailsHeader = (0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)("Details:"));
|
|
11653
|
+
return `${reason}
|
|
11654
|
+
${detailsHeader} ${message}`;
|
|
11655
|
+
}).exhaustive();
|
|
11656
|
+
const errorMessageWithContext = `${constructedErrorMessage}
|
|
11657
|
+
[Context: getConfig]`;
|
|
11658
|
+
super(addVersionDetailsToErrorMessage(errorMessageWithContext));
|
|
11659
|
+
this.name = "GetConfigError";
|
|
11771
11660
|
}
|
|
11772
|
-
}
|
|
11661
|
+
};
|
|
11773
11662
|
async function getConfig(options) {
|
|
11774
11663
|
const debugErrorType = createDebugErrorType(debug, "getConfigWasm");
|
|
11775
11664
|
debug(`Using getConfig Wasm`);
|
|
@@ -11828,7 +11717,7 @@ async function getConfig(options) {
|
|
|
11828
11717
|
}
|
|
11829
11718
|
return Promise.resolve(data);
|
|
11830
11719
|
}
|
|
11831
|
-
const error = (0,
|
|
11720
|
+
const error = (0, import_chunk_MATFO4ZW.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
|
11832
11721
|
debugErrorType(e);
|
|
11833
11722
|
if (isWasmPanic(e.error)) {
|
|
11834
11723
|
const { message, stack } = getWasmError(e.error);
|
|
@@ -11888,48 +11777,9 @@ function formatErrors(errors) {
|
|
|
11888
11777
|
return `${formattedErrors}
|
|
11889
11778
|
${errorCount}`;
|
|
11890
11779
|
}
|
|
11891
|
-
var
|
|
11892
|
-
var
|
|
11893
|
-
|
|
11894
|
-
"use strict";
|
|
11895
|
-
init_Either();
|
|
11896
|
-
import_function3 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_CQQQ436N.require_function)());
|
|
11897
|
-
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
11898
|
-
(0, import_chunk_CQQQ436N.init_dist)();
|
|
11899
|
-
init_panic();
|
|
11900
|
-
init_schemaFileInput();
|
|
11901
|
-
init_wasm();
|
|
11902
|
-
init_errorHelpers();
|
|
11903
|
-
init_queryEngineCommons();
|
|
11904
|
-
init_relativizePathInPSLError();
|
|
11905
|
-
debug = (0, import_debug.default)("prisma:getConfig");
|
|
11906
|
-
SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
|
11907
|
-
GetConfigError = class extends Error {
|
|
11908
|
-
constructor(params) {
|
|
11909
|
-
const constructedErrorMessage = (0, import_chunk_CQQQ436N.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
11910
|
-
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
11911
|
-
return `${reason}
|
|
11912
|
-
${errorCodeMessage}
|
|
11913
|
-
${message}`;
|
|
11914
|
-
}).with({ _tag: "unparsed" }, ({ message, reason }) => {
|
|
11915
|
-
const detailsHeader = (0, import_chunk_6TE2RIPN.red)((0, import_chunk_6TE2RIPN.bold)("Details:"));
|
|
11916
|
-
return `${reason}
|
|
11917
|
-
${detailsHeader} ${message}`;
|
|
11918
|
-
}).exhaustive();
|
|
11919
|
-
const errorMessageWithContext = `${constructedErrorMessage}
|
|
11920
|
-
[Context: getConfig]`;
|
|
11921
|
-
super(addVersionDetailsToErrorMessage(errorMessageWithContext));
|
|
11922
|
-
this.name = "GetConfigError";
|
|
11923
|
-
}
|
|
11924
|
-
};
|
|
11925
|
-
}
|
|
11926
|
-
});
|
|
11927
|
-
var init_engine_commands = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
11928
|
-
"../internals/src/engine-commands/index.ts"() {
|
|
11929
|
-
"use strict";
|
|
11930
|
-
init_getConfig();
|
|
11931
|
-
}
|
|
11932
|
-
});
|
|
11780
|
+
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
|
11781
|
+
var stat = (0, import_util.promisify)(import_fs.default.stat);
|
|
11782
|
+
var debug2 = (0, import_debug2.Debug)("prisma:getSchema");
|
|
11933
11783
|
async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
|
11934
11784
|
const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
|
|
11935
11785
|
if (result.ok) {
|
|
@@ -11947,7 +11797,7 @@ async function readSchemaFromSingleFile(schemaPath) {
|
|
|
11947
11797
|
const schemaTuple = [schemaPath, file];
|
|
11948
11798
|
return {
|
|
11949
11799
|
ok: true,
|
|
11950
|
-
schema: { schemaPath, schemaRootDir:
|
|
11800
|
+
schema: { schemaPath, schemaRootDir: import_path2.default.dirname(schemaPath), schemas: [schemaTuple] }
|
|
11951
11801
|
};
|
|
11952
11802
|
}
|
|
11953
11803
|
async function readSchemaFromDirectory(schemaPath) {
|
|
@@ -11988,10 +11838,10 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
|
|
|
11988
11838
|
}
|
|
11989
11839
|
async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
|
|
11990
11840
|
if (schemaPathFromArgs) {
|
|
11991
|
-
const absPath =
|
|
11841
|
+
const absPath = import_path2.default.resolve(cwd, schemaPathFromArgs);
|
|
11992
11842
|
const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
|
|
11993
11843
|
if (!customSchemaResult.ok) {
|
|
11994
|
-
const relPath =
|
|
11844
|
+
const relPath = import_path2.default.relative(cwd, absPath);
|
|
11995
11845
|
throw new Error(
|
|
11996
11846
|
`Could not load \`${argumentName}\` from provided path \`${relPath}\`: ${renderLookupError(
|
|
11997
11847
|
customSchemaResult.error
|
|
@@ -12032,7 +11882,7 @@ function renderLookupError(error) {
|
|
|
12032
11882
|
function renderDefaultLookupError(error, cwd) {
|
|
12033
11883
|
const parts = [
|
|
12034
11884
|
`Could not find Prisma Schema that is required for this command.`,
|
|
12035
|
-
`You can either provide it with ${(0,
|
|
11885
|
+
`You can either provide it with ${(0, import_chunk_SKRR5WT4.green)(
|
|
12036
11886
|
"`--schema`"
|
|
12037
11887
|
)} argument, set it as \`prisma.schema\` in your package.json or put it into the default location.`,
|
|
12038
11888
|
"Checked following paths:\n"
|
|
@@ -12041,7 +11891,7 @@ function renderDefaultLookupError(error, cwd) {
|
|
|
12041
11891
|
for (const failure of error.failures) {
|
|
12042
11892
|
const filePath = failure.rule.schemaPath.path;
|
|
12043
11893
|
if (!printedPaths.has(failure.rule.schemaPath.path)) {
|
|
12044
|
-
parts.push(`${
|
|
11894
|
+
parts.push(`${import_path2.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
|
12045
11895
|
printedPaths.add(filePath);
|
|
12046
11896
|
}
|
|
12047
11897
|
}
|
|
@@ -12093,20 +11943,20 @@ async function getSchemaFromPackageJson(cwd) {
|
|
|
12093
11943
|
const schemaPathFromPkgJson = prismaConfig.data.schema;
|
|
12094
11944
|
if (typeof schemaPathFromPkgJson !== "string") {
|
|
12095
11945
|
throw new Error(
|
|
12096
|
-
`Provided schema path \`${schemaPathFromPkgJson}\` from \`${
|
|
11946
|
+
`Provided schema path \`${schemaPathFromPkgJson}\` from \`${import_path2.default.relative(
|
|
12097
11947
|
cwd,
|
|
12098
11948
|
prismaConfig.packagePath
|
|
12099
11949
|
)}\` must be of type string`
|
|
12100
11950
|
);
|
|
12101
11951
|
}
|
|
12102
|
-
const absoluteSchemaPath =
|
|
11952
|
+
const absoluteSchemaPath = import_path2.default.isAbsolute(schemaPathFromPkgJson) ? schemaPathFromPkgJson : import_path2.default.resolve(import_path2.default.dirname(prismaConfig.packagePath), schemaPathFromPkgJson);
|
|
12103
11953
|
const lookupResult = await readSchemaFromFileOrDirectory(absoluteSchemaPath);
|
|
12104
11954
|
if (!lookupResult.ok) {
|
|
12105
11955
|
throw new Error(
|
|
12106
|
-
`Could not load schema from \`${
|
|
11956
|
+
`Could not load schema from \`${import_path2.default.relative(
|
|
12107
11957
|
cwd,
|
|
12108
11958
|
absoluteSchemaPath
|
|
12109
|
-
)}\` provided by "prisma.schema" config of \`${
|
|
11959
|
+
)}\` provided by "prisma.schema" config of \`${import_path2.default.relative(
|
|
12110
11960
|
cwd,
|
|
12111
11961
|
prismaConfig.packagePath
|
|
12112
11962
|
)}\`: ${renderLookupError(lookupResult.error)}`
|
|
@@ -12117,27 +11967,27 @@ async function getSchemaFromPackageJson(cwd) {
|
|
|
12117
11967
|
async function getDefaultSchema(cwd, failures = []) {
|
|
12118
11968
|
const schemaPrisma = {
|
|
12119
11969
|
schemaPath: {
|
|
12120
|
-
path:
|
|
11970
|
+
path: import_path2.default.join(cwd, "schema.prisma"),
|
|
12121
11971
|
kind: "file"
|
|
12122
11972
|
}
|
|
12123
11973
|
};
|
|
12124
11974
|
const prismaSchemaFile = {
|
|
12125
11975
|
schemaPath: {
|
|
12126
|
-
path:
|
|
11976
|
+
path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
|
|
12127
11977
|
kind: "file"
|
|
12128
11978
|
},
|
|
12129
11979
|
conflictsWith: {
|
|
12130
|
-
path:
|
|
11980
|
+
path: import_path2.default.join(cwd, "prisma", "schema"),
|
|
12131
11981
|
kind: "directory"
|
|
12132
11982
|
}
|
|
12133
11983
|
};
|
|
12134
11984
|
const prismaSchemaFolder = {
|
|
12135
11985
|
schemaPath: {
|
|
12136
|
-
path:
|
|
11986
|
+
path: import_path2.default.join(cwd, "prisma", "schema"),
|
|
12137
11987
|
kind: "directory"
|
|
12138
11988
|
},
|
|
12139
11989
|
conflictsWith: {
|
|
12140
|
-
path:
|
|
11990
|
+
path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
|
|
12141
11991
|
kind: "file"
|
|
12142
11992
|
}
|
|
12143
11993
|
};
|
|
@@ -12153,7 +12003,7 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
|
12153
12003
|
const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
|
|
12154
12004
|
if (conflictingSchema.ok) {
|
|
12155
12005
|
throw new Error(
|
|
12156
|
-
`Found Prisma Schemas at both \`${
|
|
12006
|
+
`Found Prisma Schemas at both \`${import_path2.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path2.default.relative(
|
|
12157
12007
|
cwd,
|
|
12158
12008
|
rule.conflictsWith.path
|
|
12159
12009
|
)}\`. Please remove one.`
|
|
@@ -12178,50 +12028,29 @@ async function loadSchemaFromDefaultLocation(lookupPath) {
|
|
|
12178
12028
|
return readSchemaFromDirectory(lookupPath.path);
|
|
12179
12029
|
}
|
|
12180
12030
|
}
|
|
12181
|
-
var
|
|
12182
|
-
var
|
|
12183
|
-
|
|
12184
|
-
"use strict";
|
|
12185
|
-
import_schema_files_loader = (0, import_chunk_WWAWV7DQ.__toESM)(require_dist());
|
|
12186
|
-
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
12187
|
-
init_read_package_up();
|
|
12188
|
-
init_engine_commands();
|
|
12189
|
-
readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
|
12190
|
-
stat = (0, import_util.promisify)(import_fs.default.stat);
|
|
12191
|
-
debug2 = (0, import_debug2.Debug)("prisma:getSchema");
|
|
12192
|
-
}
|
|
12193
|
-
});
|
|
12194
|
-
var import_fs_jetpack, debug3, helpOptions, _MigrateDiff, MigrateDiff;
|
|
12195
|
-
var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
12196
|
-
"src/commands/MigrateDiff.ts"() {
|
|
12197
|
-
import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
|
|
12198
|
-
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
12199
|
-
init_getSchema();
|
|
12200
|
-
(0, import_chunk_UVNSK22K.init_Migrate)();
|
|
12201
|
-
(0, import_chunk_TKAGMA5K.init_captureStdout)();
|
|
12202
|
-
debug3 = (0, import_debug3.default)("prisma:migrate:diff");
|
|
12203
|
-
helpOptions = (0, import_internals.format)(
|
|
12204
|
-
`${(0, import_chunk_6TE2RIPN.bold)("Usage")}
|
|
12031
|
+
var debug3 = (0, import_debug.default)("prisma:migrate:diff");
|
|
12032
|
+
var helpOptions = (0, import_internals.format)(
|
|
12033
|
+
`${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
12205
12034
|
|
|
12206
|
-
${(0,
|
|
12035
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff [options]
|
|
12207
12036
|
|
|
12208
|
-
${(0,
|
|
12037
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
12209
12038
|
|
|
12210
12039
|
-h, --help Display this help message
|
|
12211
12040
|
--config Custom path to your Prisma config file
|
|
12212
12041
|
-o, --output Writes to a file instead of stdout
|
|
12213
12042
|
|
|
12214
|
-
${(0,
|
|
12043
|
+
${(0, import_chunk_SKRR5WT4.italic)("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
|
|
12215
12044
|
--from-url A datasource URL
|
|
12216
12045
|
--to-url
|
|
12217
12046
|
|
|
12218
12047
|
--from-empty Flag to assume from or to is an empty datamodel
|
|
12219
12048
|
--to-empty
|
|
12220
12049
|
|
|
12221
|
-
--from-schema-datamodel Path to a Prisma schema file, uses the ${(0,
|
|
12050
|
+
--from-schema-datamodel Path to a Prisma schema file, uses the ${(0, import_chunk_SKRR5WT4.italic)("datamodel")} for the diff
|
|
12222
12051
|
--to-schema-datamodel
|
|
12223
12052
|
|
|
12224
|
-
--from-schema-datasource Path to a Prisma schema file, uses the ${(0,
|
|
12053
|
+
--from-schema-datasource Path to a Prisma schema file, uses the ${(0, import_chunk_SKRR5WT4.italic)("datasource url")} for the diff
|
|
12225
12054
|
--to-schema-datasource
|
|
12226
12055
|
|
|
12227
12056
|
--from-migrations Path to the Prisma Migrate migrations directory
|
|
@@ -12230,202 +12059,202 @@ ${(0, import_chunk_6TE2RIPN.italic)("From and To inputs (1 `--from-...` and 1 `-
|
|
|
12230
12059
|
--from-local-d1 Automatically locate the local Cloudflare D1 database
|
|
12231
12060
|
--to-local-d1
|
|
12232
12061
|
|
|
12233
|
-
${(0,
|
|
12062
|
+
${(0, import_chunk_SKRR5WT4.italic)("Shadow database (only required if using --from-migrations or --to-migrations):")}
|
|
12234
12063
|
--shadow-database-url URL for the shadow database
|
|
12235
12064
|
|
|
12236
|
-
${(0,
|
|
12065
|
+
${(0, import_chunk_SKRR5WT4.bold)("Flags")}
|
|
12237
12066
|
|
|
12238
12067
|
--script Render a SQL script to stdout instead of the default human readable summary (not supported on MongoDB)
|
|
12239
12068
|
--exit-code Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1.`
|
|
12069
|
+
);
|
|
12070
|
+
var _MigrateDiff = class _MigrateDiff2 {
|
|
12071
|
+
static new() {
|
|
12072
|
+
return new _MigrateDiff2();
|
|
12073
|
+
}
|
|
12074
|
+
async parse(argv, config) {
|
|
12075
|
+
const args = (0, import_internals.arg)(
|
|
12076
|
+
argv,
|
|
12077
|
+
{
|
|
12078
|
+
"--help": Boolean,
|
|
12079
|
+
"-h": "--help",
|
|
12080
|
+
"--output": String,
|
|
12081
|
+
"-o": "--output",
|
|
12082
|
+
// From
|
|
12083
|
+
"--from-empty": Boolean,
|
|
12084
|
+
"--from-schema-datasource": String,
|
|
12085
|
+
"--from-schema-datamodel": String,
|
|
12086
|
+
"--from-url": String,
|
|
12087
|
+
"--from-migrations": String,
|
|
12088
|
+
"--from-local-d1": Boolean,
|
|
12089
|
+
// To
|
|
12090
|
+
"--to-empty": Boolean,
|
|
12091
|
+
"--to-schema-datasource": String,
|
|
12092
|
+
"--to-schema-datamodel": String,
|
|
12093
|
+
"--to-url": String,
|
|
12094
|
+
"--to-migrations": String,
|
|
12095
|
+
"--to-local-d1": Boolean,
|
|
12096
|
+
// Others
|
|
12097
|
+
"--shadow-database-url": String,
|
|
12098
|
+
"--script": Boolean,
|
|
12099
|
+
"--exit-code": Boolean,
|
|
12100
|
+
"--telemetry-information": String,
|
|
12101
|
+
"--config": String
|
|
12102
|
+
},
|
|
12103
|
+
false
|
|
12240
12104
|
);
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12105
|
+
if ((0, import_internals.isError)(args)) {
|
|
12106
|
+
return this.help(args.message);
|
|
12107
|
+
}
|
|
12108
|
+
await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, config.schema, false);
|
|
12109
|
+
if (args["--help"]) {
|
|
12110
|
+
return this.help();
|
|
12111
|
+
}
|
|
12112
|
+
const numberOfFromParameterProvided = Number(Boolean(args["--from-empty"])) + Number(Boolean(args["--from-schema-datasource"])) + Number(Boolean(args["--from-schema-datamodel"])) + Number(Boolean(args["--from-url"])) + Number(Boolean(args["--from-migrations"])) + Number(Boolean(args["--from-local-d1"]));
|
|
12113
|
+
const numberOfToParameterProvided = Number(Boolean(args["--to-empty"])) + Number(Boolean(args["--to-schema-datasource"])) + Number(Boolean(args["--to-schema-datamodel"])) + Number(Boolean(args["--to-url"])) + Number(Boolean(args["--to-migrations"])) + Number(Boolean(args["--to-local-d1"]));
|
|
12114
|
+
if (numberOfFromParameterProvided !== 1 || numberOfToParameterProvided !== 1) {
|
|
12115
|
+
const errorMessages = [];
|
|
12116
|
+
if (numberOfFromParameterProvided !== 1) {
|
|
12117
|
+
errorMessages.push(`${numberOfFromParameterProvided} \`--from-...\` parameter(s) provided. 1 must be provided.`);
|
|
12244
12118
|
}
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
argv,
|
|
12248
|
-
{
|
|
12249
|
-
"--help": Boolean,
|
|
12250
|
-
"-h": "--help",
|
|
12251
|
-
"--output": String,
|
|
12252
|
-
"-o": "--output",
|
|
12253
|
-
// From
|
|
12254
|
-
"--from-empty": Boolean,
|
|
12255
|
-
"--from-schema-datasource": String,
|
|
12256
|
-
"--from-schema-datamodel": String,
|
|
12257
|
-
"--from-url": String,
|
|
12258
|
-
"--from-migrations": String,
|
|
12259
|
-
"--from-local-d1": Boolean,
|
|
12260
|
-
// To
|
|
12261
|
-
"--to-empty": Boolean,
|
|
12262
|
-
"--to-schema-datasource": String,
|
|
12263
|
-
"--to-schema-datamodel": String,
|
|
12264
|
-
"--to-url": String,
|
|
12265
|
-
"--to-migrations": String,
|
|
12266
|
-
"--to-local-d1": Boolean,
|
|
12267
|
-
// Others
|
|
12268
|
-
"--shadow-database-url": String,
|
|
12269
|
-
"--script": Boolean,
|
|
12270
|
-
"--exit-code": Boolean,
|
|
12271
|
-
"--telemetry-information": String,
|
|
12272
|
-
"--config": String
|
|
12273
|
-
},
|
|
12274
|
-
false
|
|
12275
|
-
);
|
|
12276
|
-
if ((0, import_internals.isError)(args)) {
|
|
12277
|
-
return this.help(args.message);
|
|
12278
|
-
}
|
|
12279
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, config.schema, false);
|
|
12280
|
-
if (args["--help"]) {
|
|
12281
|
-
return this.help();
|
|
12282
|
-
}
|
|
12283
|
-
const numberOfFromParameterProvided = Number(Boolean(args["--from-empty"])) + Number(Boolean(args["--from-schema-datasource"])) + Number(Boolean(args["--from-schema-datamodel"])) + Number(Boolean(args["--from-url"])) + Number(Boolean(args["--from-migrations"])) + Number(Boolean(args["--from-local-d1"]));
|
|
12284
|
-
const numberOfToParameterProvided = Number(Boolean(args["--to-empty"])) + Number(Boolean(args["--to-schema-datasource"])) + Number(Boolean(args["--to-schema-datamodel"])) + Number(Boolean(args["--to-url"])) + Number(Boolean(args["--to-migrations"])) + Number(Boolean(args["--to-local-d1"]));
|
|
12285
|
-
if (numberOfFromParameterProvided !== 1 || numberOfToParameterProvided !== 1) {
|
|
12286
|
-
const errorMessages = [];
|
|
12287
|
-
if (numberOfFromParameterProvided !== 1) {
|
|
12288
|
-
errorMessages.push(`${numberOfFromParameterProvided} \`--from-...\` parameter(s) provided. 1 must be provided.`);
|
|
12289
|
-
}
|
|
12290
|
-
if (numberOfToParameterProvided !== 1) {
|
|
12291
|
-
errorMessages.push(`${numberOfToParameterProvided} \`--to-...\` parameter(s) provided. 1 must be provided.`);
|
|
12292
|
-
}
|
|
12293
|
-
return this.help(`${errorMessages.join("\n")}`);
|
|
12294
|
-
}
|
|
12295
|
-
if (args["--shadow-database-url"] && (args["--from-local-d1"] || args["--to-local-d1"])) {
|
|
12296
|
-
return this.help(
|
|
12297
|
-
`The flag \`--shadow-database-url\` is not compatible with \`--from-local-d1\` or \`--to-local-d1\`.`
|
|
12298
|
-
);
|
|
12299
|
-
}
|
|
12300
|
-
let from;
|
|
12301
|
-
if (args["--from-empty"]) {
|
|
12302
|
-
from = {
|
|
12303
|
-
tag: "empty"
|
|
12304
|
-
};
|
|
12305
|
-
} else if (args["--from-schema-datasource"]) {
|
|
12306
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
|
|
12307
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), config.schema, {
|
|
12308
|
-
argumentName: "--from-schema-datasource"
|
|
12309
|
-
});
|
|
12310
|
-
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12311
|
-
from = {
|
|
12312
|
-
tag: "schemaDatasource",
|
|
12313
|
-
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12314
|
-
};
|
|
12315
|
-
} else if (args["--from-schema-datamodel"]) {
|
|
12316
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), config.schema, {
|
|
12317
|
-
argumentName: "--from-schema-datamodel"
|
|
12318
|
-
});
|
|
12319
|
-
from = {
|
|
12320
|
-
tag: "schemaDatamodel",
|
|
12321
|
-
...(0, import_internals.toSchemasContainer)(schema.schemas)
|
|
12322
|
-
};
|
|
12323
|
-
} else if (args["--from-url"]) {
|
|
12324
|
-
from = {
|
|
12325
|
-
tag: "url",
|
|
12326
|
-
url: args["--from-url"]
|
|
12327
|
-
};
|
|
12328
|
-
} else if (args["--from-migrations"]) {
|
|
12329
|
-
from = {
|
|
12330
|
-
tag: "migrations",
|
|
12331
|
-
path: import_path2.default.resolve(args["--from-migrations"])
|
|
12332
|
-
};
|
|
12333
|
-
} else if (args["--from-local-d1"]) {
|
|
12334
|
-
const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--from-local-d1" });
|
|
12335
|
-
from = {
|
|
12336
|
-
tag: "url",
|
|
12337
|
-
url: `file:${d1Database}`
|
|
12338
|
-
};
|
|
12339
|
-
}
|
|
12340
|
-
let to;
|
|
12341
|
-
if (args["--to-empty"]) {
|
|
12342
|
-
to = {
|
|
12343
|
-
tag: "empty"
|
|
12344
|
-
};
|
|
12345
|
-
} else if (args["--to-schema-datasource"]) {
|
|
12346
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
|
|
12347
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), config.schema, {
|
|
12348
|
-
argumentName: "--to-schema-datasource"
|
|
12349
|
-
});
|
|
12350
|
-
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12351
|
-
to = {
|
|
12352
|
-
tag: "schemaDatasource",
|
|
12353
|
-
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12354
|
-
};
|
|
12355
|
-
} else if (args["--to-schema-datamodel"]) {
|
|
12356
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), config.schema, {
|
|
12357
|
-
argumentName: "--to-schema-datamodel"
|
|
12358
|
-
});
|
|
12359
|
-
to = {
|
|
12360
|
-
tag: "schemaDatamodel",
|
|
12361
|
-
...(0, import_internals.toSchemasContainer)(schema.schemas)
|
|
12362
|
-
};
|
|
12363
|
-
} else if (args["--to-url"]) {
|
|
12364
|
-
to = {
|
|
12365
|
-
tag: "url",
|
|
12366
|
-
url: args["--to-url"]
|
|
12367
|
-
};
|
|
12368
|
-
} else if (args["--to-migrations"]) {
|
|
12369
|
-
to = {
|
|
12370
|
-
tag: "migrations",
|
|
12371
|
-
path: import_path2.default.resolve(args["--to-migrations"])
|
|
12372
|
-
};
|
|
12373
|
-
} else if (args["--to-local-d1"]) {
|
|
12374
|
-
const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--to-local-d1" });
|
|
12375
|
-
to = {
|
|
12376
|
-
tag: "url",
|
|
12377
|
-
url: `file:${d1Database}`
|
|
12378
|
-
};
|
|
12379
|
-
}
|
|
12380
|
-
const migrate = new import_chunk_UVNSK22K.Migrate();
|
|
12381
|
-
const captureStdout = new import_chunk_TKAGMA5K.CaptureStdout();
|
|
12382
|
-
const outputPath = args["--output"];
|
|
12383
|
-
const isOutputDefined = Boolean(outputPath);
|
|
12384
|
-
if (isOutputDefined) {
|
|
12385
|
-
captureStdout.startCapture();
|
|
12386
|
-
}
|
|
12387
|
-
let result;
|
|
12388
|
-
try {
|
|
12389
|
-
result = await migrate.engine.migrateDiff({
|
|
12390
|
-
from,
|
|
12391
|
-
to,
|
|
12392
|
-
script: args["--script"] || false,
|
|
12393
|
-
// default is false
|
|
12394
|
-
shadowDatabaseUrl: args["--shadow-database-url"],
|
|
12395
|
-
exitCode: args["--exit-code"]
|
|
12396
|
-
});
|
|
12397
|
-
} finally {
|
|
12398
|
-
migrate.stop();
|
|
12399
|
-
}
|
|
12400
|
-
if (isOutputDefined) {
|
|
12401
|
-
captureStdout.stopCapture();
|
|
12402
|
-
const diffOutput = captureStdout.getCapturedText();
|
|
12403
|
-
captureStdout.clearCaptureText();
|
|
12404
|
-
await import_fs_jetpack.default.writeAsync(outputPath, diffOutput.join("\n"));
|
|
12405
|
-
}
|
|
12406
|
-
debug3({ migrateDiffOutput: result });
|
|
12407
|
-
if (args["--exit-code"] && result.exitCode) {
|
|
12408
|
-
process.exit(result.exitCode);
|
|
12409
|
-
}
|
|
12410
|
-
return ``;
|
|
12119
|
+
if (numberOfToParameterProvided !== 1) {
|
|
12120
|
+
errorMessages.push(`${numberOfToParameterProvided} \`--to-...\` parameter(s) provided. 1 must be provided.`);
|
|
12411
12121
|
}
|
|
12412
|
-
help(
|
|
12413
|
-
|
|
12414
|
-
|
|
12122
|
+
return this.help(`${errorMessages.join("\n")}`);
|
|
12123
|
+
}
|
|
12124
|
+
if (args["--shadow-database-url"] && (args["--from-local-d1"] || args["--to-local-d1"])) {
|
|
12125
|
+
return this.help(
|
|
12126
|
+
`The flag \`--shadow-database-url\` is not compatible with \`--from-local-d1\` or \`--to-local-d1\`.`
|
|
12127
|
+
);
|
|
12128
|
+
}
|
|
12129
|
+
let from;
|
|
12130
|
+
if (args["--from-empty"]) {
|
|
12131
|
+
from = {
|
|
12132
|
+
tag: "empty"
|
|
12133
|
+
};
|
|
12134
|
+
} else if (args["--from-schema-datasource"]) {
|
|
12135
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
|
|
12136
|
+
const schema = await getSchemaWithPath(import_path.default.resolve(args["--from-schema-datasource"]), config.schema, {
|
|
12137
|
+
argumentName: "--from-schema-datasource"
|
|
12138
|
+
});
|
|
12139
|
+
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12140
|
+
from = {
|
|
12141
|
+
tag: "schemaDatasource",
|
|
12142
|
+
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12143
|
+
};
|
|
12144
|
+
} else if (args["--from-schema-datamodel"]) {
|
|
12145
|
+
const schema = await getSchemaWithPath(import_path.default.resolve(args["--from-schema-datamodel"]), config.schema, {
|
|
12146
|
+
argumentName: "--from-schema-datamodel"
|
|
12147
|
+
});
|
|
12148
|
+
from = {
|
|
12149
|
+
tag: "schemaDatamodel",
|
|
12150
|
+
...(0, import_internals.toSchemasContainer)(schema.schemas)
|
|
12151
|
+
};
|
|
12152
|
+
} else if (args["--from-url"]) {
|
|
12153
|
+
from = {
|
|
12154
|
+
tag: "url",
|
|
12155
|
+
url: args["--from-url"]
|
|
12156
|
+
};
|
|
12157
|
+
} else if (args["--from-migrations"]) {
|
|
12158
|
+
from = {
|
|
12159
|
+
tag: "migrations",
|
|
12160
|
+
path: import_path.default.resolve(args["--from-migrations"])
|
|
12161
|
+
};
|
|
12162
|
+
} else if (args["--from-local-d1"]) {
|
|
12163
|
+
const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--from-local-d1" });
|
|
12164
|
+
from = {
|
|
12165
|
+
tag: "url",
|
|
12166
|
+
url: `file:${d1Database}`
|
|
12167
|
+
};
|
|
12168
|
+
}
|
|
12169
|
+
let to;
|
|
12170
|
+
if (args["--to-empty"]) {
|
|
12171
|
+
to = {
|
|
12172
|
+
tag: "empty"
|
|
12173
|
+
};
|
|
12174
|
+
} else if (args["--to-schema-datasource"]) {
|
|
12175
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
|
|
12176
|
+
const schema = await getSchemaWithPath(import_path.default.resolve(args["--to-schema-datasource"]), config.schema, {
|
|
12177
|
+
argumentName: "--to-schema-datasource"
|
|
12178
|
+
});
|
|
12179
|
+
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12180
|
+
to = {
|
|
12181
|
+
tag: "schemaDatasource",
|
|
12182
|
+
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12183
|
+
};
|
|
12184
|
+
} else if (args["--to-schema-datamodel"]) {
|
|
12185
|
+
const schema = await getSchemaWithPath(import_path.default.resolve(args["--to-schema-datamodel"]), config.schema, {
|
|
12186
|
+
argumentName: "--to-schema-datamodel"
|
|
12187
|
+
});
|
|
12188
|
+
to = {
|
|
12189
|
+
tag: "schemaDatamodel",
|
|
12190
|
+
...(0, import_internals.toSchemasContainer)(schema.schemas)
|
|
12191
|
+
};
|
|
12192
|
+
} else if (args["--to-url"]) {
|
|
12193
|
+
to = {
|
|
12194
|
+
tag: "url",
|
|
12195
|
+
url: args["--to-url"]
|
|
12196
|
+
};
|
|
12197
|
+
} else if (args["--to-migrations"]) {
|
|
12198
|
+
to = {
|
|
12199
|
+
tag: "migrations",
|
|
12200
|
+
path: import_path.default.resolve(args["--to-migrations"])
|
|
12201
|
+
};
|
|
12202
|
+
} else if (args["--to-local-d1"]) {
|
|
12203
|
+
const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--to-local-d1" });
|
|
12204
|
+
to = {
|
|
12205
|
+
tag: "url",
|
|
12206
|
+
url: `file:${d1Database}`
|
|
12207
|
+
};
|
|
12208
|
+
}
|
|
12209
|
+
const migrate = new import_chunk_DDHPSYC4.Migrate();
|
|
12210
|
+
const captureStdout = new import_chunk_CTPONE6G.CaptureStdout();
|
|
12211
|
+
const outputPath = args["--output"];
|
|
12212
|
+
const isOutputDefined = Boolean(outputPath);
|
|
12213
|
+
if (isOutputDefined) {
|
|
12214
|
+
captureStdout.startCapture();
|
|
12215
|
+
}
|
|
12216
|
+
let result;
|
|
12217
|
+
try {
|
|
12218
|
+
result = await migrate.engine.migrateDiff({
|
|
12219
|
+
from,
|
|
12220
|
+
to,
|
|
12221
|
+
script: args["--script"] || false,
|
|
12222
|
+
// default is false
|
|
12223
|
+
shadowDatabaseUrl: args["--shadow-database-url"],
|
|
12224
|
+
exitCode: args["--exit-code"]
|
|
12225
|
+
});
|
|
12226
|
+
} finally {
|
|
12227
|
+
migrate.stop();
|
|
12228
|
+
}
|
|
12229
|
+
if (isOutputDefined) {
|
|
12230
|
+
captureStdout.stopCapture();
|
|
12231
|
+
const diffOutput = captureStdout.getCapturedText();
|
|
12232
|
+
captureStdout.clearCaptureText();
|
|
12233
|
+
await import_fs_jetpack.default.writeAsync(outputPath, diffOutput.join("\n"));
|
|
12234
|
+
}
|
|
12235
|
+
debug3({ migrateDiffOutput: result });
|
|
12236
|
+
if (args["--exit-code"] && result.exitCode) {
|
|
12237
|
+
process.exit(result.exitCode);
|
|
12238
|
+
}
|
|
12239
|
+
return ``;
|
|
12240
|
+
}
|
|
12241
|
+
help(error) {
|
|
12242
|
+
if (error) {
|
|
12243
|
+
throw new import_internals.HelpError(`
|
|
12415
12244
|
${error}
|
|
12416
12245
|
|
|
12417
12246
|
${helpOptions}`);
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12247
|
+
}
|
|
12248
|
+
return _MigrateDiff2.help;
|
|
12249
|
+
}
|
|
12250
|
+
};
|
|
12251
|
+
_MigrateDiff.help = (0, import_internals.format)(`
|
|
12423
12252
|
${process.platform === "win32" ? "" : "\u{1F50D} "}Compares the database schema from two arbitrary sources, and outputs the differences either as a human-readable summary (by default) or an executable script.
|
|
12424
12253
|
|
|
12425
|
-
${(0,
|
|
12426
|
-
${(0,
|
|
12254
|
+
${(0, import_chunk_SKRR5WT4.green)(`prisma migrate diff`)} is a read-only command that does not write to your datasource(s).
|
|
12255
|
+
${(0, import_chunk_SKRR5WT4.green)(`prisma db execute`)} can be used to execute its ${(0, import_chunk_SKRR5WT4.green)(`--script`)} output.
|
|
12427
12256
|
|
|
12428
|
-
The command takes a source ${(0,
|
|
12257
|
+
The command takes a source ${(0, import_chunk_SKRR5WT4.green)(`--from-...`)} and a destination ${(0, import_chunk_SKRR5WT4.green)(`--to-...`)}.
|
|
12429
12258
|
The source and destination must use the same provider,
|
|
12430
12259
|
e.g. a diff using 2 different providers like PostgreSQL and SQLite is not supported.
|
|
12431
12260
|
|
|
@@ -12436,17 +12265,17 @@ The default output is a human readable diff, it can be rendered as SQL using \`-
|
|
|
12436
12265
|
See the documentation for more information ${(0, import_internals.link)("https://pris.ly/d/migrate-diff")}
|
|
12437
12266
|
|
|
12438
12267
|
${helpOptions}
|
|
12439
|
-
${(0,
|
|
12268
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
12440
12269
|
|
|
12441
12270
|
From database to database as summary
|
|
12442
12271
|
e.g. compare two live databases
|
|
12443
|
-
${(0,
|
|
12272
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12444
12273
|
--from-url "$DATABASE_URL" \\
|
|
12445
12274
|
--to-url "postgresql://login:password@localhost:5432/db2"
|
|
12446
12275
|
|
|
12447
12276
|
From a live database to a Prisma datamodel
|
|
12448
12277
|
e.g. roll forward after a migration failed in the middle
|
|
12449
|
-
${(0,
|
|
12278
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12450
12279
|
--shadow-database-url "$SHADOW_DB" \\
|
|
12451
12280
|
--from-url "$PROD_DB" \\
|
|
12452
12281
|
--to-schema-datamodel=next_datamodel.prisma \\
|
|
@@ -12454,44 +12283,42 @@ ${(0, import_chunk_6TE2RIPN.bold)("Examples")}
|
|
|
12454
12283
|
|
|
12455
12284
|
From a live database to a datamodel
|
|
12456
12285
|
e.g. roll backward after a migration failed in the middle
|
|
12457
|
-
${(0,
|
|
12286
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12458
12287
|
--shadow-database-url "$SHADOW_DB" \\
|
|
12459
12288
|
--from-url "$PROD_DB" \\
|
|
12460
12289
|
--to-schema-datamodel=previous_datamodel.prisma \\
|
|
12461
12290
|
--script
|
|
12462
12291
|
|
|
12463
12292
|
From a local D1 database to a datamodel
|
|
12464
|
-
${(0,
|
|
12293
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12465
12294
|
--from-local-d1 \\
|
|
12466
12295
|
--to-schema-datamodel=./prisma/schema.prisma \\
|
|
12467
12296
|
--script
|
|
12468
12297
|
|
|
12469
12298
|
From a Prisma datamodel to a local D1 database
|
|
12470
|
-
${(0,
|
|
12299
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12471
12300
|
--from-schema-datamodel=./prisma/schema.prisma \\
|
|
12472
12301
|
--to-local-d1 \\
|
|
12473
12302
|
--script
|
|
12474
12303
|
|
|
12475
12304
|
From a Prisma Migrate \`migrations\` directory to another database
|
|
12476
12305
|
e.g. generate a migration for a hotfix already applied on production
|
|
12477
|
-
${(0,
|
|
12306
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12478
12307
|
--shadow-database-url "$SHADOW_DB" \\
|
|
12479
12308
|
--from-migrations ./migrations \\
|
|
12480
12309
|
--to-url "$PROD_DB" \\
|
|
12481
12310
|
--script
|
|
12482
12311
|
|
|
12483
12312
|
Execute the --script output with \`prisma db execute\` using bash pipe \`|\`
|
|
12484
|
-
${(0,
|
|
12313
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12485
12314
|
--from-[...] \\
|
|
12486
12315
|
--to-[...] \\
|
|
12487
12316
|
--script | prisma db execute --stdin --url="$DATABASE_URL"
|
|
12488
12317
|
|
|
12489
12318
|
Detect if both sources are in sync, it will exit with exit code 2 if changes are detected
|
|
12490
|
-
${(0,
|
|
12319
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate diff \\
|
|
12491
12320
|
--exit-code \\
|
|
12492
12321
|
--from-[...] \\
|
|
12493
12322
|
--to-[...]
|
|
12494
12323
|
`);
|
|
12495
|
-
|
|
12496
|
-
}
|
|
12497
|
-
});
|
|
12324
|
+
var MigrateDiff = _MigrateDiff;
|