@prisma/migrate 6.4.0-dev.6 → 6.4.0-dev.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CLI.js +3 -3
- package/dist/Migrate.js +4 -4
- package/dist/SchemaEngine.js +4 -4
- package/dist/bin.js +61 -47
- package/dist/{chunk-HAJNCOW7.js → chunk-26XQQ4AG.js} +25 -23
- package/dist/{chunk-I63N54YI.js → chunk-2RSEPJFX.js} +15 -13
- package/dist/{chunk-77RYI3ZW.js → chunk-4B2LXK4R.js} +14 -12
- package/dist/{chunk-CK5VLKFM.js → chunk-4UJBOCZJ.js} +7 -6
- package/dist/{chunk-43RWRQLU.js → chunk-5HZLCY6X.js} +14 -12
- package/dist/{chunk-KZEXQFQA.js → chunk-6WCHFXD2.js} +77 -43
- package/dist/{chunk-AMRGQNRR.js → chunk-75EIHNAH.js} +6 -6
- package/dist/{chunk-Q3SQU7C6.js → chunk-7S3Q4MCN.js} +4 -4
- package/dist/{chunk-G66QFMM5.js → chunk-AOX7CJAS.js} +14 -12
- package/dist/{chunk-GRGGAY6L.js → chunk-CUDKD32S.js} +159 -5
- package/dist/{chunk-CNAS3YE2.js → chunk-DUCG3NRP.js} +76 -42
- package/dist/{chunk-JESW2ENL.js → chunk-FF3526PX.js} +14 -12
- package/dist/{chunk-JZ6FKTWG.js → chunk-FUSFURVP.js} +6 -6
- package/dist/{chunk-CSUAUCRR.js → chunk-GCTCQLOF.js} +15 -13
- package/dist/{chunk-7QAR4NT3.js → chunk-K44VNAFW.js} +15 -13
- package/dist/{chunk-EYA6AFSF.js → chunk-M5YNQ2NP.js} +5 -5
- package/dist/{chunk-NJUAN6V2.js → chunk-O4BT6W33.js} +7 -6
- package/dist/{chunk-ZKWJDQMB.js → chunk-UVNSK22K.js} +7 -7
- package/dist/{chunk-WJT3IOMB.js → chunk-X6XGFLEF.js} +11 -9
- package/dist/{chunk-E2XKFV2C.js → chunk-YD7GG4WS.js} +8 -6
- package/dist/{chunk-JTNVQIRB.js → chunk-YWWOSXMY.js} +6 -6
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +5 -5
- package/dist/commands/DbPull.js +5 -5
- package/dist/commands/DbPush.js +6 -6
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +6 -6
- package/dist/commands/MigrateDev.js +6 -6
- package/dist/commands/MigrateDiff.js +5 -5
- package/dist/commands/MigrateReset.js +6 -6
- package/dist/commands/MigrateResolve.js +6 -6
- package/dist/commands/MigrateStatus.js +6 -6
- package/dist/index.js +54 -54
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +2 -1
- package/dist/internals/src/cli/getSchema.d.ts +20 -37
- package/dist/internals/src/cli/hashes.d.ts +2 -1
- package/dist/internals/src/cli/types.d.ts +2 -1
- package/dist/internals/src/index.d.ts +2 -1
- package/dist/internals/src/utils/loadEnvFile.d.ts +4 -2
- package/dist/internals/src/utils/toSchemasContainer.d.ts +1 -1
- package/dist/migrate/src/CLI.d.ts +2 -1
- package/dist/migrate/src/commands/DbCommand.d.ts +2 -1
- package/dist/migrate/src/commands/DbDrop.d.ts +2 -1
- package/dist/migrate/src/commands/DbExecute.d.ts +2 -1
- package/dist/migrate/src/commands/DbPull.d.ts +2 -1
- package/dist/migrate/src/commands/DbPush.d.ts +2 -1
- package/dist/migrate/src/commands/DbSeed.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateCommand.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDeploy.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDev.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateReset.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateResolve.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateStatus.d.ts +2 -1
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +3 -3
- package/dist/migrate/src/utils/setupPostgres.d.ts +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +4 -4
- package/dist/utils/getSchemaPathAndPrint.js +4 -4
- package/dist/utils/introspectSql.js +3 -3
- package/dist/utils/setupPostgres.js +4 -8
- package/dist/utils/spinner.js +3 -3
- package/package.json +7 -6
package/dist/CLI.js
CHANGED
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var CLI_exports = {};
|
|
20
20
|
__export(CLI_exports, {
|
|
21
|
-
CLI: () =>
|
|
21
|
+
CLI: () => import_chunk_FUSFURVP.CLI
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(CLI_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_FUSFURVP = require("./chunk-FUSFURVP.js");
|
|
25
25
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
27
|
-
(0,
|
|
27
|
+
(0, import_chunk_FUSFURVP.init_CLI)();
|
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_UVNSK22K.Migrate
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Migrate_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
25
25
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
26
26
|
var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
|
|
27
|
-
var
|
|
27
|
+
var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
|
|
28
28
|
var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
|
|
29
29
|
var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
|
|
30
30
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
31
31
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
32
|
-
(0,
|
|
32
|
+
(0, import_chunk_UVNSK22K.init_Migrate)();
|
package/dist/SchemaEngine.js
CHANGED
|
@@ -18,13 +18,13 @@ 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_7S3Q4MCN.EngineError,
|
|
22
|
+
SchemaEngine: () => import_chunk_7S3Q4MCN.SchemaEngine
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(SchemaEngine_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
|
|
26
26
|
var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
|
|
27
27
|
var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
|
|
28
28
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
29
29
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
30
|
-
(0,
|
|
30
|
+
(0, import_chunk_7S3Q4MCN.init_SchemaEngine)();
|
package/dist/bin.js
CHANGED
|
@@ -32,14 +32,14 @@ __export(bin_exports, {
|
|
|
32
32
|
default: () => bin_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(bin_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
35
|
+
var import_chunk_FUSFURVP = require("./chunk-FUSFURVP.js");
|
|
36
|
+
var import_chunk_YWWOSXMY = require("./chunk-YWWOSXMY.js");
|
|
37
|
+
var import_chunk_K44VNAFW = require("./chunk-K44VNAFW.js");
|
|
38
|
+
var import_chunk_2RSEPJFX = require("./chunk-2RSEPJFX.js");
|
|
39
|
+
var import_chunk_4B2LXK4R = require("./chunk-4B2LXK4R.js");
|
|
40
|
+
var import_chunk_AOX7CJAS = require("./chunk-AOX7CJAS.js");
|
|
41
|
+
var import_chunk_26XQQ4AG = require("./chunk-26XQQ4AG.js");
|
|
42
|
+
var import_chunk_CUDKD32S = require("./chunk-CUDKD32S.js");
|
|
43
43
|
var import_chunk_ILJRJJ3S = require("./chunk-ILJRJJ3S.js");
|
|
44
44
|
var import_chunk_YUCPBDWV = require("./chunk-YUCPBDWV.js");
|
|
45
45
|
var import_chunk_RM5LJIEV = require("./chunk-RM5LJIEV.js");
|
|
@@ -49,55 +49,56 @@ var import_chunk_V7DE6JTG = require("./chunk-V7DE6JTG.js");
|
|
|
49
49
|
var import_chunk_QBK5XTJE = require("./chunk-QBK5XTJE.js");
|
|
50
50
|
var import_chunk_INC2OACE = require("./chunk-INC2OACE.js");
|
|
51
51
|
var import_chunk_GN5BY5N2 = require("./chunk-GN5BY5N2.js");
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
52
|
+
var import_chunk_FF3526PX = require("./chunk-FF3526PX.js");
|
|
53
|
+
var import_chunk_YD7GG4WS = require("./chunk-YD7GG4WS.js");
|
|
54
|
+
var import_chunk_4UJBOCZJ = require("./chunk-4UJBOCZJ.js");
|
|
55
|
+
var import_chunk_5HZLCY6X = require("./chunk-5HZLCY6X.js");
|
|
56
|
+
var import_chunk_GCTCQLOF = require("./chunk-GCTCQLOF.js");
|
|
57
57
|
var import_chunk_IFCV5MY4 = require("./chunk-IFCV5MY4.js");
|
|
58
58
|
var import_chunk_SGCF5OHF = require("./chunk-SGCF5OHF.js");
|
|
59
59
|
var import_chunk_YKUZUAXA = require("./chunk-YKUZUAXA.js");
|
|
60
60
|
var import_chunk_WOOPRG54 = require("./chunk-WOOPRG54.js");
|
|
61
61
|
var import_chunk_6QFE3AWR = require("./chunk-6QFE3AWR.js");
|
|
62
62
|
var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
|
|
63
|
-
var
|
|
63
|
+
var import_chunk_6WCHFXD2 = require("./chunk-6WCHFXD2.js");
|
|
64
64
|
var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
|
|
65
65
|
var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
|
|
66
66
|
var import_chunk_TKAGMA5K = require("./chunk-TKAGMA5K.js");
|
|
67
|
-
var
|
|
67
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
68
68
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
69
69
|
var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
|
|
70
|
-
var
|
|
70
|
+
var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
|
|
71
71
|
var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
|
|
72
72
|
var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
|
|
73
|
-
var
|
|
73
|
+
var import_chunk_O4BT6W33 = require("./chunk-O4BT6W33.js");
|
|
74
74
|
var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
|
|
75
|
-
var
|
|
75
|
+
var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
|
|
76
76
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
|
77
77
|
var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
|
|
78
78
|
var import_chunk_KPUNMK5W = require("./chunk-KPUNMK5W.js");
|
|
79
79
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
80
80
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
81
|
+
var import_config = require("@prisma/config");
|
|
81
82
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
82
83
|
var import_engines_version = require("@prisma/engines-version");
|
|
83
84
|
var import_internals = require("@prisma/internals");
|
|
84
85
|
var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
85
86
|
"src/bin.ts"(exports, module) {
|
|
86
87
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
87
|
-
(0,
|
|
88
|
-
(0,
|
|
89
|
-
(0,
|
|
90
|
-
(0,
|
|
91
|
-
(0,
|
|
92
|
-
(0,
|
|
93
|
-
(0,
|
|
94
|
-
(0,
|
|
95
|
-
(0,
|
|
96
|
-
(0,
|
|
97
|
-
(0,
|
|
98
|
-
(0,
|
|
99
|
-
(0,
|
|
100
|
-
(0,
|
|
88
|
+
(0, import_chunk_FUSFURVP.init_CLI)();
|
|
89
|
+
(0, import_chunk_O4BT6W33.init_DbCommand)();
|
|
90
|
+
(0, import_chunk_AOX7CJAS.init_DbExecute)();
|
|
91
|
+
(0, import_chunk_26XQQ4AG.init_DbPull)();
|
|
92
|
+
(0, import_chunk_FF3526PX.init_DbPush)();
|
|
93
|
+
(0, import_chunk_YD7GG4WS.init_DbSeed)();
|
|
94
|
+
(0, import_chunk_4UJBOCZJ.init_MigrateCommand)();
|
|
95
|
+
(0, import_chunk_5HZLCY6X.init_MigrateDeploy)();
|
|
96
|
+
(0, import_chunk_GCTCQLOF.init_MigrateDev)();
|
|
97
|
+
(0, import_chunk_6WCHFXD2.init_MigrateDiff)();
|
|
98
|
+
(0, import_chunk_K44VNAFW.init_MigrateReset)();
|
|
99
|
+
(0, import_chunk_2RSEPJFX.init_MigrateResolve)();
|
|
100
|
+
(0, import_chunk_4B2LXK4R.init_MigrateStatus)();
|
|
101
|
+
(0, import_chunk_YWWOSXMY.init_getDatabaseVersionSafe)();
|
|
101
102
|
process.on("uncaughtException", (e) => {
|
|
102
103
|
console.log(e);
|
|
103
104
|
});
|
|
@@ -108,26 +109,39 @@ var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
108
109
|
process.exit(130);
|
|
109
110
|
});
|
|
110
111
|
var commandArray = process.argv.slice(2);
|
|
112
|
+
var args = (0, import_internals.arg)(
|
|
113
|
+
commandArray,
|
|
114
|
+
{
|
|
115
|
+
"--config": String
|
|
116
|
+
},
|
|
117
|
+
false,
|
|
118
|
+
true
|
|
119
|
+
);
|
|
111
120
|
var packageJson = eval(`require('../package.json')`);
|
|
112
121
|
async function main() {
|
|
113
|
-
const cli =
|
|
114
|
-
migrate:
|
|
115
|
-
dev:
|
|
116
|
-
status:
|
|
117
|
-
resolve:
|
|
118
|
-
reset:
|
|
119
|
-
deploy:
|
|
120
|
-
diff:
|
|
122
|
+
const cli = import_chunk_FUSFURVP.CLI.new({
|
|
123
|
+
migrate: import_chunk_4UJBOCZJ.MigrateCommand.new({
|
|
124
|
+
dev: import_chunk_GCTCQLOF.MigrateDev.new(),
|
|
125
|
+
status: import_chunk_4B2LXK4R.MigrateStatus.new(),
|
|
126
|
+
resolve: import_chunk_2RSEPJFX.MigrateResolve.new(),
|
|
127
|
+
reset: import_chunk_K44VNAFW.MigrateReset.new(),
|
|
128
|
+
deploy: import_chunk_5HZLCY6X.MigrateDeploy.new(),
|
|
129
|
+
diff: import_chunk_6WCHFXD2.MigrateDiff.new()
|
|
121
130
|
}),
|
|
122
|
-
db:
|
|
123
|
-
execute:
|
|
124
|
-
pull:
|
|
125
|
-
push:
|
|
131
|
+
db: import_chunk_O4BT6W33.DbCommand.new({
|
|
132
|
+
execute: import_chunk_AOX7CJAS.DbExecute.new(),
|
|
133
|
+
pull: import_chunk_26XQQ4AG.DbPull.new(),
|
|
134
|
+
push: import_chunk_FF3526PX.DbPush.new(),
|
|
126
135
|
// drop: DbDrop.new(),
|
|
127
|
-
seed:
|
|
136
|
+
seed: import_chunk_YD7GG4WS.DbSeed.new()
|
|
128
137
|
})
|
|
129
138
|
});
|
|
130
|
-
const
|
|
139
|
+
const { config, error } = await (0, import_config.loadConfigFromFile)({ configFile: args["--config"] });
|
|
140
|
+
if (error) {
|
|
141
|
+
console.error(`Failed to load config file: ${error._tag}`);
|
|
142
|
+
return 1;
|
|
143
|
+
}
|
|
144
|
+
const result = await cli.parse(commandArray, { ...(0, import_config.defaultConfig)(), ...config });
|
|
131
145
|
if (result instanceof import_internals.HelpError) {
|
|
132
146
|
console.error(result);
|
|
133
147
|
return 1;
|
|
@@ -149,7 +163,7 @@ var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
149
163
|
cliVersion: packageJson.version,
|
|
150
164
|
enginesVersion: import_engines_version.enginesVersion,
|
|
151
165
|
command: commandArray.join(" "),
|
|
152
|
-
getDatabaseVersionSafe:
|
|
166
|
+
getDatabaseVersionSafe: import_chunk_YWWOSXMY.getDatabaseVersionSafe
|
|
153
167
|
}).catch((e) => {
|
|
154
168
|
if (import_debug.default.enabled("migrate")) {
|
|
155
169
|
console.error((0, import_chunk_6TE2RIPN.red)((0, import_chunk_6TE2RIPN.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_26XQQ4AG_exports = {};
|
|
30
|
+
__export(chunk_26XQQ4AG_exports, {
|
|
31
31
|
DbPull: () => DbPull,
|
|
32
32
|
init_DbPull: () => init_DbPull
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_26XQQ4AG_exports);
|
|
35
|
+
var import_chunk_CUDKD32S = require("./chunk-CUDKD32S.js");
|
|
36
36
|
var import_chunk_ILJRJJ3S = require("./chunk-ILJRJJ3S.js");
|
|
37
37
|
var import_chunk_35LAJN5S = require("./chunk-35LAJN5S.js");
|
|
38
38
|
var import_chunk_7IT2ZO3D = require("./chunk-7IT2ZO3D.js");
|
|
@@ -40,7 +40,7 @@ var import_chunk_V7DE6JTG = require("./chunk-V7DE6JTG.js");
|
|
|
40
40
|
var import_chunk_QBK5XTJE = require("./chunk-QBK5XTJE.js");
|
|
41
41
|
var import_chunk_INC2OACE = require("./chunk-INC2OACE.js");
|
|
42
42
|
var import_chunk_GN5BY5N2 = require("./chunk-GN5BY5N2.js");
|
|
43
|
-
var
|
|
43
|
+
var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
|
|
44
44
|
var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
|
|
45
45
|
var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
|
|
46
46
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
|
@@ -55,7 +55,7 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
55
55
|
"src/commands/DbPull.ts"() {
|
|
56
56
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
57
57
|
(0, import_chunk_CQQQ436N.init_dist)();
|
|
58
|
-
(0,
|
|
58
|
+
(0, import_chunk_7S3Q4MCN.init_SchemaEngine)();
|
|
59
59
|
(0, import_chunk_GN5BY5N2.init_countModelsAndTypes)();
|
|
60
60
|
(0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
|
|
61
61
|
(0, import_chunk_U374EXYQ.init_errors)();
|
|
@@ -66,7 +66,7 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
66
66
|
(0, import_chunk_V7DE6JTG.init_removeSchemaFiles)();
|
|
67
67
|
(0, import_chunk_QBK5XTJE.init_replaceOrAddDatasource)();
|
|
68
68
|
(0, import_chunk_ILJRJJ3S.init_saveSchemaFiles)();
|
|
69
|
-
(0,
|
|
69
|
+
(0, import_chunk_CUDKD32S.init_spinner)();
|
|
70
70
|
debug = (0, import_debug.default)("prisma:db:pull");
|
|
71
71
|
_DbPull = class _DbPull2 {
|
|
72
72
|
static new() {
|
|
@@ -83,13 +83,14 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
83
83
|
}
|
|
84
84
|
]);
|
|
85
85
|
}
|
|
86
|
-
async parse(argv) {
|
|
86
|
+
async parse(argv, config) {
|
|
87
87
|
const args = (0, import_internals.arg)(argv, {
|
|
88
88
|
"--help": Boolean,
|
|
89
89
|
"-h": "--help",
|
|
90
90
|
"--url": String,
|
|
91
91
|
"--print": Boolean,
|
|
92
92
|
"--schema": String,
|
|
93
|
+
"--config": String,
|
|
93
94
|
"--schemas": String,
|
|
94
95
|
"--force": Boolean,
|
|
95
96
|
"--composite-type-depth": Number,
|
|
@@ -97,25 +98,25 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
97
98
|
"--local-d1": Boolean
|
|
98
99
|
// optional, only on cloudflare D1
|
|
99
100
|
});
|
|
100
|
-
const spinnerFactory = (0,
|
|
101
|
+
const spinnerFactory = (0, import_chunk_CUDKD32S.createSpinner)(!args["--print"]);
|
|
101
102
|
if (args instanceof Error) {
|
|
102
103
|
return this.help(args.message);
|
|
103
104
|
}
|
|
104
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db pull", args, !args["--url"]);
|
|
105
|
+
await (0, import_internals.checkUnsupportedDataProxy)("db pull", args, config.schema, !args["--url"]);
|
|
105
106
|
if (args["--help"]) {
|
|
106
107
|
return this.help();
|
|
107
108
|
}
|
|
108
109
|
const url = args["--url"];
|
|
109
|
-
const schemaPathResult = await (0, import_internals.getSchemaWithPathOptional)(args["--schema"]);
|
|
110
|
+
const schemaPathResult = await (0, import_internals.getSchemaWithPathOptional)(args["--schema"], config.schema);
|
|
110
111
|
let schemaPath = schemaPathResult?.schemaPath ?? null;
|
|
111
112
|
const rootDir = schemaPathResult?.schemaRootDir ?? process.cwd();
|
|
112
113
|
debug("schemaPathResult", schemaPathResult);
|
|
113
114
|
if (schemaPath && !args["--print"]) {
|
|
114
115
|
process.stdout.write((0, import_chunk_6TE2RIPN.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath)}`) + "\n");
|
|
115
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
|
116
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
116
117
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath }) });
|
|
117
118
|
} else {
|
|
118
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: false });
|
|
119
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: false, config });
|
|
119
120
|
}
|
|
120
121
|
const fromD1 = Boolean(args["--local-d1"]);
|
|
121
122
|
if (!url && !schemaPath && !fromD1) {
|
|
@@ -124,13 +125,13 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
124
125
|
const { firstDatasource, schema, validationWarning } = await (0, import_chunk_CQQQ436N.z)({ url, schemaPath, fromD1 }).when(
|
|
125
126
|
(input) => input.schemaPath !== null,
|
|
126
127
|
async (input) => {
|
|
127
|
-
const rawSchema = await (0, import_internals.getSchema)(input.schemaPath);
|
|
128
|
-
const
|
|
128
|
+
const rawSchema = await (0, import_internals.getSchema)(input.schemaPath, config.schema);
|
|
129
|
+
const engineConfig = await (0, import_internals.getConfig)({
|
|
129
130
|
datamodel: rawSchema,
|
|
130
131
|
ignoreEnvVarErrors: true
|
|
131
132
|
});
|
|
132
|
-
const previewFeatures =
|
|
133
|
-
const firstDatasource2 =
|
|
133
|
+
const previewFeatures = engineConfig.generators.find(({ name }) => name === "client")?.previewFeatures;
|
|
134
|
+
const firstDatasource2 = engineConfig.datasources[0] ? engineConfig.datasources[0] : void 0;
|
|
134
135
|
if (input.url) {
|
|
135
136
|
let providerFromSchema = firstDatasource2?.provider;
|
|
136
137
|
if (providerFromSchema === "postgres") {
|
|
@@ -185,26 +186,26 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
185
186
|
}
|
|
186
187
|
${this.urlToDatasource(`file:${pathToSQLiteFile}`, "sqlite")}`;
|
|
187
188
|
const schema2 = [["schema.prisma", schemaContent]];
|
|
188
|
-
const
|
|
189
|
+
const config2 = await (0, import_internals.getConfig)({
|
|
189
190
|
datamodel: schema2,
|
|
190
191
|
ignoreEnvVarErrors: true
|
|
191
192
|
});
|
|
192
|
-
return { firstDatasource:
|
|
193
|
+
return { firstDatasource: config2.datasources[0], schema: schema2, validationWarning: void 0 };
|
|
193
194
|
}
|
|
194
195
|
).when(
|
|
195
196
|
(input) => input.url !== void 0,
|
|
196
197
|
async (input) => {
|
|
197
198
|
(0, import_internals.protocolToConnectorType)(`${input.url.split(":")[0]}:`);
|
|
198
199
|
const schema2 = [["schema.prisma", this.urlToDatasource(input.url)]];
|
|
199
|
-
const
|
|
200
|
+
const config2 = await (0, import_internals.getConfig)({
|
|
200
201
|
datamodel: schema2,
|
|
201
202
|
ignoreEnvVarErrors: true
|
|
202
203
|
});
|
|
203
|
-
return { firstDatasource:
|
|
204
|
+
return { firstDatasource: config2.datasources[0], schema: schema2, validationWarning: void 0 };
|
|
204
205
|
}
|
|
205
206
|
).run();
|
|
206
207
|
if (schemaPath) {
|
|
207
|
-
const schemas = await (0, import_internals.getSchema)(args["--schema"]);
|
|
208
|
+
const schemas = await (0, import_internals.getSchema)(args["--schema"], config.schema);
|
|
208
209
|
const modelRegex = /\s*model\s*(\w+)\s*{/;
|
|
209
210
|
const isReintrospection = schemas.some(([_, schema2]) => !!modelRegex.exec(schema2));
|
|
210
211
|
if (isReintrospection && !args["--force"] && firstDatasource?.provider === "mongodb") {
|
|
@@ -217,7 +218,7 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
|
217
218
|
)} for more info.`);
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
const engine = new
|
|
221
|
+
const engine = new import_chunk_7S3Q4MCN.SchemaEngine({
|
|
221
222
|
schemaPath: schemaPath ?? void 0
|
|
222
223
|
});
|
|
223
224
|
const basedOn = !args["--url"] && schemaPath ? ` based on datasource defined in ${(0, import_chunk_6TE2RIPN.underline)(import_path.default.relative(process.cwd(), schemaPath))}` : "";
|
|
@@ -356,6 +357,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
356
357
|
|
|
357
358
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
358
359
|
|
|
360
|
+
--config Custom path to your Prisma config file
|
|
359
361
|
--schema Custom path to your Prisma schema
|
|
360
362
|
--composite-type-depth Specify the depth for introspecting composite types (e.g. Embedded Documents in MongoDB)
|
|
361
363
|
Number, default is -1 for infinite depth, 0 = off
|
|
@@ -16,14 +16,14 @@ 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_2RSEPJFX_exports = {};
|
|
20
|
+
__export(chunk_2RSEPJFX_exports, {
|
|
21
21
|
MigrateResolve: () => MigrateResolve,
|
|
22
22
|
init_MigrateResolve: () => init_MigrateResolve
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
module.exports = __toCommonJS(chunk_2RSEPJFX_exports);
|
|
25
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
26
|
+
var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
|
|
27
27
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
|
28
28
|
var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
|
|
29
29
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
@@ -33,15 +33,15 @@ var _MigrateResolve, MigrateResolve;
|
|
|
33
33
|
var init_MigrateResolve = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
34
34
|
"src/commands/MigrateResolve.ts"() {
|
|
35
35
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
36
|
-
(0,
|
|
36
|
+
(0, import_chunk_UVNSK22K.init_Migrate)();
|
|
37
37
|
(0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
|
|
38
|
-
(0,
|
|
38
|
+
(0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
|
|
39
39
|
(0, import_chunk_Q7ACZDDT.init_printDatasource)();
|
|
40
40
|
_MigrateResolve = class _MigrateResolve2 {
|
|
41
41
|
static new() {
|
|
42
42
|
return new _MigrateResolve2();
|
|
43
43
|
}
|
|
44
|
-
async parse(argv) {
|
|
44
|
+
async parse(argv, config) {
|
|
45
45
|
const args = (0, import_internals.arg)(
|
|
46
46
|
argv,
|
|
47
47
|
{
|
|
@@ -50,6 +50,7 @@ var init_MigrateResolve = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
50
50
|
"--applied": String,
|
|
51
51
|
"--rolled-back": String,
|
|
52
52
|
"--schema": String,
|
|
53
|
+
"--config": String,
|
|
53
54
|
"--telemetry-information": String
|
|
54
55
|
},
|
|
55
56
|
false
|
|
@@ -57,12 +58,12 @@ var init_MigrateResolve = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
57
58
|
if ((0, import_internals.isError)(args)) {
|
|
58
59
|
return this.help(args.message);
|
|
59
60
|
}
|
|
60
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate resolve", args, true);
|
|
61
|
+
await (0, import_internals.checkUnsupportedDataProxy)("migrate resolve", args, config.schema, true);
|
|
61
62
|
if (args["--help"]) {
|
|
62
63
|
return this.help();
|
|
63
64
|
}
|
|
64
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
|
65
|
-
const { schemaPath } = await (0,
|
|
65
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
66
|
+
const { schemaPath } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
66
67
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath }) });
|
|
67
68
|
if (!args["--applied"] && !args["--rolled-back"]) {
|
|
68
69
|
throw new Error(
|
|
@@ -82,7 +83,7 @@ ${(0, import_chunk_6TE2RIPN.bold)((0, import_chunk_6TE2RIPN.green)((0, import_in
|
|
|
82
83
|
);
|
|
83
84
|
}
|
|
84
85
|
await (0, import_chunk_XJQP3B4W.ensureCanConnectToDatabase)(schemaPath);
|
|
85
|
-
const migrate = new
|
|
86
|
+
const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
|
|
86
87
|
try {
|
|
87
88
|
await migrate.markMigrationApplied({
|
|
88
89
|
migrationId: args["--applied"]
|
|
@@ -103,7 +104,7 @@ Migration ${args["--applied"]} marked as applied.
|
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
await (0, import_chunk_XJQP3B4W.ensureCanConnectToDatabase)(schemaPath);
|
|
106
|
-
const migrate = new
|
|
107
|
+
const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
|
|
107
108
|
try {
|
|
108
109
|
await migrate.markMigrationRolledBack({
|
|
109
110
|
migrationId: args["--rolled-back"]
|
|
@@ -143,6 +144,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Usage")}
|
|
|
143
144
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
144
145
|
|
|
145
146
|
-h, --help Display this help message
|
|
147
|
+
--config Custom path to your Prisma config file
|
|
146
148
|
--schema Custom path to your Prisma schema
|
|
147
149
|
--applied Record a specific migration as applied
|
|
148
150
|
--rolled-back Record a specific migration as rolled back
|
|
@@ -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_4B2LXK4R_exports = {};
|
|
30
|
+
__export(chunk_4B2LXK4R_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus,
|
|
32
32
|
init_MigrateStatus: () => init_MigrateStatus
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_4B2LXK4R_exports);
|
|
35
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
36
|
+
var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
|
|
37
37
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
|
38
38
|
var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
|
|
39
39
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
@@ -44,22 +44,23 @@ var debug, _MigrateStatus, MigrateStatus;
|
|
|
44
44
|
var init_MigrateStatus = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
45
45
|
"src/commands/MigrateStatus.ts"() {
|
|
46
46
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
47
|
-
(0,
|
|
47
|
+
(0, import_chunk_UVNSK22K.init_Migrate)();
|
|
48
48
|
(0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
|
|
49
|
-
(0,
|
|
49
|
+
(0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
|
|
50
50
|
(0, import_chunk_Q7ACZDDT.init_printDatasource)();
|
|
51
51
|
debug = (0, import_debug.default)("prisma:migrate:status");
|
|
52
52
|
_MigrateStatus = class _MigrateStatus2 {
|
|
53
53
|
static new() {
|
|
54
54
|
return new _MigrateStatus2();
|
|
55
55
|
}
|
|
56
|
-
async parse(argv) {
|
|
56
|
+
async parse(argv, config) {
|
|
57
57
|
const args = (0, import_internals.arg)(
|
|
58
58
|
argv,
|
|
59
59
|
{
|
|
60
60
|
"--help": Boolean,
|
|
61
61
|
"-h": "--help",
|
|
62
62
|
"--schema": String,
|
|
63
|
+
"--config": String,
|
|
63
64
|
"--telemetry-information": String
|
|
64
65
|
},
|
|
65
66
|
false
|
|
@@ -67,14 +68,14 @@ var init_MigrateStatus = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
67
68
|
if ((0, import_internals.isError)(args)) {
|
|
68
69
|
return this.help(args.message);
|
|
69
70
|
}
|
|
70
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate status", args, true);
|
|
71
|
+
await (0, import_internals.checkUnsupportedDataProxy)("migrate status", args, config.schema, true);
|
|
71
72
|
if (args["--help"]) {
|
|
72
73
|
return this.help();
|
|
73
74
|
}
|
|
74
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
|
75
|
-
const { schemaPath } = await (0,
|
|
75
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
76
|
+
const { schemaPath } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
76
77
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath }) });
|
|
77
|
-
const migrate = new
|
|
78
|
+
const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
|
|
78
79
|
await (0, import_chunk_XJQP3B4W.ensureCanConnectToDatabase)(schemaPath);
|
|
79
80
|
let diagnoseResult;
|
|
80
81
|
let listMigrationDirectoriesResult;
|
|
@@ -190,6 +191,7 @@ Check the status of your database migrations
|
|
|
190
191
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
191
192
|
|
|
192
193
|
-h, --help Display this help message
|
|
194
|
+
--config Custom path to your Prisma config file
|
|
193
195
|
--schema Custom path to your Prisma schema
|
|
194
196
|
|
|
195
197
|
${(0, import_chunk_6TE2RIPN.bold)("Examples")}
|
|
@@ -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_4UJBOCZJ_exports = {};
|
|
20
|
+
__export(chunk_4UJBOCZJ_exports, {
|
|
21
21
|
MigrateCommand: () => MigrateCommand,
|
|
22
22
|
init_MigrateCommand: () => init_MigrateCommand
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(chunk_4UJBOCZJ_exports);
|
|
25
25
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
@@ -36,11 +36,11 @@ var init_MigrateCommand = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
36
36
|
static new(cmds) {
|
|
37
37
|
return new _MigrateCommand2(cmds);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
async parse(argv) {
|
|
39
|
+
async parse(argv, config) {
|
|
41
40
|
const args = (0, import_internals.arg)(argv, {
|
|
42
41
|
"--help": Boolean,
|
|
43
42
|
"-h": "--help",
|
|
43
|
+
"--config": String,
|
|
44
44
|
"--preview-feature": Boolean,
|
|
45
45
|
"--telemetry-information": String
|
|
46
46
|
});
|
|
@@ -60,7 +60,7 @@ var init_MigrateCommand = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
60
60
|
const filteredArgs = args._.filter((item) => item !== "--preview-feature");
|
|
61
61
|
argsForCmd = filteredArgs.slice(1);
|
|
62
62
|
}
|
|
63
|
-
return cmd.parse(argsForCmd);
|
|
63
|
+
return cmd.parse(argsForCmd, config);
|
|
64
64
|
}
|
|
65
65
|
return (0, import_internals.unknownCommand)(_MigrateCommand2.help, commandName);
|
|
66
66
|
}
|
|
@@ -99,6 +99,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Command for any stage")}
|
|
|
99
99
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
100
100
|
|
|
101
101
|
-h, --help Display this help message
|
|
102
|
+
--config Custom path to your Prisma config file
|
|
102
103
|
--schema Custom path to your Prisma schema
|
|
103
104
|
|
|
104
105
|
${(0, import_chunk_6TE2RIPN.bold)("Examples")}
|