@prisma/migrate 6.6.0-dev.34 → 6.6.0-dev.36
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 +3 -3
- package/dist/SchemaEngine.js +3 -3
- package/dist/bin.js +23 -23
- package/dist/{chunk-BUAYZ4KA.js → chunk-2K6AEGMN.js} +6 -6
- package/dist/{chunk-SCH55BRJ.js → chunk-3APEQXRW.js} +11 -11
- package/dist/{chunk-5Q5BJS5B.js → chunk-3UZQE4GG.js} +17 -20
- package/dist/{chunk-ITXZ3AL5.js → chunk-7MOSA4HD.js} +23 -16
- package/dist/{chunk-IRYXRMQC.js → chunk-DAIY6TJJ.js} +6 -6
- package/dist/{chunk-ABQZ5J74.js → chunk-DC5EDFYV.js} +18 -18
- package/dist/{chunk-63ZT25OL.js → chunk-ESVIUEQS.js} +6 -6
- package/dist/{chunk-ZCR4PTT3.js → chunk-EYLNYDMQ.js} +7 -7
- package/dist/{chunk-GHZAN2PG.js → chunk-GJOWPAIF.js} +12 -14
- package/dist/{chunk-AM7BRZFD.js → chunk-PUJQ76MJ.js} +6 -6
- package/dist/{chunk-LAEOX7QH.js → chunk-Q2AR5XFP.js} +7 -6
- package/dist/{chunk-RP5RYCUZ.js → chunk-Q5AOWNMM.js} +22 -15
- package/dist/{chunk-HPT54KSO.js → chunk-SQKGZVG3.js} +6 -6
- package/dist/{chunk-MTJFLQI4.js → chunk-SYAPKGQF.js} +5 -5
- package/dist/{chunk-HQJ7FIWN.js → chunk-VD5QZLJZ.js} +7 -7
- package/dist/commands/DbDrop.js +2 -2
- package/dist/commands/DbExecute.js +4 -4
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/DbPush.js +4 -4
- package/dist/commands/MigrateDeploy.js +4 -4
- package/dist/commands/MigrateDev.js +4 -4
- package/dist/commands/MigrateDiff.js +4 -4
- package/dist/commands/MigrateReset.js +4 -4
- package/dist/commands/MigrateResolve.js +4 -4
- package/dist/commands/MigrateStatus.js +4 -4
- package/dist/index.js +28 -28
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/schemaContext.d.ts +17 -2
- package/dist/internals/src/engine-commands/getConfig.d.ts +0 -4
- package/dist/internals/src/engine-commands/getDmmf.d.ts +1 -5
- package/dist/internals/src/get-generators/getGenerators.d.ts +7 -3
- package/dist/internals/src/index.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
- package/dist/migrate/src/Migrate.d.ts +4 -4
- package/dist/migrate/src/SchemaEngine.d.ts +4 -4
- package/dist/migrate/src/utils/introspectSql.d.ts +2 -1
- package/dist/utils/getDatabaseVersionSafe.js +3 -3
- package/dist/utils/introspectSql.js +3 -3
- package/package.json +6 -6
- package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
package/dist/Migrate.js
CHANGED
|
@@ -18,14 +18,14 @@ 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_3UZQE4GG.Migrate
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Migrate_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.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
|
|
28
|
+
var import_chunk_GJOWPAIF = require("./chunk-GJOWPAIF.js");
|
|
29
29
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
30
30
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
31
31
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
package/dist/SchemaEngine.js
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var SchemaEngine_exports = {};
|
|
20
20
|
__export(SchemaEngine_exports, {
|
|
21
|
-
EngineError: () =>
|
|
22
|
-
SchemaEngine: () =>
|
|
21
|
+
EngineError: () => import_chunk_GJOWPAIF.EngineError,
|
|
22
|
+
SchemaEngine: () => import_chunk_GJOWPAIF.SchemaEngine
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(SchemaEngine_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_GJOWPAIF = require("./chunk-GJOWPAIF.js");
|
|
26
26
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
27
27
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
28
28
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
package/dist/bin.js
CHANGED
|
@@ -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_SYAPKGQF = require("./chunk-SYAPKGQF.js");
|
|
27
|
+
var import_chunk_PUJQ76MJ = require("./chunk-PUJQ76MJ.js");
|
|
28
|
+
var import_chunk_VD5QZLJZ = require("./chunk-VD5QZLJZ.js");
|
|
29
|
+
var import_chunk_2K6AEGMN = require("./chunk-2K6AEGMN.js");
|
|
30
|
+
var import_chunk_Q2AR5XFP = require("./chunk-Q2AR5XFP.js");
|
|
31
|
+
var import_chunk_3APEQXRW = require("./chunk-3APEQXRW.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,26 +37,26 @@ 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_ESVIUEQS = require("./chunk-ESVIUEQS.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_DAIY6TJJ = require("./chunk-DAIY6TJJ.js");
|
|
44
|
+
var import_chunk_EYLNYDMQ = require("./chunk-EYLNYDMQ.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_7MOSA4HD = require("./chunk-7MOSA4HD.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_3UZQE4GG = require("./chunk-3UZQE4GG.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
|
|
59
|
+
var import_chunk_GJOWPAIF = require("./chunk-GJOWPAIF.js");
|
|
60
60
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
61
61
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
62
62
|
var import_chunk_EJG7GKM7 = require("./chunk-EJG7GKM7.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.36";
|
|
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_EYLNYDMQ.MigrateDev.new(),
|
|
96
|
+
status: import_chunk_2K6AEGMN.MigrateStatus.new(),
|
|
97
|
+
resolve: import_chunk_VD5QZLJZ.MigrateResolve.new(),
|
|
98
|
+
reset: import_chunk_PUJQ76MJ.MigrateReset.new(),
|
|
99
|
+
deploy: import_chunk_DAIY6TJJ.MigrateDeploy.new(),
|
|
100
|
+
diff: import_chunk_7MOSA4HD.MigrateDiff.new()
|
|
101
101
|
}),
|
|
102
102
|
db: import_chunk_EJG7GKM7.DbCommand.new({
|
|
103
|
-
execute:
|
|
104
|
-
pull:
|
|
105
|
-
push:
|
|
103
|
+
execute: import_chunk_Q2AR5XFP.DbExecute.new(),
|
|
104
|
+
pull: import_chunk_3APEQXRW.DbPull.new(),
|
|
105
|
+
push: import_chunk_ESVIUEQS.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_SYAPKGQF.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,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_2K6AEGMN_exports = {};
|
|
30
|
+
__export(chunk_2K6AEGMN_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_2K6AEGMN_exports);
|
|
34
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.js");
|
|
35
35
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
36
36
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
37
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
@@ -78,7 +78,6 @@ Check the status of your database migrations
|
|
|
78
78
|
if ((0, import_internals.isError)(args)) {
|
|
79
79
|
return this.help(args.message);
|
|
80
80
|
}
|
|
81
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate status", args, config.schema, true);
|
|
82
81
|
if (args["--help"]) {
|
|
83
82
|
return this.help();
|
|
84
83
|
}
|
|
@@ -87,8 +86,9 @@ Check the status of your database migrations
|
|
|
87
86
|
schemaPathFromArg: args["--schema"],
|
|
88
87
|
schemaPathFromConfig: config.schema
|
|
89
88
|
});
|
|
89
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate status", schemaContext });
|
|
90
90
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource) });
|
|
91
|
-
const migrate = new
|
|
91
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
92
92
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
93
93
|
let diagnoseResult;
|
|
94
94
|
let listMigrationDirectoriesResult;
|
|
@@ -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_3APEQXRW_exports = {};
|
|
30
|
+
__export(chunk_3APEQXRW_exports, {
|
|
31
31
|
DbPull: () => DbPull
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_3APEQXRW_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,7 +39,7 @@ 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
|
|
42
|
+
var import_chunk_GJOWPAIF = require("./chunk-GJOWPAIF.js");
|
|
43
43
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
44
44
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
45
45
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
@@ -122,23 +122,25 @@ Set composite types introspection depth to 2 levels
|
|
|
122
122
|
if (args instanceof Error) {
|
|
123
123
|
return this.help(args.message);
|
|
124
124
|
}
|
|
125
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db pull", args, config.schema, !args["--url"]);
|
|
126
125
|
if (args["--help"]) {
|
|
127
126
|
return this.help();
|
|
128
127
|
}
|
|
129
128
|
const url = args["--url"];
|
|
129
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: !args["--print"], config });
|
|
130
130
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
131
131
|
schemaPathFromArg: args["--schema"],
|
|
132
132
|
schemaPathFromConfig: config.schema,
|
|
133
133
|
printLoadMessage: false,
|
|
134
134
|
allowNull: true
|
|
135
135
|
});
|
|
136
|
+
(0, import_internals.checkUnsupportedDataProxy)({
|
|
137
|
+
cmd: "db pull",
|
|
138
|
+
schemaContext: schemaContext && !url ? schemaContext : void 0,
|
|
139
|
+
urls: [url]
|
|
140
|
+
});
|
|
136
141
|
if (schemaContext && !args["--print"]) {
|
|
137
142
|
process.stdout.write((0, import_chunk_SKRR5WT4.dim)(`Prisma schema loaded from ${schemaContext.loadedFromPathForLogMessages}`) + "\n");
|
|
138
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
139
143
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext?.primaryDatasource) });
|
|
140
|
-
} else {
|
|
141
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: false, config });
|
|
142
144
|
}
|
|
143
145
|
const fromD1 = Boolean(args["--local-d1"]);
|
|
144
146
|
if (!url && !schemaContext && !fromD1) {
|
|
@@ -237,9 +239,7 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
|
237
239
|
)} for more info.`);
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
|
-
const engine = new
|
|
241
|
-
schemaPath: schemaContext?.schemaPath ?? void 0
|
|
242
|
-
});
|
|
242
|
+
const engine = new import_chunk_GJOWPAIF.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());
|
|
@@ -26,15 +26,15 @@ 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_3UZQE4GG_exports = {};
|
|
30
|
+
__export2(chunk_3UZQE4GG_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_3UZQE4GG_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_GJOWPAIF = require("./chunk-GJOWPAIF.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");
|
|
@@ -729,18 +729,15 @@ var logUpdateStderr = createLogUpdate(import_node_process.default.stderr);
|
|
|
729
729
|
var packageJson = eval(`require('../package.json')`);
|
|
730
730
|
var Migrate = class {
|
|
731
731
|
engine;
|
|
732
|
-
|
|
732
|
+
schemaContext;
|
|
733
733
|
migrationsDirectoryPath;
|
|
734
|
-
constructor(
|
|
735
|
-
if (
|
|
736
|
-
this.
|
|
737
|
-
this.migrationsDirectoryPath = import_path.default.join(import_path.default.dirname(
|
|
738
|
-
this.engine = new
|
|
739
|
-
schemaPath: this.schemaPath,
|
|
740
|
-
enabledPreviewFeatures
|
|
741
|
-
});
|
|
734
|
+
constructor(schemaContext, enabledPreviewFeatures) {
|
|
735
|
+
if (schemaContext) {
|
|
736
|
+
this.schemaContext = schemaContext;
|
|
737
|
+
this.migrationsDirectoryPath = import_path.default.join(import_path.default.dirname(schemaContext.schemaPath), "migrations");
|
|
738
|
+
this.engine = new import_chunk_GJOWPAIF.SchemaEngine({ schemaContext, enabledPreviewFeatures });
|
|
742
739
|
} else {
|
|
743
|
-
this.engine = new
|
|
740
|
+
this.engine = new import_chunk_GJOWPAIF.SchemaEngine({
|
|
744
741
|
enabledPreviewFeatures
|
|
745
742
|
});
|
|
746
743
|
}
|
|
@@ -749,8 +746,8 @@ var Migrate = class {
|
|
|
749
746
|
this.engine.stop();
|
|
750
747
|
}
|
|
751
748
|
getPrismaSchema() {
|
|
752
|
-
if (!this.
|
|
753
|
-
return (0, import_internals.
|
|
749
|
+
if (!this.schemaContext) throw new Error("this.schemaContext is undefined");
|
|
750
|
+
return (0, import_internals.toSchemasContainer)(this.schemaContext.schemaFiles);
|
|
754
751
|
}
|
|
755
752
|
reset() {
|
|
756
753
|
return this.engine.reset();
|
|
@@ -840,14 +837,14 @@ var Migrate = class {
|
|
|
840
837
|
async evaluateDataLoss() {
|
|
841
838
|
if (!this.migrationsDirectoryPath) throw new Error("this.migrationsDirectoryPath is undefined");
|
|
842
839
|
const migrationsList = await (0, import_chunk_V6PVGSDJ.listMigrations)(this.migrationsDirectoryPath);
|
|
843
|
-
const schema =
|
|
840
|
+
const schema = this.getPrismaSchema();
|
|
844
841
|
return this.engine.evaluateDataLoss({
|
|
845
842
|
migrationsList,
|
|
846
843
|
schema
|
|
847
844
|
});
|
|
848
845
|
}
|
|
849
846
|
async push({ force = false }) {
|
|
850
|
-
const schema =
|
|
847
|
+
const schema = this.getPrismaSchema();
|
|
851
848
|
const { warnings, unexecutable, executedSteps } = await this.engine.schemaPush({
|
|
852
849
|
force,
|
|
853
850
|
schema
|
|
@@ -859,13 +856,13 @@ var Migrate = class {
|
|
|
859
856
|
};
|
|
860
857
|
}
|
|
861
858
|
async tryToRunGenerate(datasourceInfo) {
|
|
862
|
-
if (!this.
|
|
859
|
+
if (!this.schemaContext) throw new Error("this.schemaContext is undefined");
|
|
863
860
|
const skipEngines = (0, import_internals.isPrismaPostgres)(datasourceInfo.url);
|
|
864
861
|
const message = [];
|
|
865
862
|
process.stdout.write("\n");
|
|
866
863
|
log_update_default(`Running generate... ${(0, import_chunk_SKRR5WT4.dim)("(Use --skip-generate to skip the generators)")}`);
|
|
867
864
|
const generators = await (0, import_internals.getGenerators)({
|
|
868
|
-
|
|
865
|
+
schemaContext: this.schemaContext,
|
|
869
866
|
printDownloadProgress: true,
|
|
870
867
|
version: import_engines_version.enginesVersion,
|
|
871
868
|
cliVersion: packageJson.version,
|
|
@@ -26,15 +26,15 @@ 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_7MOSA4HD_exports = {};
|
|
30
|
+
__export(chunk_7MOSA4HD_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_7MOSA4HD_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_3UZQE4GG = require("./chunk-3UZQE4GG.js");
|
|
38
38
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
39
39
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
40
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
@@ -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.36",
|
|
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",
|
|
@@ -10847,7 +10847,7 @@ async function getConfig(options) {
|
|
|
10847
10847
|
"@prisma/prisma-schema-wasm get_config",
|
|
10848
10848
|
"FMT_CLI",
|
|
10849
10849
|
/* schemaPath */
|
|
10850
|
-
|
|
10850
|
+
void 0,
|
|
10851
10851
|
/* schema */
|
|
10852
10852
|
toMultipleSchemas(options.datamodel)
|
|
10853
10853
|
);
|
|
@@ -11295,7 +11295,10 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11295
11295
|
if ((0, import_internals.isError)(args)) {
|
|
11296
11296
|
return this.help(args.message);
|
|
11297
11297
|
}
|
|
11298
|
-
|
|
11298
|
+
(0, import_internals.checkUnsupportedDataProxy)({
|
|
11299
|
+
cmd: "migrate diff",
|
|
11300
|
+
urls: [args["--to-url"], args["--from-url"], args["--shadow-database-url"]]
|
|
11301
|
+
});
|
|
11299
11302
|
if (args["--help"]) {
|
|
11300
11303
|
return this.help();
|
|
11301
11304
|
}
|
|
@@ -11323,13 +11326,15 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11323
11326
|
};
|
|
11324
11327
|
} else if (args["--from-schema-datasource"]) {
|
|
11325
11328
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
|
|
11326
|
-
const
|
|
11327
|
-
|
|
11329
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
11330
|
+
schemaPathFromArg: args["--from-schema-datasource"],
|
|
11331
|
+
schemaPathArgumentName: "--from-schema-datasource",
|
|
11332
|
+
printLoadMessage: false
|
|
11328
11333
|
});
|
|
11329
|
-
|
|
11334
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate diff", schemaContext });
|
|
11330
11335
|
from = {
|
|
11331
11336
|
tag: "schemaDatasource",
|
|
11332
|
-
...(0, import_internals.toSchemasWithConfigDir)(
|
|
11337
|
+
...(0, import_internals.toSchemasWithConfigDir)(schemaContext)
|
|
11333
11338
|
};
|
|
11334
11339
|
} else if (args["--from-schema-datamodel"]) {
|
|
11335
11340
|
const schema = await getSchemaWithPath(import_path.default.resolve(args["--from-schema-datamodel"]), config.schema, {
|
|
@@ -11363,13 +11368,15 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11363
11368
|
};
|
|
11364
11369
|
} else if (args["--to-schema-datasource"]) {
|
|
11365
11370
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
|
|
11366
|
-
const
|
|
11367
|
-
|
|
11371
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
11372
|
+
schemaPathFromArg: args["--to-schema-datasource"],
|
|
11373
|
+
schemaPathArgumentName: "--to-schema-datasource",
|
|
11374
|
+
printLoadMessage: false
|
|
11368
11375
|
});
|
|
11369
|
-
|
|
11376
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate diff", schemaContext });
|
|
11370
11377
|
to = {
|
|
11371
11378
|
tag: "schemaDatasource",
|
|
11372
|
-
...(0, import_internals.toSchemasWithConfigDir)(
|
|
11379
|
+
...(0, import_internals.toSchemasWithConfigDir)(schemaContext)
|
|
11373
11380
|
};
|
|
11374
11381
|
} else if (args["--to-schema-datamodel"]) {
|
|
11375
11382
|
const schema = await getSchemaWithPath(import_path.default.resolve(args["--to-schema-datamodel"]), config.schema, {
|
|
@@ -11396,7 +11403,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11396
11403
|
url: `file:${d1Database}`
|
|
11397
11404
|
};
|
|
11398
11405
|
}
|
|
11399
|
-
const migrate = new
|
|
11406
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate();
|
|
11400
11407
|
const captureStdout = new import_chunk_VAJ4VX67.CaptureStdout();
|
|
11401
11408
|
const outputPath = args["--output"];
|
|
11402
11409
|
const isOutputDefined = Boolean(outputPath);
|
|
@@ -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_DAIY6TJJ_exports = {};
|
|
30
|
+
__export(chunk_DAIY6TJJ_exports, {
|
|
31
31
|
MigrateDeploy: () => MigrateDeploy
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_DAIY6TJJ_exports);
|
|
34
34
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.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");
|
|
@@ -80,7 +80,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
80
80
|
if ((0, import_internals.isError)(args)) {
|
|
81
81
|
return this.help(args.message);
|
|
82
82
|
}
|
|
83
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate deploy", args, config.schema, true);
|
|
84
83
|
if (args["--help"]) {
|
|
85
84
|
return this.help();
|
|
86
85
|
}
|
|
@@ -89,8 +88,9 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
89
88
|
schemaPathFromArg: args["--schema"],
|
|
90
89
|
schemaPathFromConfig: config.schema
|
|
91
90
|
});
|
|
91
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate deploy", schemaContext });
|
|
92
92
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource) });
|
|
93
|
-
const migrate = new
|
|
93
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
94
94
|
try {
|
|
95
95
|
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
96
96
|
if (wasDbCreated) {
|
|
@@ -16,32 +16,32 @@ 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_DC5EDFYV_exports = {};
|
|
20
|
+
__export(chunk_DC5EDFYV_exports, {
|
|
21
21
|
introspectSql: () => introspectSql
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_DC5EDFYV_exports);
|
|
24
|
+
var import_chunk_GJOWPAIF = require("./chunk-GJOWPAIF.js");
|
|
25
25
|
var import_internals = require("@prisma/internals");
|
|
26
26
|
var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
|
|
27
|
-
async function introspectSql(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!supportedProviders.includes(config.datasources?.[0]?.activeProvider)) {
|
|
31
|
-
throw new Error(`Typed SQL is supported only for ${supportedProviders.join(", ")} providers`);
|
|
32
|
-
}
|
|
33
|
-
if (!isTypedSqlEnabled(config)) {
|
|
34
|
-
throw new Error(`\`typedSql\` preview feature needs to be enabled in ${schema.schemaPath}`);
|
|
27
|
+
async function introspectSql(schemaContext, queries) {
|
|
28
|
+
if (!isTypedSqlEnabled(schemaContext.generators)) {
|
|
29
|
+
throw new Error(`\`typedSql\` preview feature needs to be enabled in ${schemaContext.loadedFromPathForLogMessages}`);
|
|
35
30
|
}
|
|
36
|
-
const firstDatasource =
|
|
31
|
+
const firstDatasource = schemaContext.primaryDatasource;
|
|
37
32
|
if (!firstDatasource) {
|
|
38
|
-
throw new Error(`Could not find datasource in schema ${
|
|
33
|
+
throw new Error(`Could not find datasource in schema ${schemaContext.loadedFromPathForLogMessages}`);
|
|
34
|
+
}
|
|
35
|
+
if (!supportedProviders.includes(firstDatasource.activeProvider)) {
|
|
36
|
+
throw new Error(`Typed SQL is supported only for ${supportedProviders.join(", ")} providers`);
|
|
39
37
|
}
|
|
40
38
|
const url = (0, import_internals.getEffectiveUrl)(firstDatasource).value;
|
|
41
39
|
if (!url) {
|
|
42
|
-
throw new Error(
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Could not get url from datasource ${firstDatasource.name} in ${schemaContext.loadedFromPathForLogMessages}`
|
|
42
|
+
);
|
|
43
43
|
}
|
|
44
|
-
const schemaEngine = new
|
|
44
|
+
const schemaEngine = new import_chunk_GJOWPAIF.SchemaEngine({ schemaContext });
|
|
45
45
|
const results = [];
|
|
46
46
|
const errors = [];
|
|
47
47
|
try {
|
|
@@ -91,6 +91,6 @@ async function introspectSingleQuery(schemaEngine, url, query) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function isTypedSqlEnabled(
|
|
95
|
-
return
|
|
94
|
+
function isTypedSqlEnabled(generators) {
|
|
95
|
+
return generators.some((gen) => gen?.previewFeatures?.includes("typedSql"));
|
|
96
96
|
}
|
|
@@ -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_ESVIUEQS_exports = {};
|
|
30
|
+
__export(chunk_ESVIUEQS_exports, {
|
|
31
31
|
DbPush: () => DbPush
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_ESVIUEQS_exports);
|
|
34
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.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");
|
|
@@ -87,7 +87,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
87
87
|
if ((0, import_internals.isError)(args)) {
|
|
88
88
|
return this.help(args.message);
|
|
89
89
|
}
|
|
90
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db push", args, config.schema, true);
|
|
91
90
|
if (args["--help"]) {
|
|
92
91
|
return this.help();
|
|
93
92
|
}
|
|
@@ -96,9 +95,10 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
96
95
|
schemaPathFromArg: args["--schema"],
|
|
97
96
|
schemaPathFromConfig: config.schema
|
|
98
97
|
});
|
|
98
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "db push", schemaContext });
|
|
99
99
|
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
100
100
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
101
|
-
const migrate = new
|
|
101
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
102
102
|
try {
|
|
103
103
|
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
104
104
|
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_EYLNYDMQ_exports = {};
|
|
30
|
+
__export(chunk_EYLNYDMQ_exports, {
|
|
31
31
|
MigrateDev: () => MigrateDev
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_EYLNYDMQ_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_3UZQE4GG = require("./chunk-3UZQE4GG.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");
|
|
@@ -96,7 +96,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
96
96
|
if ((0, import_internals.isError)(args)) {
|
|
97
97
|
return this.help(args.message);
|
|
98
98
|
}
|
|
99
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate dev", args, config.schema, true);
|
|
100
99
|
if (args["--help"]) {
|
|
101
100
|
return this.help();
|
|
102
101
|
}
|
|
@@ -105,6 +104,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
105
104
|
schemaPathFromArg: args["--schema"],
|
|
106
105
|
schemaPathFromConfig: config.schema
|
|
107
106
|
});
|
|
107
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "migrate dev", schemaContext });
|
|
108
108
|
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
109
109
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
110
110
|
process.stdout.write("\n");
|
|
@@ -113,7 +113,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
113
113
|
if (wasDbCreated) {
|
|
114
114
|
process.stdout.write(wasDbCreated + "\n\n");
|
|
115
115
|
}
|
|
116
|
-
const migrate = new
|
|
116
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
117
117
|
let devDiagnostic;
|
|
118
118
|
try {
|
|
119
119
|
devDiagnostic = await migrate.devDiagnostic();
|
|
@@ -219,7 +219,7 @@ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)(
|
|
|
219
219
|
const createMigrationResult = await migrate.createMigration({
|
|
220
220
|
migrationName: migrationName || "",
|
|
221
221
|
draft: args["--create-only"] ? true : false,
|
|
222
|
-
schema:
|
|
222
|
+
schema: migrate.getPrismaSchema()
|
|
223
223
|
});
|
|
224
224
|
debug({ createMigrationResult });
|
|
225
225
|
if (args["--create-only"]) {
|