@prisma/migrate 6.19.0-integration-engines-6-19-0-29-next-ac95b5893b3c05bf39a2431fc1a748dd46152ab4.1 → 6.19.0-integration-next.13
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/bin.js +26 -27
- package/dist/{chunk-Z27SI4AV.js → chunk-43R3GFIU.js} +4 -4
- package/dist/{chunk-F2XCBEZ4.js → chunk-4LNQFWQD.js} +10 -12
- package/dist/{chunk-BHJMJSM4.js → chunk-ANMWKEMD.js} +6 -6
- package/dist/{chunk-7TVX3D4W.js → chunk-AP47ZTTC.js} +27 -65
- package/dist/{chunk-TW22Y3AA.js → chunk-CQLPPAWH.js} +7 -7
- package/dist/{chunk-ZTIS675B.js → chunk-HDTRNRXE.js} +7 -42
- package/dist/{chunk-PHXLQVPT.js → chunk-L7EZFBB4.js} +40 -68
- package/dist/{chunk-D6LYHB65.js → chunk-MOFG2YPJ.js} +5 -7
- package/dist/{chunk-3AKRTEIK.js → chunk-NG4757TP.js} +7 -7
- package/dist/{chunk-6ORQRJLP.js → chunk-OPD3GTJ2.js} +14 -45
- package/dist/{chunk-R4IWP35Z.js → chunk-Q66L2LFA.js} +6 -6
- package/dist/{chunk-NB4FRYRQ.js → chunk-SIUB4YHK.js} +5 -5
- package/dist/{chunk-J33EXHZB.js → chunk-UJA5DXI3.js} +10 -12
- package/dist/{chunk-D4TRX77Y.js → chunk-W2NKGYXF.js} +7 -9
- package/dist/{chunk-O35BTK6Y.js → chunk-XAPRGBTZ.js} +5 -5
- package/dist/commands/DbDrop.js +2 -2
- package/dist/commands/DbExecute.js +4 -4
- package/dist/commands/DbPull.js +4 -5
- package/dist/commands/DbPush.js +4 -4
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDeploy.js +4 -4
- package/dist/commands/MigrateDev.js +5 -5
- package/dist/commands/MigrateDiff.js +4 -4
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/MigrateResolve.js +4 -4
- package/dist/commands/MigrateStatus.js +4 -4
- package/dist/index.js +30 -31
- package/dist/internals/src/cli/getSchema.d.ts +1 -15
- package/dist/migrate/src/Migrate.d.ts +1 -2
- package/dist/migrate/src/utils/seed.d.ts +0 -6
- package/dist/utils/getDatabaseVersionSafe.js +4 -4
- package/dist/utils/introspectSql.js +4 -4
- package/dist/utils/seed.js +2 -3
- package/package.json +10 -10
- package/dist/chunk-RR6BKMNO.js +0 -80
- package/dist/migrate/src/utils/replaceOrAddDatasource.d.ts +0 -2
- package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +0 -1
- package/dist/utils/replaceOrAddDatasource.js +0 -25
- package/dist/utils/replaceOrAddDatasource.test.js +0 -207
|
@@ -26,24 +26,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
executeSeedCommand: () => executeSeedCommand
|
|
32
|
-
getSeedCommandFromPackageJson: () => getSeedCommandFromPackageJson
|
|
29
|
+
var chunk_L7EZFBB4_exports = {};
|
|
30
|
+
__export(chunk_L7EZFBB4_exports, {
|
|
31
|
+
executeSeedCommand: () => executeSeedCommand
|
|
33
32
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_L7EZFBB4_exports);
|
|
35
34
|
var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
|
|
36
35
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
37
36
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
38
|
-
var import_node_path = __toESM(require("node:path"));
|
|
39
|
-
var import_config = require("@prisma/config");
|
|
40
37
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
41
38
|
var import_node_buffer = require("node:buffer");
|
|
42
|
-
var
|
|
39
|
+
var import_node_path = __toESM(require("node:path"));
|
|
43
40
|
var import_node_child_process = __toESM(require("node:child_process"));
|
|
44
41
|
var import_node_process = __toESM(require("node:process"));
|
|
45
42
|
var import_node_process2 = __toESM(require("node:process"));
|
|
46
|
-
var
|
|
43
|
+
var import_node_path2 = __toESM(require("node:path"));
|
|
47
44
|
var import_node_url = require("node:url");
|
|
48
45
|
var import_node_process3 = __toESM(require("node:process"));
|
|
49
46
|
var import_node_os = require("node:os");
|
|
@@ -63,7 +60,7 @@ var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
63
60
|
module2.exports = isexe;
|
|
64
61
|
isexe.sync = sync;
|
|
65
62
|
var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
66
|
-
function checkPathExt(
|
|
63
|
+
function checkPathExt(path3, options) {
|
|
67
64
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
68
65
|
if (!pathext) {
|
|
69
66
|
return true;
|
|
@@ -74,25 +71,25 @@ var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
74
71
|
}
|
|
75
72
|
for (var i = 0; i < pathext.length; i++) {
|
|
76
73
|
var p = pathext[i].toLowerCase();
|
|
77
|
-
if (p &&
|
|
74
|
+
if (p && path3.substr(-p.length).toLowerCase() === p) {
|
|
78
75
|
return true;
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
return false;
|
|
82
79
|
}
|
|
83
|
-
function checkStat(stat,
|
|
80
|
+
function checkStat(stat, path3, options) {
|
|
84
81
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
85
82
|
return false;
|
|
86
83
|
}
|
|
87
|
-
return checkPathExt(
|
|
84
|
+
return checkPathExt(path3, options);
|
|
88
85
|
}
|
|
89
|
-
function isexe(
|
|
90
|
-
fs.stat(
|
|
91
|
-
cb(er, er ? false : checkStat(stat,
|
|
86
|
+
function isexe(path3, options, cb) {
|
|
87
|
+
fs.stat(path3, function(er, stat) {
|
|
88
|
+
cb(er, er ? false : checkStat(stat, path3, options));
|
|
92
89
|
});
|
|
93
90
|
}
|
|
94
|
-
function sync(
|
|
95
|
-
return checkStat(fs.statSync(
|
|
91
|
+
function sync(path3, options) {
|
|
92
|
+
return checkStat(fs.statSync(path3), path3, options);
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
});
|
|
@@ -102,13 +99,13 @@ var require_mode = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
102
99
|
module2.exports = isexe;
|
|
103
100
|
isexe.sync = sync;
|
|
104
101
|
var fs = (0, import_chunk_2ESYSVXG.__require)("fs");
|
|
105
|
-
function isexe(
|
|
106
|
-
fs.stat(
|
|
102
|
+
function isexe(path3, options, cb) {
|
|
103
|
+
fs.stat(path3, function(er, stat) {
|
|
107
104
|
cb(er, er ? false : checkStat(stat, options));
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
|
-
function sync(
|
|
111
|
-
return checkStat(fs.statSync(
|
|
107
|
+
function sync(path3, options) {
|
|
108
|
+
return checkStat(fs.statSync(path3), options);
|
|
112
109
|
}
|
|
113
110
|
function checkStat(stat, options) {
|
|
114
111
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -140,7 +137,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
140
137
|
}
|
|
141
138
|
module2.exports = isexe;
|
|
142
139
|
isexe.sync = sync;
|
|
143
|
-
function isexe(
|
|
140
|
+
function isexe(path3, options, cb) {
|
|
144
141
|
if (typeof options === "function") {
|
|
145
142
|
cb = options;
|
|
146
143
|
options = {};
|
|
@@ -150,7 +147,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
150
147
|
throw new TypeError("callback not provided");
|
|
151
148
|
}
|
|
152
149
|
return new Promise(function(resolve, reject) {
|
|
153
|
-
isexe(
|
|
150
|
+
isexe(path3, options || {}, function(er, is) {
|
|
154
151
|
if (er) {
|
|
155
152
|
reject(er);
|
|
156
153
|
} else {
|
|
@@ -159,7 +156,7 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
159
156
|
});
|
|
160
157
|
});
|
|
161
158
|
}
|
|
162
|
-
core(
|
|
159
|
+
core(path3, options || {}, function(er, is) {
|
|
163
160
|
if (er) {
|
|
164
161
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
165
162
|
er = null;
|
|
@@ -169,9 +166,9 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
169
166
|
cb(er, is);
|
|
170
167
|
});
|
|
171
168
|
}
|
|
172
|
-
function sync(
|
|
169
|
+
function sync(path3, options) {
|
|
173
170
|
try {
|
|
174
|
-
return core.sync(
|
|
171
|
+
return core.sync(path3, options || {});
|
|
175
172
|
} catch (er) {
|
|
176
173
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
177
174
|
return false;
|
|
@@ -186,7 +183,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
186
183
|
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
|
|
187
184
|
"use strict";
|
|
188
185
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
189
|
-
var
|
|
186
|
+
var path3 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
190
187
|
var COLON = isWindows ? ";" : ":";
|
|
191
188
|
var isexe = require_isexe();
|
|
192
189
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -224,7 +221,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
224
221
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
225
222
|
const ppRaw = pathEnv[i];
|
|
226
223
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
227
|
-
const pCmd =
|
|
224
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
228
225
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
229
226
|
resolve(subStep(p, i, 0));
|
|
230
227
|
});
|
|
@@ -251,7 +248,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
251
248
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
252
249
|
const ppRaw = pathEnv[i];
|
|
253
250
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
254
|
-
const pCmd =
|
|
251
|
+
const pCmd = path3.join(pathPart, cmd);
|
|
255
252
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
256
253
|
for (let j = 0; j < pathExt.length; j++) {
|
|
257
254
|
const cur = p + pathExt[j];
|
|
@@ -295,7 +292,7 @@ var require_path_key = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
295
292
|
var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
296
293
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
297
294
|
"use strict";
|
|
298
|
-
var
|
|
295
|
+
var path3 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
299
296
|
var which = require_which();
|
|
300
297
|
var getPathKey = require_path_key();
|
|
301
298
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -313,7 +310,7 @@ var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
313
310
|
try {
|
|
314
311
|
resolved = which.sync(parsed.command, {
|
|
315
312
|
path: env[getPathKey({ env })],
|
|
316
|
-
pathExt: withoutPathExt ?
|
|
313
|
+
pathExt: withoutPathExt ? path3.delimiter : void 0
|
|
317
314
|
});
|
|
318
315
|
} catch (e) {
|
|
319
316
|
} finally {
|
|
@@ -322,7 +319,7 @@ var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
322
319
|
}
|
|
323
320
|
}
|
|
324
321
|
if (resolved) {
|
|
325
|
-
resolved =
|
|
322
|
+
resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
326
323
|
}
|
|
327
324
|
return resolved;
|
|
328
325
|
}
|
|
@@ -370,8 +367,8 @@ var require_shebang_command = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
370
367
|
if (!match) {
|
|
371
368
|
return null;
|
|
372
369
|
}
|
|
373
|
-
const [
|
|
374
|
-
const binary =
|
|
370
|
+
const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
371
|
+
const binary = path3.split("/").pop();
|
|
375
372
|
if (binary === "env") {
|
|
376
373
|
return argument;
|
|
377
374
|
}
|
|
@@ -402,7 +399,7 @@ var require_readShebang = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
402
399
|
var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
403
400
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
404
401
|
"use strict";
|
|
405
|
-
var
|
|
402
|
+
var path3 = (0, import_chunk_2ESYSVXG.__require)("path");
|
|
406
403
|
var resolveCommand = require_resolveCommand();
|
|
407
404
|
var escape = require_escape();
|
|
408
405
|
var readShebang = require_readShebang();
|
|
@@ -427,7 +424,7 @@ var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
427
424
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
428
425
|
if (parsed.options.forceShell || needsShell) {
|
|
429
426
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
430
|
-
parsed.command =
|
|
427
|
+
parsed.command = path3.normalize(parsed.command);
|
|
431
428
|
parsed.command = escape.command(parsed.command);
|
|
432
429
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
433
430
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -600,7 +597,7 @@ var npmRunPath = ({
|
|
|
600
597
|
addExecPath = true
|
|
601
598
|
} = {}) => {
|
|
602
599
|
const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
|
|
603
|
-
const cwdPath =
|
|
600
|
+
const cwdPath = import_node_path2.default.resolve(cwdString);
|
|
604
601
|
const result = [];
|
|
605
602
|
if (preferLocal) {
|
|
606
603
|
applyPreferLocal(result, cwdPath);
|
|
@@ -608,19 +605,19 @@ var npmRunPath = ({
|
|
|
608
605
|
if (addExecPath) {
|
|
609
606
|
applyExecPath(result, execPath, cwdPath);
|
|
610
607
|
}
|
|
611
|
-
return [...result, pathOption].join(
|
|
608
|
+
return [...result, pathOption].join(import_node_path2.default.delimiter);
|
|
612
609
|
};
|
|
613
610
|
var applyPreferLocal = (result, cwdPath) => {
|
|
614
611
|
let previous;
|
|
615
612
|
while (previous !== cwdPath) {
|
|
616
|
-
result.push(
|
|
613
|
+
result.push(import_node_path2.default.join(cwdPath, "node_modules/.bin"));
|
|
617
614
|
previous = cwdPath;
|
|
618
|
-
cwdPath =
|
|
615
|
+
cwdPath = import_node_path2.default.resolve(cwdPath, "..");
|
|
619
616
|
}
|
|
620
617
|
};
|
|
621
618
|
var applyExecPath = (result, execPath, cwdPath) => {
|
|
622
619
|
const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath;
|
|
623
|
-
result.push(
|
|
620
|
+
result.push(import_node_path2.default.resolve(cwdPath, execPathString, ".."));
|
|
624
621
|
};
|
|
625
622
|
var npmRunPathEnv = ({ env = import_node_process2.default.env, ...options } = {}) => {
|
|
626
623
|
env = { ...env };
|
|
@@ -1665,7 +1662,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
1665
1662
|
};
|
|
1666
1663
|
options.env = getEnv(options);
|
|
1667
1664
|
options.stdio = normalizeStdio(options);
|
|
1668
|
-
if (import_node_process.default.platform === "win32" &&
|
|
1665
|
+
if (import_node_process.default.platform === "win32" && import_node_path.default.basename(file, ".exe") === "cmd") {
|
|
1669
1666
|
args.unshift("/q");
|
|
1670
1667
|
}
|
|
1671
1668
|
return { file, args, options, parsed };
|
|
@@ -1841,31 +1838,6 @@ function execaCommand(command, options) {
|
|
|
1841
1838
|
return execa(file, args, options);
|
|
1842
1839
|
}
|
|
1843
1840
|
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
|
-
}
|
|
1869
1841
|
async function executeSeedCommand({
|
|
1870
1842
|
commandFromConfig,
|
|
1871
1843
|
extraArgs
|
|
@@ -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_MOFG2YPJ_exports = {};
|
|
30
|
+
__export(chunk_MOFG2YPJ_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var import_chunk_T64SUJ5L = require("./chunk-T64SUJ5L.js");
|
|
33
|
+
module.exports = __toCommonJS(chunk_MOFG2YPJ_exports);
|
|
35
34
|
var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
|
|
35
|
+
var import_chunk_T64SUJ5L = require("./chunk-T64SUJ5L.js");
|
|
36
36
|
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
37
37
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
38
38
|
var import_chunk_22YP3RXZ = require("./chunk-22YP3RXZ.js");
|
|
@@ -874,9 +874,8 @@ var Migrate = class _Migrate {
|
|
|
874
874
|
unexecutable
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
|
-
async tryToRunGenerate(
|
|
877
|
+
async tryToRunGenerate() {
|
|
878
878
|
if (!this.schemaContext) throw new Error("this.schemaContext is undefined");
|
|
879
|
-
const skipEngines = (0, import_internals.isPrismaPostgres)(datasourceInfo.url);
|
|
880
879
|
const message = [];
|
|
881
880
|
process.stdout.write("\n");
|
|
882
881
|
log_update_default(`Running generate... ${(0, import_chunk_SKRR5WT4.dim)("(Use --skip-generate to skip the generators)")}`);
|
|
@@ -884,7 +883,6 @@ var Migrate = class _Migrate {
|
|
|
884
883
|
schemaContext: this.schemaContext,
|
|
885
884
|
printDownloadProgress: true,
|
|
886
885
|
version: import_engines_version.enginesVersion,
|
|
887
|
-
noEngine: skipEngines,
|
|
888
886
|
registry: import_client_generator_registry.defaultRegistry.toInternal()
|
|
889
887
|
});
|
|
890
888
|
for (const generator of generators) {
|
|
@@ -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_NG4757TP_exports = {};
|
|
20
|
+
__export(chunk_NG4757TP_exports, {
|
|
21
21
|
MigrateResolve: () => MigrateResolve
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_NG4757TP_exports);
|
|
24
24
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
25
25
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
26
|
-
var
|
|
26
|
+
var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.js");
|
|
27
27
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
28
28
|
var import_internals = require("@prisma/internals");
|
|
29
29
|
var MigrateResolve = class _MigrateResolve {
|
|
@@ -83,7 +83,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
83
83
|
if (args["--help"]) {
|
|
84
84
|
return this.help();
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
(0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
87
87
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
88
88
|
schemaPathFromArg: args["--schema"],
|
|
89
89
|
schemaPathFromConfig: config.schema,
|
|
@@ -113,7 +113,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_in
|
|
|
113
113
|
if (!adapter) {
|
|
114
114
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
115
115
|
}
|
|
116
|
-
const migrate = await
|
|
116
|
+
const migrate = await import_chunk_MOFG2YPJ.Migrate.setup({
|
|
117
117
|
schemaEngineConfig: config,
|
|
118
118
|
migrationsDirPath,
|
|
119
119
|
schemaContext,
|
|
@@ -139,7 +139,7 @@ Migration ${args["--applied"]} marked as applied.
|
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
142
|
-
const migrate = await
|
|
142
|
+
const migrate = await import_chunk_MOFG2YPJ.Migrate.setup({
|
|
143
143
|
schemaEngineConfig: config,
|
|
144
144
|
migrationsDirPath,
|
|
145
145
|
schemaContext,
|
|
@@ -26,15 +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_OPD3GTJ2_exports = {};
|
|
30
|
+
__export(chunk_OPD3GTJ2_exports, {
|
|
31
31
|
DbPull: () => DbPull
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_OPD3GTJ2_exports);
|
|
34
34
|
var import_chunk_VU5BLQUI = require("./chunk-VU5BLQUI.js");
|
|
35
35
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
36
36
|
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
37
|
-
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
38
37
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
39
38
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
40
39
|
var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
@@ -42,7 +41,7 @@ var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
|
42
41
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
43
42
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
44
43
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
45
|
-
var
|
|
44
|
+
var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.js");
|
|
46
45
|
var import_chunk_AXR7LS2N = require("./chunk-AXR7LS2N.js");
|
|
47
46
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
48
47
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -107,7 +106,6 @@ Set composite types introspection depth to 2 levels
|
|
|
107
106
|
const args = (0, import_internals.arg)(argv, {
|
|
108
107
|
"--help": Boolean,
|
|
109
108
|
"-h": "--help",
|
|
110
|
-
"--url": String,
|
|
111
109
|
"--print": Boolean,
|
|
112
110
|
"--schema": String,
|
|
113
111
|
"--config": String,
|
|
@@ -125,8 +123,7 @@ Set composite types introspection depth to 2 levels
|
|
|
125
123
|
if (args["--help"]) {
|
|
126
124
|
return this.help();
|
|
127
125
|
}
|
|
128
|
-
|
|
129
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: !args["--print"], config });
|
|
126
|
+
(0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: !args["--print"], config });
|
|
130
127
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
131
128
|
schemaPathFromArg: args["--schema"],
|
|
132
129
|
schemaPathFromConfig: config.schema,
|
|
@@ -137,14 +134,13 @@ Set composite types introspection depth to 2 levels
|
|
|
137
134
|
const cmd = "db pull";
|
|
138
135
|
(0, import_internals.checkUnsupportedDataProxy)({
|
|
139
136
|
cmd,
|
|
140
|
-
schemaContext: schemaContext
|
|
141
|
-
urls: [url]
|
|
137
|
+
schemaContext: schemaContext ?? void 0
|
|
142
138
|
});
|
|
143
139
|
(0, import_internals.checkUnsupportedSchemaEngineWasm)({
|
|
144
140
|
cmd,
|
|
145
141
|
config,
|
|
146
142
|
args,
|
|
147
|
-
flags: ["--
|
|
143
|
+
flags: ["--local-d1"]
|
|
148
144
|
});
|
|
149
145
|
const adapter = config.engine === "js" ? await config.adapter() : void 0;
|
|
150
146
|
if (schemaContext && !args["--print"]) {
|
|
@@ -152,30 +148,14 @@ Set composite types introspection depth to 2 levels
|
|
|
152
148
|
(0, import_chunk_2FXU5NZQ.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext?.primaryDatasource), adapter });
|
|
153
149
|
}
|
|
154
150
|
const fromD1 = Boolean(args["--local-d1"]);
|
|
155
|
-
if (!
|
|
151
|
+
if (!schemaContext && !fromD1) {
|
|
156
152
|
throw new import_chunk_3WC4XD74.NoSchemaFoundError();
|
|
157
153
|
}
|
|
158
|
-
const { firstDatasource, schema, validationWarning } = await (0, import_chunk_AXR7LS2N.z)({
|
|
154
|
+
const { firstDatasource, schema, validationWarning } = await (0, import_chunk_AXR7LS2N.z)({ schemaContext, fromD1 }).when(
|
|
159
155
|
(input) => input.schemaContext !== null,
|
|
160
156
|
async (input) => {
|
|
161
157
|
const firstDatasource2 = input.schemaContext.primaryDatasource ? input.schemaContext.primaryDatasource : void 0;
|
|
162
|
-
if (input.
|
|
163
|
-
let providerFromSchema = firstDatasource2?.provider;
|
|
164
|
-
if (providerFromSchema === "postgres") {
|
|
165
|
-
providerFromSchema = "postgresql";
|
|
166
|
-
}
|
|
167
|
-
const providerFromUrl = (0, import_internals.protocolToConnectorType)(`${input.url.split(":")[0]}:`);
|
|
168
|
-
const schema2 = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(
|
|
169
|
-
this.urlToDatasource(input.url, providerFromSchema),
|
|
170
|
-
input.schemaContext.schemaFiles
|
|
171
|
-
);
|
|
172
|
-
if (providerFromSchema && providerFromUrl && providerFromSchema !== providerFromUrl && Boolean(providerFromSchema === "cockroachdb" && providerFromUrl === "postgresql") === false) {
|
|
173
|
-
throw new Error(
|
|
174
|
-
`The database provider found in --url (${providerFromUrl}) is different from the provider found in the Prisma schema (${providerFromSchema}).`
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
return { firstDatasource: firstDatasource2, schema: schema2, validationWarning: void 0 };
|
|
178
|
-
} else if (input.fromD1) {
|
|
158
|
+
if (input.fromD1) {
|
|
179
159
|
const d1Database = await (0, import_internals.locateLocalCloudflareD1)({ arg: "--from-local-d1" });
|
|
180
160
|
const pathToSQLiteFile = import_path.default.relative(input.schemaContext.schemaRootDir, d1Database);
|
|
181
161
|
const schema2 = [
|
|
@@ -210,17 +190,6 @@ ${this.urlToDatasource(`file:${pathToSQLiteFile}`, "sqlite")}`;
|
|
|
210
190
|
});
|
|
211
191
|
return { firstDatasource: config2.datasources[0], schema: schema2, validationWarning: void 0 };
|
|
212
192
|
}
|
|
213
|
-
).when(
|
|
214
|
-
(input) => input.url !== void 0,
|
|
215
|
-
async (input) => {
|
|
216
|
-
(0, import_internals.protocolToConnectorType)(`${input.url.split(":")[0]}:`);
|
|
217
|
-
const schema2 = [["schema.prisma", this.urlToDatasource(input.url)]];
|
|
218
|
-
const config2 = await (0, import_internals.getConfig)({
|
|
219
|
-
datamodel: schema2,
|
|
220
|
-
ignoreEnvVarErrors: true
|
|
221
|
-
});
|
|
222
|
-
return { firstDatasource: config2.datasources[0], schema: schema2, validationWarning: void 0 };
|
|
223
|
-
}
|
|
224
193
|
).run();
|
|
225
194
|
if (schemaContext) {
|
|
226
195
|
const modelRegex = /\s*model\s*(\w+)\s*{/;
|
|
@@ -235,13 +204,13 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
|
235
204
|
)} for more info.`);
|
|
236
205
|
}
|
|
237
206
|
}
|
|
238
|
-
const migrate = await
|
|
207
|
+
const migrate = await import_chunk_MOFG2YPJ.Migrate.setup({
|
|
239
208
|
schemaEngineConfig: config,
|
|
240
209
|
schemaContext: schemaContext ?? void 0,
|
|
241
210
|
extensions: config["extensions"]
|
|
242
211
|
});
|
|
243
212
|
const engine = migrate.engine;
|
|
244
|
-
const basedOn =
|
|
213
|
+
const basedOn = schemaContext?.primaryDatasource ? ` based on datasource defined in ${(0, import_chunk_SKRR5WT4.underline)(schemaContext.loadedFromPathForLogMessages)}` : "";
|
|
245
214
|
const introspectionSpinner = spinnerFactory(`Introspecting${basedOn}`);
|
|
246
215
|
const before = Math.round(performance.now());
|
|
247
216
|
let introspectionSchema = void 0;
|
|
@@ -278,7 +247,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
|
|
|
278
247
|
"schema.prisma"
|
|
279
248
|
)} points to a database that is not empty (it must contain at least one table).
|
|
280
249
|
|
|
281
|
-
Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
|
|
250
|
+
Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
|
|
282
251
|
`);
|
|
283
252
|
} else if (e.code === "P1003") {
|
|
284
253
|
throw new Error(`
|
|
@@ -297,7 +266,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("To fix this, you have two options:")}
|
|
|
297
266
|
"schema.prisma"
|
|
298
267
|
)} points to an existing database.
|
|
299
268
|
|
|
300
|
-
Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
|
|
269
|
+
Then you can run ${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExecutor)("prisma db pull"))} again.
|
|
301
270
|
`);
|
|
302
271
|
} else if (e.code === "P1012") {
|
|
303
272
|
process.stdout.write("\n");
|
|
@@ -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_Q66L2LFA_exports = {};
|
|
30
|
+
__export(chunk_Q66L2LFA_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_Q66L2LFA_exports);
|
|
34
34
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
35
35
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.js");
|
|
37
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
38
38
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
39
39
|
var import_internals = require("@prisma/internals");
|
|
@@ -81,7 +81,7 @@ Check the status of your database migrations
|
|
|
81
81
|
if (args["--help"]) {
|
|
82
82
|
return this.help();
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
(0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
85
85
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
86
86
|
schemaPathFromArg: args["--schema"],
|
|
87
87
|
schemaPathFromConfig: config.schema,
|
|
@@ -95,7 +95,7 @@ Check the status of your database migrations
|
|
|
95
95
|
externalTables: config.tables?.external ?? [],
|
|
96
96
|
externalEnums: config.enums?.external ?? []
|
|
97
97
|
};
|
|
98
|
-
const migrate = await
|
|
98
|
+
const migrate = await import_chunk_MOFG2YPJ.Migrate.setup({
|
|
99
99
|
schemaEngineConfig: config,
|
|
100
100
|
migrationsDirPath,
|
|
101
101
|
schemaContext,
|
|
@@ -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_SIUB4YHK_exports = {};
|
|
30
|
+
__export(chunk_SIUB4YHK_exports, {
|
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_SIUB4YHK_exports);
|
|
34
|
+
var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.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_MOFG2YPJ.Migrate.setup({});
|
|
42
42
|
dbVersion = await migrate.engine.getDatabaseVersion(args);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
debug(e);
|
|
@@ -26,18 +26,18 @@ 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_UJA5DXI3_exports = {};
|
|
30
|
+
__export(chunk_UJA5DXI3_exports, {
|
|
31
31
|
MigrateReset: () => MigrateReset
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_UJA5DXI3_exports);
|
|
34
34
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
35
35
|
var import_chunk_FBDQVK4W = require("./chunk-FBDQVK4W.js");
|
|
36
36
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
37
37
|
var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
|
|
38
38
|
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var import_chunk_L7EZFBB4 = require("./chunk-L7EZFBB4.js");
|
|
40
|
+
var import_chunk_MOFG2YPJ = require("./chunk-MOFG2YPJ.js");
|
|
41
41
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
42
42
|
var import_internals = require("@prisma/internals");
|
|
43
43
|
var import_prompts = __toESM(require("prompts"));
|
|
@@ -90,7 +90,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
90
90
|
if (args["--help"]) {
|
|
91
91
|
return this.help();
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
(0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
94
94
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
95
95
|
schemaPathFromArg: args["--schema"],
|
|
96
96
|
schemaPathFromConfig: config.schema,
|
|
@@ -128,7 +128,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
128
128
|
externalTables: config.tables?.external ?? [],
|
|
129
129
|
externalEnums: config.enums?.external ?? []
|
|
130
130
|
};
|
|
131
|
-
const migrate = await
|
|
131
|
+
const migrate = await import_chunk_MOFG2YPJ.Migrate.setup({
|
|
132
132
|
schemaEngineConfig: config,
|
|
133
133
|
migrationsDirPath,
|
|
134
134
|
schemaContext,
|
|
@@ -160,15 +160,13 @@ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)("migrations", migrationI
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
if (!process.env.PRISMA_MIGRATE_SKIP_GENERATE && !args["--skip-generate"]) {
|
|
163
|
-
await migrate.tryToRunGenerate(
|
|
163
|
+
await migrate.tryToRunGenerate();
|
|
164
164
|
}
|
|
165
165
|
if (!process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
|
|
166
|
-
const
|
|
167
|
-
const seedCommandFromPkgJson = await (0, import_chunk_PHXLQVPT.getSeedCommandFromPackageJson)(process.cwd());
|
|
168
|
-
const seedCommand = seedCommandFromPrismaConfig ?? seedCommandFromPkgJson;
|
|
166
|
+
const seedCommand = config.migrations?.seed;
|
|
169
167
|
if (seedCommand) {
|
|
170
168
|
process.stdout.write("\n");
|
|
171
|
-
const successfulSeeding = await (0,
|
|
169
|
+
const successfulSeeding = await (0, import_chunk_L7EZFBB4.executeSeedCommand)({ commandFromConfig: seedCommand });
|
|
172
170
|
if (successfulSeeding) {
|
|
173
171
|
process.stdout.write(`
|
|
174
172
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
|