@prisma/migrate 6.1.0-dev.3 → 6.1.0-dev.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Migrate.js +5 -5
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +33 -33
- package/dist/{chunk-ILQWQHQO.js → chunk-3EBHV6P7.js} +6 -6
- package/dist/{chunk-GUBDW6S7.js → chunk-4NDZU7KV.js} +6 -6
- package/dist/{chunk-XYJKCYH6.js → chunk-7DE6A3RE.js} +814 -42
- package/dist/{chunk-PCJYN6LT.js → chunk-7MUF3HLX.js} +6 -6
- package/dist/{chunk-NKL64AIB.js → chunk-AOCCG7RR.js} +6 -6
- package/dist/{chunk-X6GGREJW.js → chunk-BQXAMKF7.js} +6 -6
- package/dist/{chunk-LVFPGUOH.js → chunk-E3UZYEGF.js} +92 -87
- package/dist/{chunk-KEPR65SW.js → chunk-ET2H4E2O.js} +6 -6
- package/dist/{chunk-PFEH6ILG.js → chunk-KX5GI2BM.js} +6 -6
- package/dist/{chunk-3H4RLVCQ.js → chunk-MBLWML5Q.js} +9 -9
- package/dist/{chunk-LJOMIPJW.js → chunk-NCDRH4BH.js} +7 -7
- package/dist/{chunk-HODZFC64.js → chunk-RCPXHNHW.js} +7 -7
- package/dist/{chunk-PNBMPQYH.js → chunk-UI76O6B2.js} +6 -6
- package/dist/{chunk-HTBRUJZH.js → chunk-V22HHZSS.js} +815 -43
- package/dist/{chunk-Z4OLB2H4.js → chunk-XQJTDY7A.js} +6 -6
- package/dist/commands/DbExecute.js +6 -6
- package/dist/commands/DbPull.js +5 -5
- package/dist/commands/DbPush.js +6 -6
- package/dist/commands/MigrateDeploy.js +6 -6
- package/dist/commands/MigrateDev.js +6 -6
- package/dist/commands/MigrateDiff.js +6 -6
- 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 +39 -39
- package/dist/internals/src/tracing/types.d.ts +26 -16
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/introspectSql.js +4 -4
- package/dist/utils/setupMongo.js +25279 -23672
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +9 -9
@@ -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_7MUF3HLX_exports = {};
|
30
|
+
__export(chunk_7MUF3HLX_exports, {
|
31
31
|
EngineError: () => EngineError,
|
32
32
|
SchemaEngine: () => SchemaEngine,
|
33
33
|
init_SchemaEngine: () => init_SchemaEngine
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_7MUF3HLX_exports);
|
36
|
+
var import_chunk_E3UZYEGF = require("./chunk-E3UZYEGF.js");
|
37
37
|
var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
|
38
38
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
39
39
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
@@ -50,7 +50,7 @@ var init_SchemaEngine = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
50
50
|
"src/SchemaEngine.ts"() {
|
51
51
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
52
52
|
(0, import_chunk_AAATUOV6.init_byline)();
|
53
|
-
(0,
|
53
|
+
(0, import_chunk_E3UZYEGF.init_handleViewsIO)();
|
54
54
|
debugRpc = (0, import_debug.default)("prisma:schemaEngine:rpc");
|
55
55
|
debugStderr = (0, import_debug.default)("prisma:schemaEngine:stderr");
|
56
56
|
debugStdin = (0, import_debug.default)("prisma:schemaEngine:stdin");
|
@@ -175,7 +175,7 @@ var init_SchemaEngine = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
175
175
|
const { views } = introspectResult;
|
176
176
|
if (views) {
|
177
177
|
const schemaPath = this.schemaPath ?? import_node_path.default.join(process.cwd(), "prisma");
|
178
|
-
await (0,
|
178
|
+
await (0, import_chunk_E3UZYEGF.handleViewsIO)({ views, schemaPath });
|
179
179
|
}
|
180
180
|
return introspectResult;
|
181
181
|
} finally {
|
@@ -26,20 +26,20 @@ 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_AOCCG7RR_exports = {};
|
30
|
+
__export(chunk_AOCCG7RR_exports, {
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe,
|
32
32
|
init_getDatabaseVersionSafe: () => init_getDatabaseVersionSafe
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
35
|
-
var
|
34
|
+
module.exports = __toCommonJS(chunk_AOCCG7RR_exports);
|
35
|
+
var import_chunk_7MUF3HLX = require("./chunk-7MUF3HLX.js");
|
36
36
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
37
37
|
var import_debug = __toESM(require("@prisma/debug"));
|
38
38
|
async function getDatabaseVersionSafe(args) {
|
39
39
|
let engine;
|
40
40
|
let dbVersion;
|
41
41
|
try {
|
42
|
-
engine = new
|
42
|
+
engine = new import_chunk_7MUF3HLX.SchemaEngine({});
|
43
43
|
dbVersion = await engine.getDatabaseVersion(args);
|
44
44
|
} catch (e) {
|
45
45
|
debug(e);
|
@@ -53,7 +53,7 @@ async function getDatabaseVersionSafe(args) {
|
|
53
53
|
var debug;
|
54
54
|
var init_getDatabaseVersionSafe = (0, import_chunk_WWAWV7DQ.__esm)({
|
55
55
|
"src/utils/getDatabaseVersionSafe.ts"() {
|
56
|
-
(0,
|
56
|
+
(0, import_chunk_7MUF3HLX.init_SchemaEngine)();
|
57
57
|
debug = (0, import_debug.default)("prisma:cli");
|
58
58
|
}
|
59
59
|
});
|
@@ -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_BQXAMKF7_exports = {};
|
30
|
+
__export(chunk_BQXAMKF7_exports, {
|
31
31
|
MigrateDeploy: () => MigrateDeploy,
|
32
32
|
init_MigrateDeploy: () => init_MigrateDeploy
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_BQXAMKF7_exports);
|
35
35
|
var import_chunk_WOOPRG54 = require("./chunk-WOOPRG54.js");
|
36
|
-
var
|
36
|
+
var import_chunk_NCDRH4BH = require("./chunk-NCDRH4BH.js");
|
37
37
|
var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
|
38
38
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
39
39
|
var import_chunk_KEBB7UIB = require("./chunk-KEBB7UIB.js");
|
@@ -45,7 +45,7 @@ var debug, _MigrateDeploy, MigrateDeploy;
|
|
45
45
|
var init_MigrateDeploy = (0, import_chunk_WWAWV7DQ.__esm)({
|
46
46
|
"src/commands/MigrateDeploy.ts"() {
|
47
47
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
48
|
-
(0,
|
48
|
+
(0, import_chunk_NCDRH4BH.init_Migrate)();
|
49
49
|
(0, import_chunk_KEBB7UIB.init_ensureDatabaseExists)();
|
50
50
|
(0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
|
51
51
|
(0, import_chunk_Q7ACZDDT.init_printDatasource)();
|
@@ -76,7 +76,7 @@ var init_MigrateDeploy = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
76
76
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
77
77
|
const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
|
78
78
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_KEBB7UIB.getDatasourceInfo)({ schemaPath }) });
|
79
|
-
const migrate = new
|
79
|
+
const migrate = new import_chunk_NCDRH4BH.Migrate(schemaPath);
|
80
80
|
try {
|
81
81
|
const wasDbCreated = await (0, import_chunk_KEBB7UIB.ensureDatabaseExists)("apply", schemaPath);
|
82
82
|
if (wasDbCreated) {
|
@@ -26,16 +26,16 @@ 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
|
-
$: () => $,
|
29
|
+
var chunk_E3UZYEGF_exports = {};
|
30
|
+
__export(chunk_E3UZYEGF_exports, {
|
32
31
|
N: () => N,
|
33
32
|
handleViewsIO: () => handleViewsIO,
|
34
33
|
init_dist: () => init_dist,
|
35
34
|
init_handleViewsIO: () => init_handleViewsIO,
|
36
|
-
require_function: () => require_function
|
35
|
+
require_function: () => require_function,
|
36
|
+
z: () => z
|
37
37
|
});
|
38
|
-
module.exports = __toCommonJS(
|
38
|
+
module.exports = __toCommonJS(chunk_E3UZYEGF_exports);
|
39
39
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
40
40
|
var import_internals = require("@prisma/internals");
|
41
41
|
var import_path = __toESM(require("path"));
|
@@ -4256,20 +4256,20 @@ var require_TaskEither = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
4256
4256
|
function a(...t2) {
|
4257
4257
|
if (1 === t2.length) {
|
4258
4258
|
const [e2] = t2;
|
4259
|
-
return (t3) =>
|
4259
|
+
return (t3) => s(e2, t3, () => {
|
4260
4260
|
});
|
4261
4261
|
}
|
4262
4262
|
if (2 === t2.length) {
|
4263
4263
|
const [e2, n2] = t2;
|
4264
|
-
return
|
4264
|
+
return s(e2, n2, () => {
|
4265
4265
|
});
|
4266
4266
|
}
|
4267
4267
|
throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
|
4268
4268
|
}
|
4269
4269
|
function u(t2) {
|
4270
|
-
return Object.assign(t2, { optional: () =>
|
4270
|
+
return Object.assign(t2, { optional: () => h(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? y(t2) : y(e2, t2) });
|
4271
4271
|
}
|
4272
|
-
function
|
4272
|
+
function l(t2) {
|
4273
4273
|
return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
|
4274
4274
|
let n2 = 0;
|
4275
4275
|
const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
|
@@ -4277,16 +4277,16 @@ function h(t2) {
|
|
4277
4277
|
var t4;
|
4278
4278
|
return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
|
4279
4279
|
} };
|
4280
|
-
} }))(t2), { optional: () => h(
|
4280
|
+
} }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? y(t2) : y(e2, t2)) });
|
4281
4281
|
}
|
4282
|
-
function
|
4282
|
+
function h(e2) {
|
4283
4283
|
return u({ [t]: () => ({ match: (t2) => {
|
4284
4284
|
let n2 = {};
|
4285
4285
|
const r2 = (t3, e3) => {
|
4286
4286
|
n2[t3] = e3;
|
4287
4287
|
};
|
4288
|
-
return void 0 === t2 ? (
|
4289
|
-
}, getSelectionKeys: () =>
|
4288
|
+
return void 0 === t2 ? (o(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s(e2, t2, r2), selections: n2 };
|
4289
|
+
}, getSelectionKeys: () => o(e2), matcherType: "optional" }) });
|
4290
4290
|
}
|
4291
4291
|
function m(...e2) {
|
4292
4292
|
return u({ [t]: () => ({ match: (t2) => {
|
@@ -4294,8 +4294,8 @@ function m(...e2) {
|
|
4294
4294
|
const r2 = (t3, e3) => {
|
4295
4295
|
n2[t3] = e3;
|
4296
4296
|
};
|
4297
|
-
return { matched: e2.every((e3) =>
|
4298
|
-
}, getSelectionKeys: () => c(e2,
|
4297
|
+
return { matched: e2.every((e3) => s(e3, t2, r2)), selections: n2 };
|
4298
|
+
}, getSelectionKeys: () => c(e2, o), matcherType: "and" }) });
|
4299
4299
|
}
|
4300
4300
|
function d(...e2) {
|
4301
4301
|
return u({ [t]: () => ({ match: (t2) => {
|
@@ -4303,20 +4303,20 @@ function d(...e2) {
|
|
4303
4303
|
const r2 = (t3, e3) => {
|
4304
4304
|
n2[t3] = e3;
|
4305
4305
|
};
|
4306
|
-
return c(e2,
|
4307
|
-
}, getSelectionKeys: () => c(e2,
|
4306
|
+
return c(e2, o).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => s(e3, t2, r2)), selections: n2 };
|
4307
|
+
}, getSelectionKeys: () => c(e2, o), matcherType: "or" }) });
|
4308
4308
|
}
|
4309
|
-
function
|
4309
|
+
function p(e2) {
|
4310
4310
|
return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
|
4311
4311
|
}
|
4312
|
-
function
|
4312
|
+
function y(...e2) {
|
4313
4313
|
const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
|
4314
4314
|
return u({ [t]: () => ({ match: (t2) => {
|
4315
4315
|
let e3 = { [null != r2 ? r2 : n]: t2 };
|
4316
|
-
return { matched: void 0 === i2 ||
|
4316
|
+
return { matched: void 0 === i2 || s(i2, t2, (t3, n2) => {
|
4317
4317
|
e3[t3] = n2;
|
4318
4318
|
}), selections: e3 };
|
4319
|
-
}, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] :
|
4319
|
+
}, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : o(i2)) }) });
|
4320
4320
|
}
|
4321
4321
|
function v(t2) {
|
4322
4322
|
return "number" == typeof t2;
|
@@ -4327,51 +4327,51 @@ function b(t2) {
|
|
4327
4327
|
function w(t2) {
|
4328
4328
|
return "bigint" == typeof t2;
|
4329
4329
|
}
|
4330
|
-
function
|
4331
|
-
return new
|
4330
|
+
function z(t2) {
|
4331
|
+
return new I(t2, $);
|
4332
4332
|
}
|
4333
|
-
var t, e, n, r, i,
|
4333
|
+
var t, e, n, r, i, s, o, c, f, g, S, O, j, K, x, E, A, P, T, B, _, k, N, W, $, I;
|
4334
4334
|
var init_dist = (0, import_chunk_WWAWV7DQ.__esm)({
|
4335
|
-
"../../node_modules/.pnpm/ts-pattern@5.
|
4335
|
+
"../../node_modules/.pnpm/ts-pattern@5.6.0/node_modules/ts-pattern/dist/index.js"() {
|
4336
4336
|
"use strict";
|
4337
4337
|
t = Symbol.for("@ts-pattern/matcher");
|
4338
4338
|
e = Symbol.for("@ts-pattern/isVariadic");
|
4339
4339
|
n = "@ts-pattern/anonymous-select-key";
|
4340
4340
|
r = (t2) => Boolean(t2 && "object" == typeof t2);
|
4341
4341
|
i = (e2) => e2 && !!e2[t];
|
4342
|
-
|
4342
|
+
s = (n2, o2, c2) => {
|
4343
4343
|
if (i(n2)) {
|
4344
|
-
const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(
|
4344
|
+
const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(o2);
|
4345
4345
|
return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
|
4346
4346
|
}
|
4347
4347
|
if (r(n2)) {
|
4348
|
-
if (!r(
|
4348
|
+
if (!r(o2)) return false;
|
4349
4349
|
if (Array.isArray(n2)) {
|
4350
|
-
if (!Array.isArray(
|
4350
|
+
if (!Array.isArray(o2)) return false;
|
4351
4351
|
let t2 = [], r2 = [], a2 = [];
|
4352
|
-
for (const
|
4353
|
-
const
|
4354
|
-
i(
|
4352
|
+
for (const s2 of n2.keys()) {
|
4353
|
+
const o3 = n2[s2];
|
4354
|
+
i(o3) && o3[e] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
|
4355
4355
|
}
|
4356
4356
|
if (a2.length) {
|
4357
4357
|
if (a2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
|
4358
|
-
if (
|
4359
|
-
const e2 =
|
4360
|
-
return t2.every((t3, n4) =>
|
4358
|
+
if (o2.length < t2.length + r2.length) return false;
|
4359
|
+
const e2 = o2.slice(0, t2.length), n3 = 0 === r2.length ? [] : o2.slice(-r2.length), i2 = o2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
|
4360
|
+
return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a2.length || s(a2[0], i2, c2));
|
4361
4361
|
}
|
4362
|
-
return n2.length ===
|
4362
|
+
return n2.length === o2.length && n2.every((t3, e2) => s(t3, o2[e2], c2));
|
4363
4363
|
}
|
4364
|
-
return
|
4364
|
+
return Reflect.ownKeys(n2).every((e2) => {
|
4365
4365
|
const r2 = n2[e2];
|
4366
|
-
return (e2 in
|
4366
|
+
return (e2 in o2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && s(r2, o2[e2], c2);
|
4367
4367
|
var a2;
|
4368
4368
|
});
|
4369
4369
|
}
|
4370
|
-
return Object.is(
|
4370
|
+
return Object.is(o2, n2);
|
4371
4371
|
};
|
4372
|
-
|
4373
|
-
var n2,
|
4374
|
-
return r(e2) ? i(e2) ? null != (n2 = null == (
|
4372
|
+
o = (e2) => {
|
4373
|
+
var n2, s2, a2;
|
4374
|
+
return r(e2) ? i(e2) ? null != (n2 = null == (s2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, o) : c(Object.values(e2), o) : [];
|
4375
4375
|
};
|
4376
4376
|
c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
|
4377
4377
|
f = (t2, e2) => {
|
@@ -4382,54 +4382,54 @@ var init_dist = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
4382
4382
|
for (const [n2, r2] of t2.entries()) if (!e2(r2, n2)) return false;
|
4383
4383
|
return true;
|
4384
4384
|
};
|
4385
|
-
S = u(
|
4385
|
+
S = u(p(function(t2) {
|
4386
4386
|
return true;
|
4387
4387
|
}));
|
4388
4388
|
O = S;
|
4389
4389
|
j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
|
4390
|
-
return j(m(t2, (n2 = e2,
|
4390
|
+
return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.startsWith(n2)))));
|
4391
4391
|
var n2;
|
4392
4392
|
}, endsWith: (e2) => {
|
4393
|
-
return j(m(t2, (n2 = e2,
|
4393
|
+
return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.endsWith(n2)))));
|
4394
4394
|
var n2;
|
4395
|
-
}, minLength: (e2) => j(m(t2, ((t3) =>
|
4396
|
-
return j(m(t2, (n2 = e2,
|
4395
|
+
}, minLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
|
4396
|
+
return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.includes(n2)))));
|
4397
4397
|
var n2;
|
4398
4398
|
}, regex: (e2) => {
|
4399
|
-
return j(m(t2, (n2 = e2,
|
4399
|
+
return j(m(t2, (n2 = e2, p((t3) => b(t3) && Boolean(t3.match(n2))))));
|
4400
4400
|
var n2;
|
4401
4401
|
} });
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) =>
|
4406
|
-
P = A(
|
4407
|
-
T = u(
|
4402
|
+
K = j(p(b));
|
4403
|
+
x = (t2) => Object.assign(u(t2), { between: (e2, n2) => x(m(t2, ((t3, e3) => p((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 >= t3))(e2))), int: () => x(m(t2, p((t3) => v(t3) && Number.isInteger(t3)))), finite: () => x(m(t2, p((t3) => v(t3) && Number.isFinite(t3)))), positive: () => x(m(t2, p((t3) => v(t3) && t3 > 0))), negative: () => x(m(t2, p((t3) => v(t3) && t3 < 0))) });
|
4404
|
+
E = x(p(v));
|
4405
|
+
A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => p((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, p((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, p((t3) => w(t3) && t3 < 0))) });
|
4406
|
+
P = A(p(w));
|
4407
|
+
T = u(p(function(t2) {
|
4408
4408
|
return "boolean" == typeof t2;
|
4409
4409
|
}));
|
4410
|
-
|
4410
|
+
B = u(p(function(t2) {
|
4411
4411
|
return "symbol" == typeof t2;
|
4412
4412
|
}));
|
4413
|
-
|
4413
|
+
_ = u(p(function(t2) {
|
4414
4414
|
return null == t2;
|
4415
4415
|
}));
|
4416
|
-
|
4416
|
+
k = u(p(function(t2) {
|
4417
4417
|
return null != t2;
|
4418
4418
|
}));
|
4419
|
-
N = { __proto__: null, matcher: t, optional:
|
4420
|
-
return
|
4419
|
+
N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
|
4420
|
+
return l({ [t]: () => ({ match: (t2) => {
|
4421
4421
|
if (!Array.isArray(t2)) return { matched: false };
|
4422
4422
|
if (0 === e2.length) return { matched: true };
|
4423
4423
|
const n2 = e2[0];
|
4424
4424
|
let r2 = {};
|
4425
|
-
if (0 === t2.length) return
|
4425
|
+
if (0 === t2.length) return o(n2).forEach((t3) => {
|
4426
4426
|
r2[t3] = [];
|
4427
4427
|
}), { matched: true, selections: r2 };
|
4428
4428
|
const i2 = (t3, e3) => {
|
4429
4429
|
r2[t3] = (r2[t3] || []).concat([e3]);
|
4430
4430
|
};
|
4431
|
-
return { matched: t2.every((t3) =>
|
4432
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] :
|
4431
|
+
return { matched: t2.every((t3) => s(n2, t3, i2)), selections: r2 };
|
4432
|
+
}, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
|
4433
4433
|
}, set: function(...e2) {
|
4434
4434
|
return u({ [t]: () => ({ match: (t2) => {
|
4435
4435
|
if (!(t2 instanceof Set)) return { matched: false };
|
@@ -4439,8 +4439,8 @@ var init_dist = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
4439
4439
|
const r2 = (t3, e3) => {
|
4440
4440
|
n2[t3] = (n2[t3] || []).concat([e3]);
|
4441
4441
|
}, i2 = e2[0];
|
4442
|
-
return { matched: f(t2, (t3) =>
|
4443
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] :
|
4442
|
+
return { matched: f(t2, (t3) => s(i2, t3, r2)), selections: n2 };
|
4443
|
+
}, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
|
4444
4444
|
}, map: function(...e2) {
|
4445
4445
|
return u({ [t]: () => ({ match: (t2) => {
|
4446
4446
|
if (!(t2 instanceof Map)) return { matched: false };
|
@@ -4452,24 +4452,35 @@ var init_dist = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
4452
4452
|
if (0 === e2.length) return { matched: true };
|
4453
4453
|
var i2;
|
4454
4454
|
if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
|
4455
|
-
const [
|
4455
|
+
const [o2, c2] = e2;
|
4456
4456
|
return { matched: g(t2, (t3, e3) => {
|
4457
|
-
const n3 =
|
4457
|
+
const n3 = s(o2, e3, r2), i3 = s(c2, t3, r2);
|
4458
4458
|
return n3 && i3;
|
4459
4459
|
}), selections: n2 };
|
4460
|
-
}, getSelectionKeys: () => 0 === e2.length ? [] : [...
|
4460
|
+
}, getSelectionKeys: () => 0 === e2.length ? [] : [...o(e2[0]), ...o(e2[1])] }) });
|
4461
4461
|
}, intersection: m, union: d, not: function(e2) {
|
4462
|
-
return u({ [t]: () => ({ match: (t2) => ({ matched: !
|
4462
|
+
return u({ [t]: () => ({ match: (t2) => ({ matched: !s(e2, t2, () => {
|
4463
4463
|
}) }), getSelectionKeys: () => [], matcherType: "not" }) });
|
4464
|
-
}, when:
|
4465
|
-
return u(
|
4464
|
+
}, when: p, select: y, any: S, _: O, string: K, number: E, bigint: P, boolean: T, symbol: B, nullish: _, nonNullable: k, instanceOf: function(t2) {
|
4465
|
+
return u(p(/* @__PURE__ */ function(t3) {
|
4466
4466
|
return (e2) => e2 instanceof t3;
|
4467
4467
|
}(t2)));
|
4468
4468
|
}, shape: function(t2) {
|
4469
|
-
return u(
|
4469
|
+
return u(p(a(t2)));
|
4470
4470
|
} };
|
4471
|
-
W =
|
4472
|
-
|
4471
|
+
W = class extends Error {
|
4472
|
+
constructor(t2) {
|
4473
|
+
let e2;
|
4474
|
+
try {
|
4475
|
+
e2 = JSON.stringify(t2);
|
4476
|
+
} catch (n2) {
|
4477
|
+
e2 = t2;
|
4478
|
+
}
|
4479
|
+
super(`Pattern matching error: no pattern matches value ${e2}`), this.input = void 0, this.input = t2;
|
4480
|
+
}
|
4481
|
+
};
|
4482
|
+
$ = { matched: false, value: void 0 };
|
4483
|
+
I = class _I {
|
4473
4484
|
constructor(t2, e2) {
|
4474
4485
|
this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
|
4475
4486
|
}
|
@@ -4478,29 +4489,23 @@ var init_dist = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
4478
4489
|
const e2 = t2[t2.length - 1], r2 = [t2[0]];
|
4479
4490
|
let i2;
|
4480
4491
|
3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
|
4481
|
-
let
|
4492
|
+
let o2 = false, c2 = {};
|
4482
4493
|
const a2 = (t3, e3) => {
|
4483
|
-
|
4484
|
-
}, u2 = !r2.some((t3) =>
|
4485
|
-
return new
|
4494
|
+
o2 = true, c2[t3] = e3;
|
4495
|
+
}, u2 = !r2.some((t3) => s(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? $ : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
|
4496
|
+
return new _I(this.input, u2);
|
4486
4497
|
}
|
4487
4498
|
when(t2, e2) {
|
4488
4499
|
if (this.state.matched) return this;
|
4489
4500
|
const n2 = Boolean(t2(this.input));
|
4490
|
-
return new
|
4501
|
+
return new _I(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : $);
|
4491
4502
|
}
|
4492
4503
|
otherwise(t2) {
|
4493
4504
|
return this.state.matched ? this.state.value : t2(this.input);
|
4494
4505
|
}
|
4495
4506
|
exhaustive() {
|
4496
4507
|
if (this.state.matched) return this.state.value;
|
4497
|
-
|
4498
|
-
try {
|
4499
|
-
t2 = JSON.stringify(this.input);
|
4500
|
-
} catch (e2) {
|
4501
|
-
t2 = this.input;
|
4502
|
-
}
|
4503
|
-
throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
|
4508
|
+
throw new W(this.input);
|
4504
4509
|
}
|
4505
4510
|
run() {
|
4506
4511
|
return this.exhaustive();
|
@@ -4544,7 +4549,7 @@ async function createViewsIO(viewsDir, views) {
|
|
4544
4549
|
if (E2.isRight(either)) {
|
4545
4550
|
return { viewFilesToKeep };
|
4546
4551
|
}
|
4547
|
-
const error =
|
4552
|
+
const error = z(either.left).with({ type: "fs-create-dir" }, (e2) => {
|
4548
4553
|
throw new Error(`Error creating the directory: ${e2.meta.dir}.
|
4549
4554
|
${e2.error}.`);
|
4550
4555
|
}).with({ type: "fs-write-file" }, (e2) => {
|
@@ -4570,7 +4575,7 @@ async function cleanLeftoversIO(viewsDir, viewFilesToKeep = []) {
|
|
4570
4575
|
if (E2.isRight(either)) {
|
4571
4576
|
return;
|
4572
4577
|
}
|
4573
|
-
const error =
|
4578
|
+
const error = z(either.left).with({ type: "fs-remove-empty-dirs" }, (e2) => {
|
4574
4579
|
throw new Error(`Error removing empty directories in: ${e2.meta.dir}.
|
4575
4580
|
${e2.error}.`);
|
4576
4581
|
}).with({ type: "fs-remove-file" }, (e2) => {
|
@@ -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_ET2H4E2O_exports = {};
|
30
|
+
__export(chunk_ET2H4E2O_exports, {
|
31
31
|
DbPush: () => DbPush,
|
32
32
|
init_DbPush: () => init_DbPush
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
35
|
-
var
|
34
|
+
module.exports = __toCommonJS(chunk_ET2H4E2O_exports);
|
35
|
+
var import_chunk_NCDRH4BH = require("./chunk-NCDRH4BH.js");
|
36
36
|
var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
|
37
37
|
var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
|
38
38
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
@@ -45,7 +45,7 @@ var _DbPush, DbPush;
|
|
45
45
|
var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
|
46
46
|
"src/commands/DbPush.ts"() {
|
47
47
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
48
|
-
(0,
|
48
|
+
(0, import_chunk_NCDRH4BH.init_Migrate)();
|
49
49
|
(0, import_chunk_KEBB7UIB.init_ensureDatabaseExists)();
|
50
50
|
(0, import_chunk_U374EXYQ.init_errors)();
|
51
51
|
(0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
|
@@ -79,7 +79,7 @@ var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
79
79
|
const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
|
80
80
|
const datasourceInfo = await (0, import_chunk_KEBB7UIB.getDatasourceInfo)({ schemaPath });
|
81
81
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo });
|
82
|
-
const migrate = new
|
82
|
+
const migrate = new import_chunk_NCDRH4BH.Migrate(schemaPath);
|
83
83
|
try {
|
84
84
|
const wasDbCreated = await (0, import_chunk_KEBB7UIB.ensureDatabaseExists)("push", schemaPath);
|
85
85
|
if (wasDbCreated) {
|
@@ -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_KX5GI2BM_exports = {};
|
30
|
+
__export(chunk_KX5GI2BM_exports, {
|
31
31
|
MigrateStatus: () => MigrateStatus,
|
32
32
|
init_MigrateStatus: () => init_MigrateStatus
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
35
|
-
var
|
34
|
+
module.exports = __toCommonJS(chunk_KX5GI2BM_exports);
|
35
|
+
var import_chunk_NCDRH4BH = require("./chunk-NCDRH4BH.js");
|
36
36
|
var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
|
37
37
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
38
38
|
var import_chunk_KEBB7UIB = require("./chunk-KEBB7UIB.js");
|
@@ -44,7 +44,7 @@ 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_NCDRH4BH.init_Migrate)();
|
48
48
|
(0, import_chunk_KEBB7UIB.init_ensureDatabaseExists)();
|
49
49
|
(0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
|
50
50
|
(0, import_chunk_Q7ACZDDT.init_printDatasource)();
|
@@ -74,7 +74,7 @@ var init_MigrateStatus = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
74
74
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
75
75
|
const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
|
76
76
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo: await (0, import_chunk_KEBB7UIB.getDatasourceInfo)({ schemaPath }) });
|
77
|
-
const migrate = new
|
77
|
+
const migrate = new import_chunk_NCDRH4BH.Migrate(schemaPath);
|
78
78
|
await (0, import_chunk_KEBB7UIB.ensureCanConnectToDatabase)(schemaPath);
|
79
79
|
let diagnoseResult;
|
80
80
|
let listMigrationDirectoriesResult;
|
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_MBLWML5Q_exports = {};
|
30
|
+
__export(chunk_MBLWML5Q_exports, {
|
31
31
|
DbPull: () => DbPull,
|
32
32
|
init_DbPull: () => init_DbPull
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_MBLWML5Q_exports);
|
35
35
|
var import_chunk_GRGGAY6L = require("./chunk-GRGGAY6L.js");
|
36
36
|
var import_chunk_ILJRJJ3S = require("./chunk-ILJRJJ3S.js");
|
37
37
|
var import_chunk_35LAJN5S = require("./chunk-35LAJN5S.js");
|
@@ -40,8 +40,8 @@ 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
|
44
|
-
var
|
43
|
+
var import_chunk_7MUF3HLX = require("./chunk-7MUF3HLX.js");
|
44
|
+
var import_chunk_E3UZYEGF = require("./chunk-E3UZYEGF.js");
|
45
45
|
var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
|
46
46
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
47
47
|
var import_chunk_KEBB7UIB = require("./chunk-KEBB7UIB.js");
|
@@ -54,8 +54,8 @@ var debug, _DbPull, DbPull;
|
|
54
54
|
var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
55
55
|
"src/commands/DbPull.ts"() {
|
56
56
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
57
|
-
(0,
|
58
|
-
(0,
|
57
|
+
(0, import_chunk_E3UZYEGF.init_dist)();
|
58
|
+
(0, import_chunk_7MUF3HLX.init_SchemaEngine)();
|
59
59
|
(0, import_chunk_GN5BY5N2.init_countModelsAndTypes)();
|
60
60
|
(0, import_chunk_KEBB7UIB.init_ensureDatabaseExists)();
|
61
61
|
(0, import_chunk_U374EXYQ.init_errors)();
|
@@ -121,7 +121,7 @@ var init_DbPull = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
121
121
|
if (!url && !schemaPath && !fromD1) {
|
122
122
|
throw new import_chunk_U374EXYQ.NoSchemaFoundError();
|
123
123
|
}
|
124
|
-
const { firstDatasource, schema, validationWarning } = await (0,
|
124
|
+
const { firstDatasource, schema, validationWarning } = await (0, import_chunk_E3UZYEGF.z)({ url, schemaPath, fromD1 }).when(
|
125
125
|
(input) => input.schemaPath !== null,
|
126
126
|
async (input) => {
|
127
127
|
const rawSchema = await (0, import_internals.getSchema)(input.schemaPath);
|
@@ -217,7 +217,7 @@ Some information will be lost (relations, comments, mapped fields, @ignore...),
|
|
217
217
|
)} for more info.`);
|
218
218
|
}
|
219
219
|
}
|
220
|
-
const engine = new
|
220
|
+
const engine = new import_chunk_7MUF3HLX.SchemaEngine({
|
221
221
|
schemaPath: schemaPath ?? void 0
|
222
222
|
});
|
223
223
|
const basedOn = !args["--url"] && schemaPath ? ` based on datasource defined in ${(0, import_chunk_6TE2RIPN.underline)(import_path.default.relative(process.cwd(), schemaPath))}` : "";
|