@prisma/migrate 6.20.0-integration-merge-release-workflows.1 → 6.20.0-integration-next.3
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 +30 -31
- package/dist/{chunk-3AKRTEIK.js → chunk-4BAGKFIV.js} +10 -11
- package/dist/{chunk-TW22Y3AA.js → chunk-6FL2LODV.js} +6 -7
- package/dist/{chunk-O35BTK6Y.js → chunk-BB43AVYJ.js} +9 -13
- package/dist/{chunk-F2XCBEZ4.js → chunk-BP3VX5NQ.js} +10 -13
- package/dist/{chunk-BHJMJSM4.js → chunk-EERZNF42.js} +6 -7
- package/dist/{chunk-7TVX3D4W.js → chunk-EVUHOCOP.js} +27 -65
- package/dist/{chunk-6ORQRJLP.js → chunk-FBPXMCYK.js} +28 -109
- package/dist/{chunk-OP2BDF75.js → chunk-FRY7T46S.js} +10 -11
- package/dist/{chunk-22YP3RXZ.js → chunk-GH6IOZTT.js} +7 -7
- package/dist/{chunk-Z27SI4AV.js → chunk-GY34KW2I.js} +6 -4
- package/dist/{chunk-VV4M6AN7.js → chunk-JX2HIV7V.js} +10 -10
- package/dist/{chunk-PHXLQVPT.js → chunk-L7EZFBB4.js} +40 -68
- package/dist/{chunk-AXR7LS2N.js → chunk-PEUHUCS4.js} +4 -5
- package/dist/{chunk-NB4FRYRQ.js → chunk-PQ3UMDEP.js} +5 -5
- package/dist/{chunk-ZTIS675B.js → chunk-QCMPSEBY.js} +138 -205
- package/dist/{chunk-J33EXHZB.js → chunk-SFX5KEGP.js} +9 -12
- package/dist/{chunk-GSX25HRL.js → chunk-SYWL5XS4.js} +5 -5
- package/dist/{chunk-VU5BLQUI.js → chunk-T2ACIU5M.js} +14 -8
- package/dist/{chunk-D6LYHB65.js → chunk-V3D2XB5I.js} +37 -29
- package/dist/{chunk-D4TRX77Y.js → chunk-WF7UXKO5.js} +6 -9
- package/dist/{chunk-QVMYNWAN.js → chunk-XA2JOJS2.js} +157 -70
- package/dist/{chunk-R4IWP35Z.js → chunk-Z7WLEGCP.js} +8 -9
- package/dist/commands/DbDrop.js +2 -2
- package/dist/commands/DbExecute.js +7 -7
- package/dist/commands/DbPull.js +8 -9
- 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 +8 -7
- 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 +36 -37
- package/dist/internals/src/cli/getSchema.d.ts +1 -15
- package/dist/migrate/src/Migrate.d.ts +1 -2
- package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -0
- package/dist/migrate/src/utils/introspectSql.d.ts +2 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -6
- package/dist/open-GFNXULGD.js +593 -0
- package/dist/utils/getDatabaseVersionSafe.js +7 -7
- package/dist/utils/introspectSql.js +7 -7
- package/dist/utils/seed.js +2 -3
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +30734 -30124
- package/dist/utils/setupMongo.js +2048 -768
- 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/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,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_SFX5KEGP_exports = {};
|
|
30
|
+
__export(chunk_SFX5KEGP_exports, {
|
|
31
31
|
MigrateReset: () => MigrateReset
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_SFX5KEGP_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_V3D2XB5I = require("./chunk-V3D2XB5I.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,6 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
90
90
|
if (args["--help"]) {
|
|
91
91
|
return this.help();
|
|
92
92
|
}
|
|
93
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
94
93
|
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
95
94
|
schemaPathFromArg: args["--schema"],
|
|
96
95
|
schemaPathFromConfig: config.schema,
|
|
@@ -128,7 +127,7 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
128
127
|
externalTables: config.tables?.external ?? [],
|
|
129
128
|
externalEnums: config.enums?.external ?? []
|
|
130
129
|
};
|
|
131
|
-
const migrate = await
|
|
130
|
+
const migrate = await import_chunk_V3D2XB5I.Migrate.setup({
|
|
132
131
|
schemaEngineConfig: config,
|
|
133
132
|
migrationsDirPath,
|
|
134
133
|
schemaContext,
|
|
@@ -160,15 +159,13 @@ ${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)("migrations", migrationI
|
|
|
160
159
|
);
|
|
161
160
|
}
|
|
162
161
|
if (!process.env.PRISMA_MIGRATE_SKIP_GENERATE && !args["--skip-generate"]) {
|
|
163
|
-
await migrate.tryToRunGenerate(
|
|
162
|
+
await migrate.tryToRunGenerate();
|
|
164
163
|
}
|
|
165
164
|
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;
|
|
165
|
+
const seedCommand = config.migrations?.seed;
|
|
169
166
|
if (seedCommand) {
|
|
170
167
|
process.stdout.write("\n");
|
|
171
|
-
const successfulSeeding = await (0,
|
|
168
|
+
const successfulSeeding = await (0, import_chunk_L7EZFBB4.executeSeedCommand)({ commandFromConfig: seedCommand });
|
|
172
169
|
if (successfulSeeding) {
|
|
173
170
|
process.stdout.write(`
|
|
174
171
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
|
|
@@ -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_SYWL5XS4_exports = {};
|
|
30
|
+
__export(chunk_SYWL5XS4_exports, {
|
|
31
31
|
EngineError: () => EngineError,
|
|
32
32
|
SchemaEngineCLI: () => SchemaEngineCLI
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_SYWL5XS4_exports);
|
|
35
|
+
var import_chunk_PEUHUCS4 = require("./chunk-PEUHUCS4.js");
|
|
36
36
|
var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
|
|
37
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
38
38
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -188,7 +188,7 @@ var SchemaEngineCLI = class _SchemaEngineCLI {
|
|
|
188
188
|
);
|
|
189
189
|
const { views } = introspectResult;
|
|
190
190
|
if (views) {
|
|
191
|
-
await (0,
|
|
191
|
+
await (0, import_chunk_PEUHUCS4.handleViewsIO)({ views, viewsDirectoryPath });
|
|
192
192
|
}
|
|
193
193
|
return introspectResult;
|
|
194
194
|
} finally {
|
|
@@ -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_T2ACIU5M_exports = {};
|
|
30
|
+
__export(chunk_T2ACIU5M_exports, {
|
|
31
31
|
createSpinner: () => createSpinner
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_T2ACIU5M_exports);
|
|
34
|
+
var import_chunk_JX2HIV7V = require("./chunk-JX2HIV7V.js");
|
|
35
35
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
36
36
|
var import_node_process = __toESM(require("node:process"));
|
|
37
37
|
var import_node_process2 = __toESM(require("node:process"));
|
|
@@ -1952,6 +1952,12 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
1952
1952
|
if (env.TERM === "xterm-kitty") {
|
|
1953
1953
|
return 3;
|
|
1954
1954
|
}
|
|
1955
|
+
if (env.TERM === "xterm-ghostty") {
|
|
1956
|
+
return 3;
|
|
1957
|
+
}
|
|
1958
|
+
if (env.TERM === "wezterm") {
|
|
1959
|
+
return 3;
|
|
1960
|
+
}
|
|
1955
1961
|
if ("TERM_PROGRAM" in env) {
|
|
1956
1962
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1957
1963
|
switch (env.TERM_PROGRAM) {
|
|
@@ -2382,8 +2388,8 @@ var Ora = class {
|
|
|
2382
2388
|
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
|
|
2383
2389
|
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
2384
2390
|
this.#lineCount = 0;
|
|
2385
|
-
for (const line of (0,
|
|
2386
|
-
this.#lineCount += Math.max(1, Math.ceil((0,
|
|
2391
|
+
for (const line of (0, import_chunk_JX2HIV7V.stripAnsi)(fullText).split("\n")) {
|
|
2392
|
+
this.#lineCount += Math.max(1, Math.ceil((0, import_chunk_JX2HIV7V.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns));
|
|
2387
2393
|
}
|
|
2388
2394
|
}
|
|
2389
2395
|
get isEnabled() {
|
|
@@ -2465,7 +2471,7 @@ var Ora = class {
|
|
|
2465
2471
|
return this;
|
|
2466
2472
|
}
|
|
2467
2473
|
if (this.#options.hideCursor) {
|
|
2468
|
-
|
|
2474
|
+
import_chunk_JX2HIV7V.cli_cursor_default.hide(this.#stream);
|
|
2469
2475
|
}
|
|
2470
2476
|
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY) {
|
|
2471
2477
|
this.#isDiscardingStdin = true;
|
|
@@ -2484,7 +2490,7 @@ var Ora = class {
|
|
|
2484
2490
|
this.#frameIndex = 0;
|
|
2485
2491
|
this.clear();
|
|
2486
2492
|
if (this.#options.hideCursor) {
|
|
2487
|
-
|
|
2493
|
+
import_chunk_JX2HIV7V.cli_cursor_default.show(this.#stream);
|
|
2488
2494
|
}
|
|
2489
2495
|
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY && this.#isDiscardingStdin) {
|
|
2490
2496
|
stdin_discarder_default.stop();
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_V3D2XB5I_exports = {};
|
|
30
|
+
__export(chunk_V3D2XB5I_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_V3D2XB5I_exports);
|
|
34
|
+
var import_chunk_JX2HIV7V = require("./chunk-JX2HIV7V.js");
|
|
34
35
|
var import_chunk_T64SUJ5L = require("./chunk-T64SUJ5L.js");
|
|
35
|
-
var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.js");
|
|
36
36
|
var import_chunk_GGA2F64G = require("./chunk-GGA2F64G.js");
|
|
37
37
|
var import_chunk_23DZXSTI = require("./chunk-23DZXSTI.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_GH6IOZTT = require("./chunk-GH6IOZTT.js");
|
|
39
|
+
var import_chunk_SYWL5XS4 = require("./chunk-SYWL5XS4.js");
|
|
40
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
41
41
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
42
42
|
var import_client_generator_registry = require("@prisma/client-generator-registry");
|
|
@@ -46,9 +46,11 @@ var import_node_process = __toESM(require("node:process"));
|
|
|
46
46
|
var import_node_process2 = __toESM(require("node:process"));
|
|
47
47
|
var base_exports = {};
|
|
48
48
|
(0, import_chunk_2ESYSVXG.__export)(base_exports, {
|
|
49
|
+
ConEmu: () => ConEmu,
|
|
49
50
|
beep: () => beep,
|
|
50
51
|
clearScreen: () => clearScreen,
|
|
51
52
|
clearTerminal: () => clearTerminal,
|
|
53
|
+
clearViewport: () => clearViewport,
|
|
52
54
|
cursorBackward: () => cursorBackward,
|
|
53
55
|
cursorDown: () => cursorDown,
|
|
54
56
|
cursorForward: () => cursorForward,
|
|
@@ -76,7 +78,8 @@ var base_exports = {};
|
|
|
76
78
|
image: () => image,
|
|
77
79
|
link: () => link,
|
|
78
80
|
scrollDown: () => scrollDown,
|
|
79
|
-
scrollUp: () => scrollUp
|
|
81
|
+
scrollUp: () => scrollUp,
|
|
82
|
+
setCwd: () => setCwd
|
|
80
83
|
});
|
|
81
84
|
var isBrowser = globalThis.window?.document !== void 0;
|
|
82
85
|
var isNode = globalThis.process?.versions?.node !== void 0;
|
|
@@ -160,6 +163,7 @@ var eraseScreen = ESC + "2J";
|
|
|
160
163
|
var scrollUp = ESC + "S";
|
|
161
164
|
var scrollDown = ESC + "T";
|
|
162
165
|
var clearScreen = "\x1Bc";
|
|
166
|
+
var clearViewport = `${eraseScreen}${ESC}H`;
|
|
163
167
|
var clearTerminal = isWindows2 ? `${eraseScreen}${ESC}0f` : `${eraseScreen}${ESC}3J${ESC}H`;
|
|
164
168
|
var enterAlternativeScreen = ESC + "?1049h";
|
|
165
169
|
var exitAlternativeScreen = ESC + "?1049l";
|
|
@@ -189,7 +193,8 @@ var image = (data, options = {}) => {
|
|
|
189
193
|
if (options.preserveAspectRatio === false) {
|
|
190
194
|
returnValue += ";preserveAspectRatio=0";
|
|
191
195
|
}
|
|
192
|
-
|
|
196
|
+
const imageBuffer = Buffer.from(data);
|
|
197
|
+
return returnValue + `;size=${imageBuffer.byteLength}:` + imageBuffer.toString("base64") + BEL;
|
|
193
198
|
};
|
|
194
199
|
var iTerm = {
|
|
195
200
|
setCwd: (cwd = cwdFunction()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
@@ -210,6 +215,10 @@ var iTerm = {
|
|
|
210
215
|
return returnValue + BEL;
|
|
211
216
|
}
|
|
212
217
|
};
|
|
218
|
+
var ConEmu = {
|
|
219
|
+
setCwd: (cwd = cwdFunction()) => `${OSC}9;9;${cwd}${BEL}`
|
|
220
|
+
};
|
|
221
|
+
var setCwd = (cwd = cwdFunction()) => iTerm.setCwd(cwd) + ConEmu.setCwd(cwd);
|
|
213
222
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
214
223
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
215
224
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -308,7 +317,7 @@ function assembleStyles() {
|
|
|
308
317
|
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
309
318
|
Object.defineProperties(styles, {
|
|
310
319
|
rgbToAnsi256: {
|
|
311
|
-
value
|
|
320
|
+
value(red, green, blue) {
|
|
312
321
|
if (red === green && green === blue) {
|
|
313
322
|
if (red < 8) {
|
|
314
323
|
return 16;
|
|
@@ -323,7 +332,7 @@ function assembleStyles() {
|
|
|
323
332
|
enumerable: false
|
|
324
333
|
},
|
|
325
334
|
hexToRgb: {
|
|
326
|
-
value
|
|
335
|
+
value(hex) {
|
|
327
336
|
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
328
337
|
if (!matches) {
|
|
329
338
|
return [0, 0, 0];
|
|
@@ -348,7 +357,7 @@ function assembleStyles() {
|
|
|
348
357
|
enumerable: false
|
|
349
358
|
},
|
|
350
359
|
ansi256ToAnsi: {
|
|
351
|
-
value
|
|
360
|
+
value(code) {
|
|
352
361
|
if (code < 8) {
|
|
353
362
|
return 30 + code;
|
|
354
363
|
}
|
|
@@ -406,14 +415,14 @@ var ANSI_SGR_TERMINATOR = "m";
|
|
|
406
415
|
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
407
416
|
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
408
417
|
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
409
|
-
var wordLengths = (string) => string.split(" ").map((character) => (0,
|
|
418
|
+
var wordLengths = (string) => string.split(" ").map((character) => (0, import_chunk_JX2HIV7V.stringWidth)(character));
|
|
410
419
|
var wrapWord = (rows, word, columns) => {
|
|
411
420
|
const characters = [...word];
|
|
412
421
|
let isInsideEscape = false;
|
|
413
422
|
let isInsideLinkEscape = false;
|
|
414
|
-
let visible = (0,
|
|
423
|
+
let visible = (0, import_chunk_JX2HIV7V.stringWidth)((0, import_chunk_JX2HIV7V.stripAnsi)(rows.at(-1)));
|
|
415
424
|
for (const [index, character] of characters.entries()) {
|
|
416
|
-
const characterLength = (0,
|
|
425
|
+
const characterLength = (0, import_chunk_JX2HIV7V.stringWidth)(character);
|
|
417
426
|
if (visible + characterLength <= columns) {
|
|
418
427
|
rows[rows.length - 1] += character;
|
|
419
428
|
} else {
|
|
@@ -450,7 +459,7 @@ var stringVisibleTrimSpacesRight = (string) => {
|
|
|
450
459
|
const words = string.split(" ");
|
|
451
460
|
let last = words.length;
|
|
452
461
|
while (last > 0) {
|
|
453
|
-
if ((0,
|
|
462
|
+
if ((0, import_chunk_JX2HIV7V.stringWidth)(words[last - 1]) > 0) {
|
|
454
463
|
break;
|
|
455
464
|
}
|
|
456
465
|
last--;
|
|
@@ -473,7 +482,7 @@ var exec = (string, columns, options = {}) => {
|
|
|
473
482
|
if (options.trim !== false) {
|
|
474
483
|
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
475
484
|
}
|
|
476
|
-
let rowLength = (0,
|
|
485
|
+
let rowLength = (0, import_chunk_JX2HIV7V.stringWidth)(rows.at(-1));
|
|
477
486
|
if (index !== 0) {
|
|
478
487
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
479
488
|
rows.push("");
|
|
@@ -551,11 +560,12 @@ function isFullwidthCodePoint(codePoint) {
|
|
|
551
560
|
if (!Number.isInteger(codePoint)) {
|
|
552
561
|
return false;
|
|
553
562
|
}
|
|
554
|
-
return (0,
|
|
563
|
+
return (0, import_chunk_JX2HIV7V.isFullWidth)(codePoint) || (0, import_chunk_JX2HIV7V.isWide)(codePoint);
|
|
555
564
|
}
|
|
556
565
|
var ESCAPES2 = /* @__PURE__ */ new Set([27, 155]);
|
|
557
566
|
var CODE_POINT_0 = "0".codePointAt(0);
|
|
558
567
|
var CODE_POINT_9 = "9".codePointAt(0);
|
|
568
|
+
var MAX_ANSI_SEQUENCE_LENGTH = 19;
|
|
559
569
|
var endCodesSet = /* @__PURE__ */ new Set();
|
|
560
570
|
var endCodesMap = /* @__PURE__ */ new Map();
|
|
561
571
|
for (const [start, end] of ansi_styles_default.codes) {
|
|
@@ -589,7 +599,7 @@ function findNumberIndex(string) {
|
|
|
589
599
|
return -1;
|
|
590
600
|
}
|
|
591
601
|
function parseAnsiCode(string, offset) {
|
|
592
|
-
string = string.slice(offset, offset +
|
|
602
|
+
string = string.slice(offset, offset + MAX_ANSI_SEQUENCE_LENGTH);
|
|
593
603
|
const startIndex = findNumberIndex(string);
|
|
594
604
|
if (startIndex !== -1) {
|
|
595
605
|
let endIndex = string.indexOf("m", startIndex);
|
|
@@ -617,15 +627,15 @@ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
|
|
|
617
627
|
continue;
|
|
618
628
|
}
|
|
619
629
|
}
|
|
620
|
-
const
|
|
630
|
+
const isFullWidth2 = isFullwidthCodePoint(codePoint);
|
|
621
631
|
const character = String.fromCodePoint(codePoint);
|
|
622
632
|
returnValue.push({
|
|
623
633
|
type: "character",
|
|
624
634
|
value: character,
|
|
625
|
-
isFullWidth
|
|
635
|
+
isFullWidth: isFullWidth2
|
|
626
636
|
});
|
|
627
637
|
index += character.length;
|
|
628
|
-
visibleCount +=
|
|
638
|
+
visibleCount += isFullWidth2 ? 2 : character.length;
|
|
629
639
|
if (visibleCount >= endCharacter) {
|
|
630
640
|
break;
|
|
631
641
|
}
|
|
@@ -687,7 +697,7 @@ var fitToTerminalHeight = (stream, text) => {
|
|
|
687
697
|
const terminalHeight = stream.rows ?? defaultTerminalHeight;
|
|
688
698
|
const lines = text.split("\n");
|
|
689
699
|
const toRemove = Math.max(0, lines.length - terminalHeight);
|
|
690
|
-
return toRemove ? sliceAnsi(text, (0,
|
|
700
|
+
return toRemove ? sliceAnsi(text, (0, import_chunk_JX2HIV7V.stripAnsi)(lines.slice(0, toRemove).join("\n")).length + 1) : text;
|
|
691
701
|
};
|
|
692
702
|
function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
693
703
|
let previousLineCount = 0;
|
|
@@ -700,7 +710,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
700
710
|
};
|
|
701
711
|
const render = (...arguments_) => {
|
|
702
712
|
if (!showCursor) {
|
|
703
|
-
|
|
713
|
+
import_chunk_JX2HIV7V.cli_cursor_default.hide();
|
|
704
714
|
}
|
|
705
715
|
let output = fitToTerminalHeight(stream, arguments_.join(" ") + "\n");
|
|
706
716
|
const width = getWidth(stream);
|
|
@@ -720,7 +730,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
720
730
|
render.done = () => {
|
|
721
731
|
reset();
|
|
722
732
|
if (!showCursor) {
|
|
723
|
-
|
|
733
|
+
import_chunk_JX2HIV7V.cli_cursor_default.show();
|
|
724
734
|
}
|
|
725
735
|
};
|
|
726
736
|
return render;
|
|
@@ -746,10 +756,10 @@ var Migrate = class _Migrate {
|
|
|
746
756
|
if (schemaEngineConfig?.engine === "js") {
|
|
747
757
|
const adapter = await schemaEngineConfig.adapter();
|
|
748
758
|
(0, import_chunk_T64SUJ5L.warnDatasourceDriverAdapter)(schemaContext);
|
|
749
|
-
return await
|
|
759
|
+
return await import_chunk_GH6IOZTT.SchemaEngineWasm.setup({ adapter, schemaContext, ...rest });
|
|
750
760
|
}
|
|
751
761
|
const datasource = schemaEngineConfig?.engine === "classic" ? schemaEngineConfig.datasource : void 0;
|
|
752
|
-
return await
|
|
762
|
+
return await import_chunk_SYWL5XS4.SchemaEngineCLI.setup({ datasource, schemaContext, ...rest });
|
|
753
763
|
})();
|
|
754
764
|
return new _Migrate({ engine: schemaEngine, schemaContext, ...rest });
|
|
755
765
|
}
|
|
@@ -874,9 +884,8 @@ var Migrate = class _Migrate {
|
|
|
874
884
|
unexecutable
|
|
875
885
|
};
|
|
876
886
|
}
|
|
877
|
-
async tryToRunGenerate(
|
|
887
|
+
async tryToRunGenerate() {
|
|
878
888
|
if (!this.schemaContext) throw new Error("this.schemaContext is undefined");
|
|
879
|
-
const skipEngines = (0, import_internals.isPrismaPostgres)(datasourceInfo.url);
|
|
880
889
|
const message = [];
|
|
881
890
|
process.stdout.write("\n");
|
|
882
891
|
log_update_default(`Running generate... ${(0, import_chunk_SKRR5WT4.dim)("(Use --skip-generate to skip the generators)")}`);
|
|
@@ -884,7 +893,6 @@ var Migrate = class _Migrate {
|
|
|
884
893
|
schemaContext: this.schemaContext,
|
|
885
894
|
printDownloadProgress: true,
|
|
886
895
|
version: import_engines_version.enginesVersion,
|
|
887
|
-
noEngine: skipEngines,
|
|
888
896
|
registry: import_client_generator_registry.defaultRegistry.toInternal()
|
|
889
897
|
});
|
|
890
898
|
for (const generator of generators) {
|
|
@@ -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_WF7UXKO5_exports = {};
|
|
20
|
+
__export(chunk_WF7UXKO5_exports, {
|
|
21
21
|
DbSeed: () => DbSeed
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_WF7UXKO5_exports);
|
|
24
|
+
var import_chunk_L7EZFBB4 = require("./chunk-L7EZFBB4.js");
|
|
25
25
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
26
26
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
@@ -213,13 +213,10 @@ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 va
|
|
|
213
213
|
if (args["--help"]) {
|
|
214
214
|
return this.help();
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
const seedCommandFromPrismaConfig = config.migrations?.seed;
|
|
218
|
-
const seedCommandFromPkgJson = await (0, import_chunk_PHXLQVPT.getSeedCommandFromPackageJson)(process.cwd());
|
|
219
|
-
const seedCommand = seedCommandFromPrismaConfig ?? seedCommandFromPkgJson;
|
|
216
|
+
const seedCommand = config.migrations?.seed;
|
|
220
217
|
if (!seedCommand) return ``;
|
|
221
218
|
const extraArgs = args._.join(" ");
|
|
222
|
-
const successfulSeeding = await (0,
|
|
219
|
+
const successfulSeeding = await (0, import_chunk_L7EZFBB4.executeSeedCommand)({ commandFromConfig: seedCommand, extraArgs });
|
|
223
220
|
if (successfulSeeding) {
|
|
224
221
|
return `
|
|
225
222
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.`;
|