@prisma/migrate 6.6.0-dev.33 → 6.6.0-dev.35
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-5Q5BJS5B.js → chunk-3UZQE4GG.js} +17 -20
- package/dist/{chunk-5TVEADGM.js → chunk-57DMBHT4.js} +7 -7
- package/dist/{chunk-ZCR4PTT3.js → chunk-6CDC4LKK.js} +6 -6
- package/dist/{chunk-AM7BRZFD.js → chunk-BNKLVHTO.js} +5 -5
- package/dist/{chunk-ABQZ5J74.js → chunk-DC5EDFYV.js} +18 -18
- package/dist/{chunk-BUAYZ4KA.js → chunk-FOXCUMLD.js} +5 -5
- package/dist/{chunk-RP5RYCUZ.js → chunk-G5VYSYAH.js} +6 -6
- package/dist/{chunk-GHZAN2PG.js → chunk-GJOWPAIF.js} +12 -14
- package/dist/{chunk-IRYXRMQC.js → chunk-JY6YRJJQ.js} +5 -5
- package/dist/{chunk-HQJ7FIWN.js → chunk-NPRWO4MH.js} +6 -6
- package/dist/{chunk-63ZT25OL.js → chunk-O62JIWG5.js} +5 -5
- package/dist/{chunk-SCH55BRJ.js → chunk-S5Z7ZTL7.js} +5 -7
- package/dist/{chunk-MTJFLQI4.js → chunk-SYAPKGQF.js} +5 -5
- package/dist/{chunk-LAEOX7QH.js → chunk-VOEEL25V.js} +5 -5
- 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 +26 -26
- package/dist/internals/src/cli/schemaContext.d.ts +16 -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/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_BNKLVHTO = require("./chunk-BNKLVHTO.js");
|
|
28
|
+
var import_chunk_NPRWO4MH = require("./chunk-NPRWO4MH.js");
|
|
29
|
+
var import_chunk_FOXCUMLD = require("./chunk-FOXCUMLD.js");
|
|
30
|
+
var import_chunk_VOEEL25V = require("./chunk-VOEEL25V.js");
|
|
31
|
+
var import_chunk_S5Z7ZTL7 = require("./chunk-S5Z7ZTL7.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_O62JIWG5 = require("./chunk-O62JIWG5.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_JY6YRJJQ = require("./chunk-JY6YRJJQ.js");
|
|
44
|
+
var import_chunk_6CDC4LKK = require("./chunk-6CDC4LKK.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_57DMBHT4 = require("./chunk-57DMBHT4.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.35";
|
|
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_6CDC4LKK.MigrateDev.new(),
|
|
96
|
+
status: import_chunk_FOXCUMLD.MigrateStatus.new(),
|
|
97
|
+
resolve: import_chunk_NPRWO4MH.MigrateResolve.new(),
|
|
98
|
+
reset: import_chunk_BNKLVHTO.MigrateReset.new(),
|
|
99
|
+
deploy: import_chunk_JY6YRJJQ.MigrateDeploy.new(),
|
|
100
|
+
diff: import_chunk_57DMBHT4.MigrateDiff.new()
|
|
101
101
|
}),
|
|
102
102
|
db: import_chunk_EJG7GKM7.DbCommand.new({
|
|
103
|
-
execute:
|
|
104
|
-
pull:
|
|
105
|
-
push:
|
|
103
|
+
execute: import_chunk_VOEEL25V.DbExecute.new(),
|
|
104
|
+
pull: import_chunk_S5Z7ZTL7.DbPull.new(),
|
|
105
|
+
push: import_chunk_O62JIWG5.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,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_57DMBHT4_exports = {};
|
|
30
|
+
__export(chunk_57DMBHT4_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_57DMBHT4_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.35",
|
|
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
|
);
|
|
@@ -11396,7 +11396,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11396
11396
|
url: `file:${d1Database}`
|
|
11397
11397
|
};
|
|
11398
11398
|
}
|
|
11399
|
-
const migrate = new
|
|
11399
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate();
|
|
11400
11400
|
const captureStdout = new import_chunk_VAJ4VX67.CaptureStdout();
|
|
11401
11401
|
const outputPath = args["--output"];
|
|
11402
11402
|
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_6CDC4LKK_exports = {};
|
|
30
|
+
__export(chunk_6CDC4LKK_exports, {
|
|
31
31
|
MigrateDev: () => MigrateDev
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_6CDC4LKK_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");
|
|
@@ -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"]) {
|
|
@@ -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_BNKLVHTO_exports = {};
|
|
30
|
+
__export(chunk_BNKLVHTO_exports, {
|
|
31
31
|
MigrateReset: () => MigrateReset
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_BNKLVHTO_exports);
|
|
34
34
|
var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
35
35
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.js");
|
|
37
37
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
38
38
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
39
39
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
@@ -117,7 +117,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
117
117
|
process.exit(130);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
const migrate = new
|
|
120
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
121
121
|
let migrationIds;
|
|
122
122
|
try {
|
|
123
123
|
await migrate.reset();
|
|
@@ -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_FOXCUMLD_exports = {};
|
|
30
|
+
__export(chunk_FOXCUMLD_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_FOXCUMLD_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");
|
|
@@ -88,7 +88,7 @@ Check the status of your database migrations
|
|
|
88
88
|
schemaPathFromConfig: config.schema
|
|
89
89
|
});
|
|
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,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_G5VYSYAH_exports = {};
|
|
30
|
+
__export(chunk_G5VYSYAH_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_G5VYSYAH_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");
|
|
@@ -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
|
);
|
|
@@ -11396,7 +11396,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
11396
11396
|
url: `file:${d1Database}`
|
|
11397
11397
|
};
|
|
11398
11398
|
}
|
|
11399
|
-
const migrate = new
|
|
11399
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate();
|
|
11400
11400
|
const captureStdout = new import_chunk_VAJ4VX67.CaptureStdout();
|
|
11401
11401
|
const outputPath = args["--output"];
|
|
11402
11402
|
const isOutputDefined = Boolean(outputPath);
|
|
@@ -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_GJOWPAIF_exports = {};
|
|
30
|
+
__export(chunk_GJOWPAIF_exports, {
|
|
31
31
|
EngineError: () => EngineError,
|
|
32
32
|
SchemaEngine: () => SchemaEngine
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_GJOWPAIF_exports);
|
|
35
35
|
var import_chunk_G7PJKEOV = require("./chunk-G7PJKEOV.js");
|
|
36
36
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
37
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
@@ -54,7 +54,7 @@ var messageId = 1;
|
|
|
54
54
|
var SchemaEngine = class {
|
|
55
55
|
debug;
|
|
56
56
|
child;
|
|
57
|
-
|
|
57
|
+
schemaContext;
|
|
58
58
|
listeners = {};
|
|
59
59
|
/** _All_ the logs from the engine process. */
|
|
60
60
|
messages = [];
|
|
@@ -67,8 +67,8 @@ var SchemaEngine = class {
|
|
|
67
67
|
latestSchema;
|
|
68
68
|
// `isRunning` is set to true when the engine is initialized, and set to false when the engine is stopped
|
|
69
69
|
isRunning = false;
|
|
70
|
-
constructor({ debug = false,
|
|
71
|
-
this.
|
|
70
|
+
constructor({ debug = false, schemaContext, enabledPreviewFeatures }) {
|
|
71
|
+
this.schemaContext = schemaContext;
|
|
72
72
|
if (debug) {
|
|
73
73
|
import_debug.default.enable("SchemaEngine*");
|
|
74
74
|
}
|
|
@@ -174,7 +174,7 @@ var SchemaEngine = class {
|
|
|
174
174
|
);
|
|
175
175
|
const { views } = introspectResult;
|
|
176
176
|
if (views) {
|
|
177
|
-
const schemaPath = this.schemaPath ?? import_node_path.default.join(process.cwd(), "prisma");
|
|
177
|
+
const schemaPath = this.schemaContext?.schemaPath ?? import_node_path.default.join(process.cwd(), "prisma");
|
|
178
178
|
await (0, import_chunk_G7PJKEOV.handleViewsIO)({ views, schemaPath });
|
|
179
179
|
}
|
|
180
180
|
return introspectResult;
|
|
@@ -294,11 +294,9 @@ var SchemaEngine = class {
|
|
|
294
294
|
debugRpc("starting Schema engine with binary: " + binaryPath);
|
|
295
295
|
const args = [];
|
|
296
296
|
let projectDir = process.cwd();
|
|
297
|
-
if (this.
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
projectDir = (0, import_internals.getMigrateConfigDir)(config, this.schemaPath);
|
|
301
|
-
const schemaArgs = schema.flatMap(([path2]) => ["-d", path2]);
|
|
297
|
+
if (this.schemaContext) {
|
|
298
|
+
projectDir = this.schemaContext.primaryDatasourceDirectory;
|
|
299
|
+
const schemaArgs = this.schemaContext.schemaFiles.flatMap(([path2]) => ["-d", path2]);
|
|
302
300
|
args.push(...schemaArgs);
|
|
303
301
|
}
|
|
304
302
|
if (this.enabledPreviewFeatures && Array.isArray(this.enabledPreviewFeatures) && this.enabledPreviewFeatures.length > 0) {
|
|
@@ -339,7 +337,7 @@ ${this.lastError?.backtrace ?? ""}`;
|
|
|
339
337
|
this.lastRequest,
|
|
340
338
|
import_internals.ErrorArea.LIFT_CLI,
|
|
341
339
|
/* schemaPath */
|
|
342
|
-
this.
|
|
340
|
+
this.schemaContext?.loadedFromPathForLogMessages,
|
|
343
341
|
/* schema */
|
|
344
342
|
this.latestSchema?.files.map((schema) => [schema.path, schema.content])
|
|
345
343
|
)
|
|
@@ -415,7 +413,7 @@ ${response.error.data?.message ?? ""}`;
|
|
|
415
413
|
this.lastRequest,
|
|
416
414
|
import_internals.ErrorArea.LIFT_CLI,
|
|
417
415
|
/* schemaPath */
|
|
418
|
-
this.
|
|
416
|
+
this.schemaContext?.loadedFromPathForLogMessages,
|
|
419
417
|
/* schema */
|
|
420
418
|
this.latestSchema?.files.map((schema) => [schema.path, schema.content])
|
|
421
419
|
)
|
|
@@ -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_JY6YRJJQ_exports = {};
|
|
30
|
+
__export(chunk_JY6YRJJQ_exports, {
|
|
31
31
|
MigrateDeploy: () => MigrateDeploy
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_JY6YRJJQ_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");
|
|
@@ -90,7 +90,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
90
90
|
schemaPathFromConfig: config.schema
|
|
91
91
|
});
|
|
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,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_NPRWO4MH_exports = {};
|
|
20
|
+
__export(chunk_NPRWO4MH_exports, {
|
|
21
21
|
MigrateResolve: () => MigrateResolve
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_NPRWO4MH_exports);
|
|
24
|
+
var import_chunk_3UZQE4GG = require("./chunk-3UZQE4GG.js");
|
|
25
25
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
26
26
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
27
27
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
@@ -108,7 +108,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_in
|
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
111
|
-
const migrate = new
|
|
111
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
112
112
|
try {
|
|
113
113
|
await migrate.markMigrationApplied({
|
|
114
114
|
migrationId: args["--applied"]
|
|
@@ -129,7 +129,7 @@ Migration ${args["--applied"]} marked as applied.
|
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
132
|
-
const migrate = new
|
|
132
|
+
const migrate = new import_chunk_3UZQE4GG.Migrate(schemaContext);
|
|
133
133
|
try {
|
|
134
134
|
await migrate.markMigrationRolledBack({
|
|
135
135
|
migrationId: args["--rolled-back"]
|
|
@@ -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_O62JIWG5_exports = {};
|
|
30
|
+
__export(chunk_O62JIWG5_exports, {
|
|
31
31
|
DbPush: () => DbPush
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_O62JIWG5_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");
|
|
@@ -98,7 +98,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
98
98
|
});
|
|
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) {
|