@prisma/migrate 6.6.0-dev.37 → 6.6.0-dev.39
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 -4
- package/dist/SchemaEngine.js +4 -4
- package/dist/bin.js +24 -24
- package/dist/{chunk-DAIY6TJJ.js → chunk-4AGBP5YD.js} +6 -5
- package/dist/{chunk-ZJ5XFW47.js → chunk-4TNPAR45.js} +13 -13
- package/dist/{chunk-DC5EDFYV.js → chunk-5XZPYEHI.js} +5 -5
- package/dist/{chunk-3APEQXRW.js → chunk-62OCQSP5.js} +9 -7
- package/dist/{chunk-Q5AOWNMM.js → chunk-AREUEE4F.js} +12 -12
- package/dist/{chunk-EYLNYDMQ.js → chunk-B5BDMVZ5.js} +6 -5
- package/dist/{chunk-3UZQE4GG.js → chunk-CBP5GCEY.js} +8 -11
- package/dist/{chunk-ESVIUEQS.js → chunk-KFTA3257.js} +6 -5
- package/dist/{chunk-SYAPKGQF.js → chunk-LYMBGTLQ.js} +5 -5
- package/dist/{chunk-G7PJKEOV.js → chunk-OEWQACEH.js} +8 -9
- package/dist/{chunk-PUJQ76MJ.js → chunk-OI3XAPYH.js} +6 -5
- package/dist/{chunk-GJOWPAIF.js → chunk-QRLPHXCK.js} +7 -8
- package/dist/{chunk-Q2AR5XFP.js → chunk-QTRSTAZV.js} +5 -5
- package/dist/{chunk-VD5QZLJZ.js → chunk-XNXY7ERJ.js} +7 -6
- package/dist/{chunk-2K6AEGMN.js → chunk-ZBT6KHV4.js} +6 -5
- package/dist/commands/DbExecute.js +5 -5
- package/dist/commands/DbPull.js +4 -4
- package/dist/commands/DbPush.js +5 -5
- package/dist/commands/MigrateDeploy.js +5 -5
- package/dist/commands/MigrateDev.js +5 -5
- package/dist/commands/MigrateDiff.js +5 -5
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/MigrateResolve.js +5 -5
- package/dist/commands/MigrateStatus.js +5 -5
- package/dist/index.js +27 -27
- package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
- package/dist/internals/src/index.d.ts +1 -0
- package/dist/migrate/src/Migrate.d.ts +1 -1
- package/dist/migrate/src/SchemaEngine.d.ts +1 -1
- package/dist/migrate/src/types.d.ts +1 -0
- package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
- package/dist/utils/getDatabaseVersionSafe.js +4 -4
- package/dist/utils/introspectSql.js +4 -4
- package/dist/views/handleViewsIO.js +2 -2
- package/package.json +6 -6
package/dist/Migrate.js
CHANGED
|
@@ -18,15 +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_CBP5GCEY.Migrate
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Migrate_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
25
25
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
26
26
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
27
27
|
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
28
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
29
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
30
30
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
31
31
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
32
32
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
package/dist/SchemaEngine.js
CHANGED
|
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var SchemaEngine_exports = {};
|
|
20
20
|
__export(SchemaEngine_exports, {
|
|
21
|
-
EngineError: () =>
|
|
22
|
-
SchemaEngine: () =>
|
|
21
|
+
EngineError: () => import_chunk_QRLPHXCK.EngineError,
|
|
22
|
+
SchemaEngine: () => import_chunk_QRLPHXCK.SchemaEngine
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(SchemaEngine_exports);
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
26
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
27
27
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
28
28
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
29
29
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
package/dist/bin.js
CHANGED
|
@@ -23,12 +23,12 @@ 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
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
26
|
+
var import_chunk_LYMBGTLQ = require("./chunk-LYMBGTLQ.js");
|
|
27
|
+
var import_chunk_OI3XAPYH = require("./chunk-OI3XAPYH.js");
|
|
28
|
+
var import_chunk_XNXY7ERJ = require("./chunk-XNXY7ERJ.js");
|
|
29
|
+
var import_chunk_ZBT6KHV4 = require("./chunk-ZBT6KHV4.js");
|
|
30
|
+
var import_chunk_QTRSTAZV = require("./chunk-QTRSTAZV.js");
|
|
31
|
+
var import_chunk_62OCQSP5 = require("./chunk-62OCQSP5.js");
|
|
32
32
|
var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
|
|
33
33
|
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
34
34
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
@@ -37,27 +37,27 @@ var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
|
37
37
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
38
38
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
39
39
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_KFTA3257 = require("./chunk-KFTA3257.js");
|
|
41
41
|
var import_chunk_B4SUSDC2 = require("./chunk-B4SUSDC2.js");
|
|
42
42
|
var import_chunk_LLO7YF56 = require("./chunk-LLO7YF56.js");
|
|
43
|
-
var
|
|
44
|
-
var
|
|
43
|
+
var import_chunk_4AGBP5YD = require("./chunk-4AGBP5YD.js");
|
|
44
|
+
var import_chunk_B5BDMVZ5 = require("./chunk-B5BDMVZ5.js");
|
|
45
45
|
var import_chunk_YBX7R3MT = require("./chunk-YBX7R3MT.js");
|
|
46
46
|
var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
|
|
47
47
|
var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
48
48
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
49
49
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
50
50
|
var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
|
|
51
|
-
var
|
|
51
|
+
var import_chunk_4TNPAR45 = require("./chunk-4TNPAR45.js");
|
|
52
52
|
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
53
53
|
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
54
54
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
55
|
-
var
|
|
55
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
56
56
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
57
57
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
58
58
|
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
59
|
-
var
|
|
60
|
-
var
|
|
59
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
60
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
61
61
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
62
62
|
var import_chunk_EJG7GKM7 = require("./chunk-EJG7GKM7.js");
|
|
63
63
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
@@ -70,7 +70,7 @@ var import_config = require("@prisma/config");
|
|
|
70
70
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
71
71
|
var import_engines_version = require("@prisma/engines-version");
|
|
72
72
|
var import_internals = require("@prisma/internals");
|
|
73
|
-
var version = "6.6.0-dev.
|
|
73
|
+
var version = "6.6.0-dev.39";
|
|
74
74
|
process.on("uncaughtException", (e) => {
|
|
75
75
|
console.log(e);
|
|
76
76
|
});
|
|
@@ -92,17 +92,17 @@ var args = (0, import_internals.arg)(
|
|
|
92
92
|
async function main() {
|
|
93
93
|
const cli = import_chunk_NGQA5JTN.CLI.new({
|
|
94
94
|
migrate: import_chunk_LLO7YF56.MigrateCommand.new({
|
|
95
|
-
dev:
|
|
96
|
-
status:
|
|
97
|
-
resolve:
|
|
98
|
-
reset:
|
|
99
|
-
deploy:
|
|
100
|
-
diff:
|
|
95
|
+
dev: import_chunk_B5BDMVZ5.MigrateDev.new(),
|
|
96
|
+
status: import_chunk_ZBT6KHV4.MigrateStatus.new(),
|
|
97
|
+
resolve: import_chunk_XNXY7ERJ.MigrateResolve.new(),
|
|
98
|
+
reset: import_chunk_OI3XAPYH.MigrateReset.new(),
|
|
99
|
+
deploy: import_chunk_4AGBP5YD.MigrateDeploy.new(),
|
|
100
|
+
diff: import_chunk_4TNPAR45.MigrateDiff.new()
|
|
101
101
|
}),
|
|
102
102
|
db: import_chunk_EJG7GKM7.DbCommand.new({
|
|
103
|
-
execute:
|
|
104
|
-
pull:
|
|
105
|
-
push:
|
|
103
|
+
execute: import_chunk_QTRSTAZV.DbExecute.new(),
|
|
104
|
+
pull: import_chunk_62OCQSP5.DbPull.new(),
|
|
105
|
+
push: import_chunk_KFTA3257.DbPush.new(),
|
|
106
106
|
// drop: DbDrop.new(),
|
|
107
107
|
seed: import_chunk_B4SUSDC2.DbSeed.new()
|
|
108
108
|
})
|
|
@@ -134,7 +134,7 @@ main().then((code) => {
|
|
|
134
134
|
cliVersion: version,
|
|
135
135
|
enginesVersion: import_engines_version.enginesVersion,
|
|
136
136
|
command: commandArray.join(" "),
|
|
137
|
-
getDatabaseVersionSafe:
|
|
137
|
+
getDatabaseVersionSafe: import_chunk_LYMBGTLQ.getDatabaseVersionSafe
|
|
138
138
|
}).catch((e) => {
|
|
139
139
|
if (import_debug.default.enabled("migrate")) {
|
|
140
140
|
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_4AGBP5YD_exports = {};
|
|
30
|
+
__export(chunk_4AGBP5YD_exports, {
|
|
31
31
|
MigrateDeploy: () => MigrateDeploy
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_4AGBP5YD_exports);
|
|
34
34
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
36
36
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
37
37
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
38
38
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
@@ -88,9 +88,10 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
88
88
|
schemaPathFromArg: args["--schema"],
|
|
89
89
|
schemaPathFromConfig: config.schema
|
|
90
90
|
});
|
|
91
|
+
const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext);
|
|
91
92
|
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate deploy", schemaContext });
|
|
92
93
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource) });
|
|
93
|
-
const migrate = new
|
|
94
|
+
const migrate = new import_chunk_CBP5GCEY.Migrate(schemaContext, migrationsDirPath);
|
|
94
95
|
try {
|
|
95
96
|
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
96
97
|
if (wasDbCreated) {
|
|
@@ -26,17 +26,17 @@ 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_4TNPAR45_exports = {};
|
|
30
|
+
__export(chunk_4TNPAR45_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_4TNPAR45_exports);
|
|
34
34
|
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
35
35
|
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
36
36
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
38
38
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
40
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
41
41
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
42
42
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -10252,7 +10252,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
10252
10252
|
"../internals/package.json"(exports, module2) {
|
|
10253
10253
|
module2.exports = {
|
|
10254
10254
|
name: "@prisma/internals",
|
|
10255
|
-
version: "6.6.0-dev.
|
|
10255
|
+
version: "6.6.0-dev.39",
|
|
10256
10256
|
description: "This package is intended for Prisma's internal use",
|
|
10257
10257
|
main: "dist/index.js",
|
|
10258
10258
|
types: "dist/index.d.ts",
|
|
@@ -10644,7 +10644,7 @@ var tryCatch = function(f, onThrow) {
|
|
|
10644
10644
|
}
|
|
10645
10645
|
};
|
|
10646
10646
|
var chainW = flatMap;
|
|
10647
|
-
var import_function3 = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
10647
|
+
var import_function3 = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_OEWQACEH.require_function)());
|
|
10648
10648
|
var RustPanic = class extends Error {
|
|
10649
10649
|
__typename = "RustPanic";
|
|
10650
10650
|
request;
|
|
@@ -10716,7 +10716,7 @@ function addVersionDetailsToErrorMessage(message) {
|
|
|
10716
10716
|
|
|
10717
10717
|
${formatTable(rows)}`;
|
|
10718
10718
|
}
|
|
10719
|
-
var import_function2 = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
10719
|
+
var import_function2 = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_OEWQACEH.require_function)());
|
|
10720
10720
|
function relativizePathInPSLError(error) {
|
|
10721
10721
|
return error.replaceAll(process.cwd() + import_node_path4.default.sep, "");
|
|
10722
10722
|
}
|
|
@@ -10735,12 +10735,12 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
10735
10735
|
),
|
|
10736
10736
|
map((errorOutputAsJSON) => {
|
|
10737
10737
|
const defaultMessage = (0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)(relativizePathInPSLError(errorOutputAsJSON.message)));
|
|
10738
|
-
const getConfigErrorInit = (0,
|
|
10738
|
+
const getConfigErrorInit = (0, import_chunk_OEWQACEH.z)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
|
10739
10739
|
return {
|
|
10740
10740
|
reason: createSchemaValidationError(reason),
|
|
10741
10741
|
errorCode: eJSON.error_code
|
|
10742
10742
|
};
|
|
10743
|
-
}).with({ error_code:
|
|
10743
|
+
}).with({ error_code: import_chunk_OEWQACEH.N.string }, (eJSON) => {
|
|
10744
10744
|
return {
|
|
10745
10745
|
reason,
|
|
10746
10746
|
errorCode: eJSON.error_code
|
|
@@ -10760,7 +10760,7 @@ var debug = (0, import_debug3.default)("prisma:getConfig");
|
|
|
10760
10760
|
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
|
10761
10761
|
var GetConfigError = class extends Error {
|
|
10762
10762
|
constructor(params) {
|
|
10763
|
-
const constructedErrorMessage = (0,
|
|
10763
|
+
const constructedErrorMessage = (0, import_chunk_OEWQACEH.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
10764
10764
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
10765
10765
|
return `${reason}
|
|
10766
10766
|
${errorCodeMessage}
|
|
@@ -10834,7 +10834,7 @@ async function getConfig(options) {
|
|
|
10834
10834
|
}
|
|
10835
10835
|
return Promise.resolve(data);
|
|
10836
10836
|
}
|
|
10837
|
-
const error = (0,
|
|
10837
|
+
const error = (0, import_chunk_OEWQACEH.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
|
10838
10838
|
debugErrorType(e);
|
|
10839
10839
|
if (isWasmPanic(e.error)) {
|
|
10840
10840
|
const { message, stack } = getWasmError(e.error);
|
|
@@ -11403,7 +11403,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11403
11403
|
url: `file:${d1Database}`
|
|
11404
11404
|
};
|
|
11405
11405
|
}
|
|
11406
|
-
const migrate = new
|
|
11406
|
+
const migrate = new import_chunk_CBP5GCEY.Migrate();
|
|
11407
11407
|
const captureStdout = new import_chunk_VAJ4VX67.CaptureStdout();
|
|
11408
11408
|
const outputPath = args["--output"];
|
|
11409
11409
|
const isOutputDefined = Boolean(outputPath);
|
|
@@ -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_5XZPYEHI_exports = {};
|
|
20
|
+
__export(chunk_5XZPYEHI_exports, {
|
|
21
21
|
introspectSql: () => introspectSql
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_5XZPYEHI_exports);
|
|
24
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
25
25
|
var import_internals = require("@prisma/internals");
|
|
26
26
|
var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
|
|
27
27
|
async function introspectSql(schemaContext, queries) {
|
|
@@ -41,7 +41,7 @@ async function introspectSql(schemaContext, queries) {
|
|
|
41
41
|
`Could not get url from datasource ${firstDatasource.name} in ${schemaContext.loadedFromPathForLogMessages}`
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
const schemaEngine = new
|
|
44
|
+
const schemaEngine = new import_chunk_QRLPHXCK.SchemaEngine({ schemaContext });
|
|
45
45
|
const results = [];
|
|
46
46
|
const errors = [];
|
|
47
47
|
try {
|
|
@@ -26,11 +26,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_62OCQSP5_exports = {};
|
|
30
|
+
__export(chunk_62OCQSP5_exports, {
|
|
31
31
|
DbPull: () => DbPull
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_62OCQSP5_exports);
|
|
34
34
|
var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
|
|
35
35
|
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
36
36
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
@@ -39,8 +39,8 @@ var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
|
39
39
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
40
40
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
41
41
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
42
|
-
var
|
|
43
|
-
var
|
|
42
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
43
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
44
44
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
45
45
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
46
46
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
@@ -146,7 +146,7 @@ Set composite types introspection depth to 2 levels
|
|
|
146
146
|
if (!url && !schemaContext && !fromD1) {
|
|
147
147
|
throw new import_chunk_3WC4XD74.NoSchemaFoundError();
|
|
148
148
|
}
|
|
149
|
-
const { firstDatasource, schema, validationWarning } = await (0,
|
|
149
|
+
const { firstDatasource, schema, validationWarning } = await (0, import_chunk_OEWQACEH.z)({ url, schemaContext, fromD1 }).when(
|
|
150
150
|
(input) => input.schemaContext !== null,
|
|
151
151
|
async (input) => {
|
|
152
152
|
const previewFeatures = input.schemaContext.generators.find(({ name }) => name === "client")?.previewFeatures;
|
|
@@ -239,16 +239,18 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
|
239
239
|
)} for more info.`);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
const engine = new
|
|
242
|
+
const engine = new import_chunk_QRLPHXCK.SchemaEngine({ schemaContext: schemaContext ?? void 0 });
|
|
243
243
|
const basedOn = !args["--url"] && schemaContext?.primaryDatasource ? ` based on datasource defined in ${(0, import_chunk_SKRR5WT4.underline)(schemaContext.loadedFromPathForLogMessages)}` : "";
|
|
244
244
|
const introspectionSpinner = spinnerFactory(`Introspecting${basedOn}`);
|
|
245
245
|
const before = Math.round(performance.now());
|
|
246
246
|
let introspectionSchema = void 0;
|
|
247
247
|
let introspectionWarnings;
|
|
248
248
|
try {
|
|
249
|
+
const directoryConfig = (0, import_internals.inferDirectoryConfig)(schemaContext);
|
|
249
250
|
const introspectionResult = await engine.introspect({
|
|
250
251
|
schema: (0, import_internals.toSchemasContainer)(schema),
|
|
251
252
|
baseDirectoryPath: schemaContext?.schemaRootDir ?? process.cwd(),
|
|
253
|
+
viewsDirectoryPath: directoryConfig.viewsDirPath,
|
|
252
254
|
force: args["--force"],
|
|
253
255
|
compositeTypeDepth: args["--composite-type-depth"],
|
|
254
256
|
namespaces: args["--schemas"]?.split(",")
|
|
@@ -26,17 +26,17 @@ 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_AREUEE4F_exports = {};
|
|
30
|
+
__export(chunk_AREUEE4F_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_AREUEE4F_exports);
|
|
34
34
|
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
35
35
|
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
36
36
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
38
38
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_OEWQACEH = require("./chunk-OEWQACEH.js");
|
|
40
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
41
41
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
42
42
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -10644,7 +10644,7 @@ var tryCatch = function(f, onThrow) {
|
|
|
10644
10644
|
}
|
|
10645
10645
|
};
|
|
10646
10646
|
var chainW = flatMap;
|
|
10647
|
-
var import_function3 = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
10647
|
+
var import_function3 = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_OEWQACEH.require_function)());
|
|
10648
10648
|
var RustPanic = class extends Error {
|
|
10649
10649
|
__typename = "RustPanic";
|
|
10650
10650
|
request;
|
|
@@ -10716,7 +10716,7 @@ function addVersionDetailsToErrorMessage(message) {
|
|
|
10716
10716
|
|
|
10717
10717
|
${formatTable(rows)}`;
|
|
10718
10718
|
}
|
|
10719
|
-
var import_function2 = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
10719
|
+
var import_function2 = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_OEWQACEH.require_function)());
|
|
10720
10720
|
function relativizePathInPSLError(error) {
|
|
10721
10721
|
return error.replaceAll(process.cwd() + import_node_path4.default.sep, "");
|
|
10722
10722
|
}
|
|
@@ -10735,12 +10735,12 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
10735
10735
|
),
|
|
10736
10736
|
map((errorOutputAsJSON) => {
|
|
10737
10737
|
const defaultMessage = (0, import_chunk_SKRR5WT4.red)((0, import_chunk_SKRR5WT4.bold)(relativizePathInPSLError(errorOutputAsJSON.message)));
|
|
10738
|
-
const getConfigErrorInit = (0,
|
|
10738
|
+
const getConfigErrorInit = (0, import_chunk_OEWQACEH.z)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
|
10739
10739
|
return {
|
|
10740
10740
|
reason: createSchemaValidationError(reason),
|
|
10741
10741
|
errorCode: eJSON.error_code
|
|
10742
10742
|
};
|
|
10743
|
-
}).with({ error_code:
|
|
10743
|
+
}).with({ error_code: import_chunk_OEWQACEH.N.string }, (eJSON) => {
|
|
10744
10744
|
return {
|
|
10745
10745
|
reason,
|
|
10746
10746
|
errorCode: eJSON.error_code
|
|
@@ -10760,7 +10760,7 @@ var debug = (0, import_debug3.default)("prisma:getConfig");
|
|
|
10760
10760
|
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
|
10761
10761
|
var GetConfigError = class extends Error {
|
|
10762
10762
|
constructor(params) {
|
|
10763
|
-
const constructedErrorMessage = (0,
|
|
10763
|
+
const constructedErrorMessage = (0, import_chunk_OEWQACEH.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
10764
10764
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
10765
10765
|
return `${reason}
|
|
10766
10766
|
${errorCodeMessage}
|
|
@@ -10834,7 +10834,7 @@ async function getConfig(options) {
|
|
|
10834
10834
|
}
|
|
10835
10835
|
return Promise.resolve(data);
|
|
10836
10836
|
}
|
|
10837
|
-
const error = (0,
|
|
10837
|
+
const error = (0, import_chunk_OEWQACEH.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
|
10838
10838
|
debugErrorType(e);
|
|
10839
10839
|
if (isWasmPanic(e.error)) {
|
|
10840
10840
|
const { message, stack } = getWasmError(e.error);
|
|
@@ -11403,7 +11403,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11403
11403
|
url: `file:${d1Database}`
|
|
11404
11404
|
};
|
|
11405
11405
|
}
|
|
11406
|
-
const migrate = new
|
|
11406
|
+
const migrate = new import_chunk_CBP5GCEY.Migrate();
|
|
11407
11407
|
const captureStdout = new import_chunk_VAJ4VX67.CaptureStdout();
|
|
11408
11408
|
const outputPath = args["--output"];
|
|
11409
11409
|
const isOutputDefined = Boolean(outputPath);
|
|
@@ -26,17 +26,17 @@ 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_B5BDMVZ5_exports = {};
|
|
30
|
+
__export(chunk_B5BDMVZ5_exports, {
|
|
31
31
|
MigrateDev: () => MigrateDev
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_B5BDMVZ5_exports);
|
|
34
34
|
var import_chunk_YBX7R3MT = require("./chunk-YBX7R3MT.js");
|
|
35
35
|
var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
|
|
36
36
|
var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
37
37
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
38
38
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
40
40
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
41
41
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
42
42
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
@@ -104,6 +104,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
104
104
|
schemaPathFromArg: args["--schema"],
|
|
105
105
|
schemaPathFromConfig: config.schema
|
|
106
106
|
});
|
|
107
|
+
const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext);
|
|
107
108
|
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate dev", schemaContext });
|
|
108
109
|
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
109
110
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
@@ -113,7 +114,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
113
114
|
if (wasDbCreated) {
|
|
114
115
|
process.stdout.write(wasDbCreated + "\n\n");
|
|
115
116
|
}
|
|
116
|
-
const migrate = new
|
|
117
|
+
const migrate = new import_chunk_CBP5GCEY.Migrate(schemaContext, migrationsDirPath);
|
|
117
118
|
let devDiagnostic;
|
|
118
119
|
try {
|
|
119
120
|
devDiagnostic = await migrate.devDiagnostic();
|
|
@@ -26,22 +26,21 @@ 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
|
-
__export2(
|
|
29
|
+
var chunk_CBP5GCEY_exports = {};
|
|
30
|
+
__export2(chunk_CBP5GCEY_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_CBP5GCEY_exports);
|
|
34
34
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
35
35
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
36
36
|
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.js");
|
|
38
38
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
39
39
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
40
40
|
var import_engines_version = require("@prisma/engines-version");
|
|
41
41
|
var import_internals = require("@prisma/internals");
|
|
42
42
|
var import_node_process = __toESM(require("node:process"));
|
|
43
43
|
var import_node_process2 = __toESM(require("node:process"));
|
|
44
|
-
var import_path = __toESM(require("path"));
|
|
45
44
|
var base_exports = {};
|
|
46
45
|
(0, import_chunk_2ESYSVXG.__export)(base_exports, {
|
|
47
46
|
beep: () => beep,
|
|
@@ -731,15 +730,13 @@ var Migrate = class {
|
|
|
731
730
|
engine;
|
|
732
731
|
schemaContext;
|
|
733
732
|
migrationsDirectoryPath;
|
|
734
|
-
constructor(schemaContext, enabledPreviewFeatures) {
|
|
733
|
+
constructor(schemaContext, migrationsDirPath, enabledPreviewFeatures) {
|
|
735
734
|
if (schemaContext) {
|
|
736
735
|
this.schemaContext = schemaContext;
|
|
737
|
-
this.migrationsDirectoryPath =
|
|
738
|
-
this.engine = new
|
|
736
|
+
this.migrationsDirectoryPath = migrationsDirPath;
|
|
737
|
+
this.engine = new import_chunk_QRLPHXCK.SchemaEngine({ schemaContext, enabledPreviewFeatures });
|
|
739
738
|
} else {
|
|
740
|
-
this.engine = new
|
|
741
|
-
enabledPreviewFeatures
|
|
742
|
-
});
|
|
739
|
+
this.engine = new import_chunk_QRLPHXCK.SchemaEngine({ enabledPreviewFeatures });
|
|
743
740
|
}
|
|
744
741
|
}
|
|
745
742
|
stop() {
|
|
@@ -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_KFTA3257_exports = {};
|
|
30
|
+
__export(chunk_KFTA3257_exports, {
|
|
31
31
|
DbPush: () => DbPush
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_KFTA3257_exports);
|
|
34
|
+
var import_chunk_CBP5GCEY = require("./chunk-CBP5GCEY.js");
|
|
35
35
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
36
36
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
37
37
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
@@ -95,10 +95,11 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
95
95
|
schemaPathFromArg: args["--schema"],
|
|
96
96
|
schemaPathFromConfig: config.schema
|
|
97
97
|
});
|
|
98
|
+
const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext);
|
|
98
99
|
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "db push", schemaContext });
|
|
99
100
|
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
100
101
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
101
|
-
const migrate = new
|
|
102
|
+
const migrate = new import_chunk_CBP5GCEY.Migrate(schemaContext, migrationsDirPath);
|
|
102
103
|
try {
|
|
103
104
|
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
104
105
|
if (wasDbCreated) {
|
|
@@ -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_LYMBGTLQ_exports = {};
|
|
30
|
+
__export(chunk_LYMBGTLQ_exports, {
|
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_LYMBGTLQ_exports);
|
|
34
|
+
var import_chunk_QRLPHXCK = require("./chunk-QRLPHXCK.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 engine;
|
|
39
39
|
let dbVersion;
|
|
40
40
|
try {
|
|
41
|
-
engine = new
|
|
41
|
+
engine = new import_chunk_QRLPHXCK.SchemaEngine({});
|
|
42
42
|
dbVersion = await engine.getDatabaseVersion(args);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
debug(e);
|
|
@@ -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_OEWQACEH_exports = {};
|
|
30
|
+
__export(chunk_OEWQACEH_exports, {
|
|
31
31
|
N: () => N,
|
|
32
32
|
handleViewsIO: () => handleViewsIO,
|
|
33
33
|
require_function: () => require_function,
|
|
34
34
|
z: () => z
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_OEWQACEH_exports);
|
|
37
37
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
38
38
|
var import_internals = require("@prisma/internals");
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
@@ -4512,15 +4512,14 @@ var I = class _I {
|
|
|
4512
4512
|
return this;
|
|
4513
4513
|
}
|
|
4514
4514
|
};
|
|
4515
|
-
async function handleViewsIO({ views,
|
|
4516
|
-
const
|
|
4517
|
-
const viewsDir = import_path.default.posix.join(prismaDir, "views");
|
|
4515
|
+
async function handleViewsIO({ views, viewsDirectoryPath }) {
|
|
4516
|
+
const posixViewsDirectoryPath = (0, import_internals.pathToPosix)(viewsDirectoryPath);
|
|
4518
4517
|
if (views.length === 0) {
|
|
4519
|
-
await cleanLeftoversIO(
|
|
4518
|
+
await cleanLeftoversIO(posixViewsDirectoryPath);
|
|
4520
4519
|
return;
|
|
4521
4520
|
}
|
|
4522
|
-
const { viewFilesToKeep } = await createViewsIO(
|
|
4523
|
-
await cleanLeftoversIO(
|
|
4521
|
+
const { viewFilesToKeep } = await createViewsIO(posixViewsDirectoryPath, views);
|
|
4522
|
+
await cleanLeftoversIO(posixViewsDirectoryPath, viewFilesToKeep);
|
|
4524
4523
|
}
|
|
4525
4524
|
async function createViewsIO(viewsDir, views) {
|
|
4526
4525
|
const viewEntries = views.map(({ schema, ...rest }) => {
|