@prisma/migrate 6.20.0-integration-next.2 → 6.20.0-integration-merge-release-workflows.1
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 +6 -6
- package/dist/SchemaEngineCLI.js +4 -4
- package/dist/SchemaEngineWasm.js +4 -4
- package/dist/bin.js +31 -30
- package/dist/{chunk-GH6IOZTT.js → chunk-22YP3RXZ.js} +7 -7
- package/dist/{chunk-4BAGKFIV.js → chunk-3AKRTEIK.js} +11 -10
- package/dist/{chunk-FBPXMCYK.js → chunk-6ORQRJLP.js} +109 -28
- package/dist/{chunk-EVUHOCOP.js → chunk-7TVX3D4W.js} +65 -27
- package/dist/{chunk-PEUHUCS4.js → chunk-AXR7LS2N.js} +5 -4
- package/dist/{chunk-EERZNF42.js → chunk-BHJMJSM4.js} +7 -6
- package/dist/{chunk-WF7UXKO5.js → chunk-D4TRX77Y.js} +9 -6
- package/dist/{chunk-V3D2XB5I.js → chunk-D6LYHB65.js} +29 -37
- package/dist/{chunk-BP3VX5NQ.js → chunk-F2XCBEZ4.js} +13 -10
- package/dist/{chunk-SYWL5XS4.js → chunk-GSX25HRL.js} +5 -5
- package/dist/{chunk-SFX5KEGP.js → chunk-J33EXHZB.js} +12 -9
- package/dist/{chunk-PQ3UMDEP.js → chunk-NB4FRYRQ.js} +5 -5
- package/dist/{chunk-BB43AVYJ.js → chunk-O35BTK6Y.js} +13 -9
- package/dist/{chunk-FRY7T46S.js → chunk-OP2BDF75.js} +11 -10
- package/dist/{chunk-L7EZFBB4.js → chunk-PHXLQVPT.js} +68 -40
- package/dist/{chunk-XA2JOJS2.js → chunk-QVMYNWAN.js} +70 -157
- package/dist/{chunk-Z7WLEGCP.js → chunk-R4IWP35Z.js} +9 -8
- package/dist/chunk-RR6BKMNO.js +80 -0
- package/dist/{chunk-6FL2LODV.js → chunk-TW22Y3AA.js} +7 -6
- package/dist/{chunk-T2ACIU5M.js → chunk-VU5BLQUI.js} +8 -14
- package/dist/{chunk-JX2HIV7V.js → chunk-VV4M6AN7.js} +10 -10
- package/dist/{chunk-GY34KW2I.js → chunk-Z27SI4AV.js} +4 -6
- package/dist/{chunk-QCMPSEBY.js → chunk-ZTIS675B.js} +205 -138
- package/dist/commands/DbDrop.js +2 -2
- package/dist/commands/DbExecute.js +7 -7
- package/dist/commands/DbPull.js +9 -8
- package/dist/commands/DbPush.js +7 -7
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDeploy.js +7 -7
- package/dist/commands/MigrateDev.js +8 -8
- package/dist/commands/MigrateDiff.js +7 -8
- package/dist/commands/MigrateReset.js +8 -8
- package/dist/commands/MigrateResolve.js +7 -7
- package/dist/commands/MigrateStatus.js +7 -7
- package/dist/index.js +37 -36
- package/dist/internals/src/cli/getSchema.d.ts +15 -1
- package/dist/migrate/src/Migrate.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDiff.d.ts +0 -1
- package/dist/migrate/src/utils/introspectSql.d.ts +1 -2
- package/dist/migrate/src/utils/replaceOrAddDatasource.d.ts +2 -0
- package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +1 -0
- package/dist/migrate/src/utils/seed.d.ts +6 -0
- package/dist/utils/getDatabaseVersionSafe.js +7 -7
- package/dist/utils/introspectSql.js +7 -7
- package/dist/utils/replaceOrAddDatasource.js +25 -0
- package/dist/utils/replaceOrAddDatasource.test.js +207 -0
- package/dist/utils/seed.js +3 -2
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +30480 -31090
- package/dist/utils/setupMongo.js +768 -2048
- package/dist/utils/setupPostgres.js +2 -2
- package/dist/utils/spinner.js +3 -3
- package/dist/views/handleViewsIO.js +2 -2
- package/package.json +11 -11
- package/dist/open-GFNXULGD.js +0 -593
|
@@ -26,19 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_NB4FRYRQ_exports = {};
|
|
30
|
+
__export(chunk_NB4FRYRQ_exports, {
|
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_NB4FRYRQ_exports);
|
|
34
|
+
var import_chunk_D6LYHB65 = require("./chunk-D6LYHB65.js");
|
|
35
35
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
36
36
|
var debug = (0, import_debug.default)("prisma:cli");
|
|
37
37
|
async function getDatabaseVersionSafe(args) {
|
|
38
38
|
let migrate;
|
|
39
39
|
let dbVersion;
|
|
40
40
|
try {
|
|
41
|
-
migrate = await
|
|
41
|
+
migrate = await import_chunk_D6LYHB65.Migrate.setup({});
|
|
42
42
|
dbVersion = await migrate.engine.getDatabaseVersion(args);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
debug(e);
|
|
@@ -16,14 +16,15 @@ 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_O35BTK6Y_exports = {};
|
|
20
|
+
__export(chunk_O35BTK6Y_exports, {
|
|
21
21
|
introspectSql: () => introspectSql
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_O35BTK6Y_exports);
|
|
24
|
+
var import_chunk_D6LYHB65 = require("./chunk-D6LYHB65.js");
|
|
25
|
+
var import_internals = require("@prisma/internals");
|
|
25
26
|
var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
|
|
26
|
-
async function introspectSql(schemaContext,
|
|
27
|
+
async function introspectSql(schemaContext, queries) {
|
|
27
28
|
if (!isTypedSqlEnabled(schemaContext.generators)) {
|
|
28
29
|
throw new Error(`\`typedSql\` preview feature needs to be enabled in ${schemaContext.loadedFromPathForLogMessages}`);
|
|
29
30
|
}
|
|
@@ -34,16 +35,19 @@ async function introspectSql(schemaContext, config, queries) {
|
|
|
34
35
|
if (!supportedProviders.includes(firstDatasource.activeProvider)) {
|
|
35
36
|
throw new Error(`Typed SQL is supported only for ${supportedProviders.join(", ")} providers`);
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const url = (0, import_internals.getEffectiveUrl)(firstDatasource).value;
|
|
39
|
+
if (!url) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Could not get url from datasource ${firstDatasource.name} in ${schemaContext.loadedFromPathForLogMessages}`
|
|
42
|
+
);
|
|
39
43
|
}
|
|
40
|
-
const migrate = await
|
|
44
|
+
const migrate = await import_chunk_D6LYHB65.Migrate.setup({ schemaContext });
|
|
41
45
|
const schemaEngine = migrate.engine;
|
|
42
46
|
const results = [];
|
|
43
47
|
const errors = [];
|
|
44
48
|
try {
|
|
45
49
|
for (const query of queries) {
|
|
46
|
-
const queryResult = await introspectSingleQuery(schemaEngine,
|
|
50
|
+
const queryResult = await introspectSingleQuery(schemaEngine, url, query);
|
|
47
51
|
if (queryResult.ok) {
|
|
48
52
|
results.push(queryResult.result);
|
|
49
53
|
} else {
|
|
@@ -16,12 +16,13 @@ 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_OP2BDF75_exports = {};
|
|
20
|
+
__export(chunk_OP2BDF75_exports, {
|
|
21
21
|
require_ms: () => require_ms,
|
|
22
|
-
require_src: () => require_src
|
|
22
|
+
require_src: () => require_src,
|
|
23
|
+
require_supports_color: () => require_supports_color
|
|
23
24
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_OP2BDF75_exports);
|
|
25
26
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
26
27
|
var require_ms = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
27
28
|
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module2) {
|
|
@@ -139,7 +140,7 @@ var require_ms = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
139
140
|
}
|
|
140
141
|
});
|
|
141
142
|
var require_common = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
142
|
-
"../../node_modules/.pnpm/debug@4.4.
|
|
143
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports, module2) {
|
|
143
144
|
"use strict";
|
|
144
145
|
function setup(env) {
|
|
145
146
|
createDebug.debug = createDebug;
|
|
@@ -241,7 +242,7 @@ var require_common = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
241
242
|
createDebug.namespaces = namespaces;
|
|
242
243
|
createDebug.names = [];
|
|
243
244
|
createDebug.skips = [];
|
|
244
|
-
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(
|
|
245
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
245
246
|
for (const ns of split) {
|
|
246
247
|
if (ns[0] === "-") {
|
|
247
248
|
createDebug.skips.push(ns.slice(1));
|
|
@@ -315,7 +316,7 @@ var require_common = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
315
316
|
}
|
|
316
317
|
});
|
|
317
318
|
var require_browser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
318
|
-
"../../node_modules/.pnpm/debug@4.4.
|
|
319
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports, module2) {
|
|
319
320
|
"use strict";
|
|
320
321
|
exports.formatArgs = formatArgs;
|
|
321
322
|
exports.save = save;
|
|
@@ -458,7 +459,7 @@ var require_browser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
458
459
|
function load() {
|
|
459
460
|
let r;
|
|
460
461
|
try {
|
|
461
|
-
r = exports.storage.getItem("debug")
|
|
462
|
+
r = exports.storage.getItem("debug");
|
|
462
463
|
} catch (error) {
|
|
463
464
|
}
|
|
464
465
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
@@ -607,7 +608,7 @@ var require_supports_color = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
607
608
|
}
|
|
608
609
|
});
|
|
609
610
|
var require_node = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
610
|
-
"../../node_modules/.pnpm/debug@4.4.
|
|
611
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports, module2) {
|
|
611
612
|
"use strict";
|
|
612
613
|
var tty = (0, import_chunk_2ESYSVXG.__require)("tty");
|
|
613
614
|
var util = (0, import_chunk_2ESYSVXG.__require)("util");
|
|
@@ -780,7 +781,7 @@ var require_node = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
780
781
|
}
|
|
781
782
|
});
|
|
782
783
|
var require_src = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
783
|
-
"../../node_modules/.pnpm/debug@4.4.
|
|
784
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports, module2) {
|
|
784
785
|
"use strict";
|
|
785
786
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
786
787
|
module2.exports = require_browser();
|
|
@@ -26,21 +26,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
executeSeedCommand: () => executeSeedCommand
|
|
29
|
+
var chunk_PHXLQVPT_exports = {};
|
|
30
|
+
__export(chunk_PHXLQVPT_exports, {
|
|
31
|
+
executeSeedCommand: () => executeSeedCommand,
|
|
32
|
+
getSeedCommandFromPackageJson: () => getSeedCommandFromPackageJson
|
|
32
33
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_PHXLQVPT_exports);
|
|
34
35
|
var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
|
|
35
36
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
36
37
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
38
|
+
var import_node_path = __toESM(require("node:path"));
|
|
39
|
+
var import_config = require("@prisma/config");
|
|
37
40
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
38
41
|
var import_node_buffer = require("node:buffer");
|
|
39
|
-
var
|
|
42
|
+
var import_node_path2 = __toESM(require("node:path"));
|
|
40
43
|
var import_node_child_process = __toESM(require("node:child_process"));
|
|
41
44
|
var import_node_process = __toESM(require("node:process"));
|
|
42
45
|
var import_node_process2 = __toESM(require("node:process"));
|
|
43
|
-
var
|
|
46
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
44
47
|
var import_node_url = require("node:url");
|
|
45
48
|
var import_node_process3 = __toESM(require("node:process"));
|
|
46
49
|
var import_node_os = require("node:os");
|
|
@@ -60,7 +63,7 @@ var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
60
63
|
module2.exports = isexe;
|
|
61
64
|
isexe.sync = sync;
|
|
62
65
|
var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
63
|
-
function checkPathExt(
|
|
66
|
+
function checkPathExt(path4, options) {
|
|
64
67
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
65
68
|
if (!pathext) {
|
|
66
69
|
return true;
|
|
@@ -71,25 +74,25 @@ var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
71
74
|
}
|
|
72
75
|
for (var i = 0; i < pathext.length; i++) {
|
|
73
76
|
var p = pathext[i].toLowerCase();
|
|
74
|
-
if (p &&
|
|
77
|
+
if (p && path4.substr(-p.length).toLowerCase() === p) {
|
|
75
78
|
return true;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
return false;
|
|
79
82
|
}
|
|
80
|
-
function checkStat(stat,
|
|
83
|
+
function checkStat(stat, path4, options) {
|
|
81
84
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
82
85
|
return false;
|
|
83
86
|
}
|
|
84
|
-
return checkPathExt(
|
|
87
|
+
return checkPathExt(path4, options);
|
|
85
88
|
}
|
|
86
|
-
function isexe(
|
|
87
|
-
fs.stat(
|
|
88
|
-
cb(er, er ? false : checkStat(stat,
|
|
89
|
+
function isexe(path4, options, cb) {
|
|
90
|
+
fs.stat(path4, function(er, stat) {
|
|
91
|
+
cb(er, er ? false : checkStat(stat, path4, options));
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
|
-
function sync(
|
|
92
|
-
return checkStat(fs.statSync(
|
|
94
|
+
function sync(path4, options) {
|
|
95
|
+
return checkStat(fs.statSync(path4), path4, options);
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
});
|
|
@@ -99,13 +102,13 @@ var require_mode = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
99
102
|
module2.exports = isexe;
|
|
100
103
|
isexe.sync = sync;
|
|
101
104
|
var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
102
|
-
function isexe(
|
|
103
|
-
fs.stat(
|
|
105
|
+
function isexe(path4, options, cb) {
|
|
106
|
+
fs.stat(path4, function(er, stat) {
|
|
104
107
|
cb(er, er ? false : checkStat(stat, options));
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
|
-
function sync(
|
|
108
|
-
return checkStat(fs.statSync(
|
|
110
|
+
function sync(path4, options) {
|
|
111
|
+
return checkStat(fs.statSync(path4), options);
|
|
109
112
|
}
|
|
110
113
|
function checkStat(stat, options) {
|
|
111
114
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -137,7 +140,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
137
140
|
}
|
|
138
141
|
module2.exports = isexe;
|
|
139
142
|
isexe.sync = sync;
|
|
140
|
-
function isexe(
|
|
143
|
+
function isexe(path4, options, cb) {
|
|
141
144
|
if (typeof options === "function") {
|
|
142
145
|
cb = options;
|
|
143
146
|
options = {};
|
|
@@ -147,7 +150,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
147
150
|
throw new TypeError("callback not provided");
|
|
148
151
|
}
|
|
149
152
|
return new Promise(function(resolve, reject) {
|
|
150
|
-
isexe(
|
|
153
|
+
isexe(path4, options || {}, function(er, is) {
|
|
151
154
|
if (er) {
|
|
152
155
|
reject(er);
|
|
153
156
|
} else {
|
|
@@ -156,7 +159,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
156
159
|
});
|
|
157
160
|
});
|
|
158
161
|
}
|
|
159
|
-
core(
|
|
162
|
+
core(path4, options || {}, function(er, is) {
|
|
160
163
|
if (er) {
|
|
161
164
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
162
165
|
er = null;
|
|
@@ -166,9 +169,9 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
166
169
|
cb(er, is);
|
|
167
170
|
});
|
|
168
171
|
}
|
|
169
|
-
function sync(
|
|
172
|
+
function sync(path4, options) {
|
|
170
173
|
try {
|
|
171
|
-
return core.sync(
|
|
174
|
+
return core.sync(path4, options || {});
|
|
172
175
|
} catch (er) {
|
|
173
176
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
174
177
|
return false;
|
|
@@ -183,7 +186,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
183
186
|
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
|
|
184
187
|
"use strict";
|
|
185
188
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
186
|
-
var
|
|
189
|
+
var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
187
190
|
var COLON = isWindows ? ";" : ":";
|
|
188
191
|
var isexe = require_isexe();
|
|
189
192
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -221,7 +224,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
221
224
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
222
225
|
const ppRaw = pathEnv[i];
|
|
223
226
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
224
|
-
const pCmd =
|
|
227
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
225
228
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
226
229
|
resolve(subStep(p, i, 0));
|
|
227
230
|
});
|
|
@@ -248,7 +251,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
248
251
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
249
252
|
const ppRaw = pathEnv[i];
|
|
250
253
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
251
|
-
const pCmd =
|
|
254
|
+
const pCmd = path4.join(pathPart, cmd);
|
|
252
255
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
253
256
|
for (let j = 0; j < pathExt.length; j++) {
|
|
254
257
|
const cur = p + pathExt[j];
|
|
@@ -292,7 +295,7 @@ var require_path_key = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
292
295
|
var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
293
296
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
294
297
|
"use strict";
|
|
295
|
-
var
|
|
298
|
+
var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
296
299
|
var which = require_which();
|
|
297
300
|
var getPathKey = require_path_key();
|
|
298
301
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -310,7 +313,7 @@ var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
310
313
|
try {
|
|
311
314
|
resolved = which.sync(parsed.command, {
|
|
312
315
|
path: env[getPathKey({ env })],
|
|
313
|
-
pathExt: withoutPathExt ?
|
|
316
|
+
pathExt: withoutPathExt ? path4.delimiter : void 0
|
|
314
317
|
});
|
|
315
318
|
} catch (e) {
|
|
316
319
|
} finally {
|
|
@@ -319,7 +322,7 @@ var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
319
322
|
}
|
|
320
323
|
}
|
|
321
324
|
if (resolved) {
|
|
322
|
-
resolved =
|
|
325
|
+
resolved = path4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
323
326
|
}
|
|
324
327
|
return resolved;
|
|
325
328
|
}
|
|
@@ -367,8 +370,8 @@ var require_shebang_command = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
367
370
|
if (!match) {
|
|
368
371
|
return null;
|
|
369
372
|
}
|
|
370
|
-
const [
|
|
371
|
-
const binary =
|
|
373
|
+
const [path4, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
374
|
+
const binary = path4.split("/").pop();
|
|
372
375
|
if (binary === "env") {
|
|
373
376
|
return argument;
|
|
374
377
|
}
|
|
@@ -399,7 +402,7 @@ var require_readShebang = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
399
402
|
var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
400
403
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
401
404
|
"use strict";
|
|
402
|
-
var
|
|
405
|
+
var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
403
406
|
var resolveCommand = require_resolveCommand();
|
|
404
407
|
var escape = require_escape();
|
|
405
408
|
var readShebang = require_readShebang();
|
|
@@ -424,7 +427,7 @@ var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
424
427
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
425
428
|
if (parsed.options.forceShell || needsShell) {
|
|
426
429
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
427
|
-
parsed.command =
|
|
430
|
+
parsed.command = path4.normalize(parsed.command);
|
|
428
431
|
parsed.command = escape.command(parsed.command);
|
|
429
432
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
430
433
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -597,7 +600,7 @@ var npmRunPath = ({
|
|
|
597
600
|
addExecPath = true
|
|
598
601
|
} = {}) => {
|
|
599
602
|
const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
|
|
600
|
-
const cwdPath =
|
|
603
|
+
const cwdPath = import_node_path3.default.resolve(cwdString);
|
|
601
604
|
const result = [];
|
|
602
605
|
if (preferLocal) {
|
|
603
606
|
applyPreferLocal(result, cwdPath);
|
|
@@ -605,19 +608,19 @@ var npmRunPath = ({
|
|
|
605
608
|
if (addExecPath) {
|
|
606
609
|
applyExecPath(result, execPath, cwdPath);
|
|
607
610
|
}
|
|
608
|
-
return [...result, pathOption].join(
|
|
611
|
+
return [...result, pathOption].join(import_node_path3.default.delimiter);
|
|
609
612
|
};
|
|
610
613
|
var applyPreferLocal = (result, cwdPath) => {
|
|
611
614
|
let previous;
|
|
612
615
|
while (previous !== cwdPath) {
|
|
613
|
-
result.push(
|
|
616
|
+
result.push(import_node_path3.default.join(cwdPath, "node_modules/.bin"));
|
|
614
617
|
previous = cwdPath;
|
|
615
|
-
cwdPath =
|
|
618
|
+
cwdPath = import_node_path3.default.resolve(cwdPath, "..");
|
|
616
619
|
}
|
|
617
620
|
};
|
|
618
621
|
var applyExecPath = (result, execPath, cwdPath) => {
|
|
619
622
|
const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath;
|
|
620
|
-
result.push(
|
|
623
|
+
result.push(import_node_path3.default.resolve(cwdPath, execPathString, ".."));
|
|
621
624
|
};
|
|
622
625
|
var npmRunPathEnv = ({ env = import_node_process2.default.env, ...options } = {}) => {
|
|
623
626
|
env = { ...env };
|
|
@@ -1662,7 +1665,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
1662
1665
|
};
|
|
1663
1666
|
options.env = getEnv(options);
|
|
1664
1667
|
options.stdio = normalizeStdio(options);
|
|
1665
|
-
if (import_node_process.default.platform === "win32" &&
|
|
1668
|
+
if (import_node_process.default.platform === "win32" && import_node_path2.default.basename(file, ".exe") === "cmd") {
|
|
1666
1669
|
args.unshift("/q");
|
|
1667
1670
|
}
|
|
1668
1671
|
return { file, args, options, parsed };
|
|
@@ -1838,6 +1841,31 @@ function execaCommand(command, options) {
|
|
|
1838
1841
|
return execa(file, args, options);
|
|
1839
1842
|
}
|
|
1840
1843
|
var debug = (0, import_debug.default)("prisma:migrate:seed");
|
|
1844
|
+
async function getSeedCommandFromPackageJson(cwd) {
|
|
1845
|
+
const prismaConfig = await (0, import_config.loadConfigFromPackageJson)(cwd);
|
|
1846
|
+
debug({ prismaConfig });
|
|
1847
|
+
if (!prismaConfig?.config?.seed) {
|
|
1848
|
+
return null;
|
|
1849
|
+
}
|
|
1850
|
+
const seedCommandFromPkgJson = prismaConfig.config.seed;
|
|
1851
|
+
if (typeof seedCommandFromPkgJson !== "string") {
|
|
1852
|
+
throw new Error(
|
|
1853
|
+
`Provided seed command \`${seedCommandFromPkgJson}\` from \`${import_node_path.default.relative(
|
|
1854
|
+
cwd,
|
|
1855
|
+
prismaConfig.loadedFromFile
|
|
1856
|
+
)}\` must be of type string`
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
if (!seedCommandFromPkgJson) {
|
|
1860
|
+
throw new Error(
|
|
1861
|
+
`Provided seed command \`${seedCommandFromPkgJson}\` from \`${import_node_path.default.relative(
|
|
1862
|
+
cwd,
|
|
1863
|
+
prismaConfig.loadedFromFile
|
|
1864
|
+
)}\` cannot be empty`
|
|
1865
|
+
);
|
|
1866
|
+
}
|
|
1867
|
+
return prismaConfig.config.seed;
|
|
1868
|
+
}
|
|
1841
1869
|
async function executeSeedCommand({
|
|
1842
1870
|
commandFromConfig,
|
|
1843
1871
|
extraArgs
|