@prisma/migrate 6.6.0-dev.24 → 6.6.0-dev.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CLI.js +3 -3
- package/dist/Migrate.js +6 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +43 -43
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/{chunk-J4DAOTRR.js → chunk-324Z6HS7.js} +41 -43
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-3WTXX6CQ.js → chunk-5LKIRKDL.js} +60 -60
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-F62CN63F.js → chunk-B4SUSDC2.js} +30 -31
- package/dist/{chunk-ODH7XYW7.js → chunk-BURHAP6O.js} +46 -48
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-MREGRQDD.js → chunk-FBWTUBJC.js} +46 -45
- package/dist/{chunk-MATFO4ZW.js → chunk-G7PJKEOV.js} +33 -33
- package/dist/{chunk-PW3LNSDM.js → chunk-GPNGRJAR.js} +33 -35
- package/dist/{chunk-NAXFX7K7.js → chunk-HJFSTAJX.js} +30 -32
- package/dist/{chunk-4ZFVT4RS.js → chunk-IINN7QUV.js} +165 -190
- package/dist/{chunk-IR55GBON.js → chunk-IWC5MH4R.js} +5 -5
- package/dist/{chunk-ZOEKRXDP.js → chunk-K43RXWQY.js} +21 -18
- package/dist/{chunk-3OQIC7NW.js → chunk-KMHFSDY6.js} +43 -45
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-MKK3GSDF.js → chunk-MKS2ZJJ5.js} +5 -5
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-IY67YUOD.js → chunk-NJYZPNB4.js} +54 -56
- package/dist/{chunk-7X4MPZIO.js → chunk-NYVWWESL.js} +322 -336
- package/dist/{chunk-EGPJABTW.js → chunk-TGV6QGEF.js} +69 -69
- package/dist/{chunk-3VFKYWQZ.js → chunk-URKH6SE2.js} +73 -80
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-N5UBDQRA.js → chunk-VVP3QZ7Q.js} +21 -21
- package/dist/{chunk-DAYMMAJB.js → chunk-YBNDKPPO.js} +36 -38
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-LQO5JIBW.js → chunk-YHLTCM34.js} +323 -337
- package/dist/{chunk-A6PMXMMT.js → chunk-ZB5NPOJW.js} +13 -13
- package/dist/{chunk-V5TUSOJX.js → chunk-ZGR2WQ62.js} +38 -40
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +7 -7
- package/dist/commands/DbPull.js +9 -9
- package/dist/commands/DbPush.js +7 -7
- package/dist/commands/DbSeed.js +4 -4
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +9 -9
- package/dist/commands/MigrateDev.js +11 -11
- package/dist/commands/MigrateDiff.js +10 -10
- package/dist/commands/MigrateReset.js +10 -10
- package/dist/commands/MigrateResolve.js +7 -7
- package/dist/commands/MigrateStatus.js +7 -7
- package/dist/index.js +46 -46
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/getSchemaPathAndPrint.js +1 -1
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -4
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +759 -675
- package/dist/utils/setupMongo.js +552 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -4
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +6 -6
- package/dist/chunk-YYPMC5FN.js +0 -1407
|
@@ -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_URKH6SE2_exports = {};
|
|
30
|
+
__export(chunk_URKH6SE2_exports, {
|
|
31
31
|
cli_cursor_default: () => cli_cursor_default,
|
|
32
32
|
eastAsianWidth: () => eastAsianWidth,
|
|
33
33
|
stringWidth: () => stringWidth,
|
|
34
34
|
stripAnsi: () => stripAnsi
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
36
|
+
module.exports = __toCommonJS(chunk_URKH6SE2_exports);
|
|
38
37
|
var import_node_process = __toESM(require("node:process"));
|
|
39
38
|
var import_node_process2 = __toESM(require("node:process"));
|
|
40
39
|
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
@@ -137,17 +136,17 @@ var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
|
137
136
|
var global = globalThis;
|
|
138
137
|
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
139
138
|
var Emitter = class {
|
|
139
|
+
emitted = {
|
|
140
|
+
afterExit: false,
|
|
141
|
+
exit: false
|
|
142
|
+
};
|
|
143
|
+
listeners = {
|
|
144
|
+
afterExit: [],
|
|
145
|
+
exit: []
|
|
146
|
+
};
|
|
147
|
+
count = 0;
|
|
148
|
+
id = Math.random();
|
|
140
149
|
constructor() {
|
|
141
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "emitted", {
|
|
142
|
-
afterExit: false,
|
|
143
|
-
exit: false
|
|
144
|
-
});
|
|
145
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "listeners", {
|
|
146
|
-
afterExit: [],
|
|
147
|
-
exit: []
|
|
148
|
-
});
|
|
149
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "count", 0);
|
|
150
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "id", Math.random());
|
|
151
150
|
if (global[kExitEmitter]) {
|
|
152
151
|
return global[kExitEmitter];
|
|
153
152
|
}
|
|
@@ -213,125 +212,119 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
213
212
|
unload() {
|
|
214
213
|
}
|
|
215
214
|
};
|
|
216
|
-
var _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _SignalExit_instances, processReallyExit_fn, processEmit_fn;
|
|
217
215
|
var SignalExit = class extends SignalExitBase {
|
|
216
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
217
|
+
// so use a supported signal instead
|
|
218
|
+
/* c8 ignore start */
|
|
219
|
+
#hupSig = process2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
220
|
+
/* c8 ignore stop */
|
|
221
|
+
#emitter = new Emitter();
|
|
222
|
+
#process;
|
|
223
|
+
#originalProcessEmit;
|
|
224
|
+
#originalProcessReallyExit;
|
|
225
|
+
#sigListeners = {};
|
|
226
|
+
#loaded = false;
|
|
218
227
|
constructor(process5) {
|
|
219
228
|
super();
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _emitter, new Emitter());
|
|
223
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _process);
|
|
224
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _originalProcessEmit);
|
|
225
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _originalProcessReallyExit);
|
|
226
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _sigListeners, {});
|
|
227
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _loaded, false);
|
|
228
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _process, process5);
|
|
229
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _sigListeners, {});
|
|
229
|
+
this.#process = process5;
|
|
230
|
+
this.#sigListeners = {};
|
|
230
231
|
for (const sig of signals) {
|
|
231
|
-
|
|
232
|
-
const listeners =
|
|
233
|
-
let { count } =
|
|
232
|
+
this.#sigListeners[sig] = () => {
|
|
233
|
+
const listeners = this.#process.listeners(sig);
|
|
234
|
+
let { count } = this.#emitter;
|
|
234
235
|
const p = process5;
|
|
235
236
|
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
236
237
|
count += p.__signal_exit_emitter__.count;
|
|
237
238
|
}
|
|
238
239
|
if (listeners.length === count) {
|
|
239
240
|
this.unload();
|
|
240
|
-
const ret =
|
|
241
|
-
const s = sig === "SIGHUP" ?
|
|
241
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
242
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
242
243
|
if (!ret)
|
|
243
244
|
process5.kill(process5.pid, s);
|
|
244
245
|
}
|
|
245
246
|
};
|
|
246
247
|
}
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
this.#originalProcessReallyExit = process5.reallyExit;
|
|
249
|
+
this.#originalProcessEmit = process5.emit;
|
|
249
250
|
}
|
|
250
251
|
onExit(cb, opts) {
|
|
251
|
-
if (!processOk(
|
|
252
|
+
if (!processOk(this.#process)) {
|
|
252
253
|
return () => {
|
|
253
254
|
};
|
|
254
255
|
}
|
|
255
|
-
if (
|
|
256
|
+
if (this.#loaded === false) {
|
|
256
257
|
this.load();
|
|
257
258
|
}
|
|
258
259
|
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
259
|
-
|
|
260
|
+
this.#emitter.on(ev, cb);
|
|
260
261
|
return () => {
|
|
261
|
-
|
|
262
|
-
if (
|
|
262
|
+
this.#emitter.removeListener(ev, cb);
|
|
263
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
263
264
|
this.unload();
|
|
264
265
|
}
|
|
265
266
|
};
|
|
266
267
|
}
|
|
267
268
|
load() {
|
|
268
|
-
if (
|
|
269
|
+
if (this.#loaded) {
|
|
269
270
|
return;
|
|
270
271
|
}
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
this.#loaded = true;
|
|
273
|
+
this.#emitter.count += 1;
|
|
273
274
|
for (const sig of signals) {
|
|
274
275
|
try {
|
|
275
|
-
const fn =
|
|
276
|
+
const fn = this.#sigListeners[sig];
|
|
276
277
|
if (fn)
|
|
277
|
-
|
|
278
|
+
this.#process.on(sig, fn);
|
|
278
279
|
} catch (_) {
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
|
-
|
|
282
|
-
return
|
|
282
|
+
this.#process.emit = (ev, ...a) => {
|
|
283
|
+
return this.#processEmit(ev, ...a);
|
|
283
284
|
};
|
|
284
|
-
|
|
285
|
-
return
|
|
285
|
+
this.#process.reallyExit = (code) => {
|
|
286
|
+
return this.#processReallyExit(code);
|
|
286
287
|
};
|
|
287
288
|
}
|
|
288
289
|
unload() {
|
|
289
|
-
if (!
|
|
290
|
+
if (!this.#loaded) {
|
|
290
291
|
return;
|
|
291
292
|
}
|
|
292
|
-
|
|
293
|
+
this.#loaded = false;
|
|
293
294
|
signals.forEach((sig) => {
|
|
294
|
-
const listener =
|
|
295
|
+
const listener = this.#sigListeners[sig];
|
|
295
296
|
if (!listener) {
|
|
296
297
|
throw new Error("Listener not defined for signal: " + sig);
|
|
297
298
|
}
|
|
298
299
|
try {
|
|
299
|
-
|
|
300
|
+
this.#process.removeListener(sig, listener);
|
|
300
301
|
} catch (_) {
|
|
301
302
|
}
|
|
302
303
|
});
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
_hupSig = /* @__PURE__ */ new WeakMap();
|
|
309
|
-
_emitter = /* @__PURE__ */ new WeakMap();
|
|
310
|
-
_process = /* @__PURE__ */ new WeakMap();
|
|
311
|
-
_originalProcessEmit = /* @__PURE__ */ new WeakMap();
|
|
312
|
-
_originalProcessReallyExit = /* @__PURE__ */ new WeakMap();
|
|
313
|
-
_sigListeners = /* @__PURE__ */ new WeakMap();
|
|
314
|
-
_loaded = /* @__PURE__ */ new WeakMap();
|
|
315
|
-
_SignalExit_instances = /* @__PURE__ */ new WeakSet();
|
|
316
|
-
processReallyExit_fn = function(code) {
|
|
317
|
-
if (!processOk((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process))) {
|
|
318
|
-
return 0;
|
|
304
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
305
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
306
|
+
this.#emitter.count -= 1;
|
|
319
307
|
}
|
|
320
|
-
(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
308
|
+
#processReallyExit(code) {
|
|
309
|
+
if (!processOk(this.#process)) {
|
|
310
|
+
return 0;
|
|
311
|
+
}
|
|
312
|
+
this.#process.exitCode = code || 0;
|
|
313
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
314
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
315
|
+
}
|
|
316
|
+
#processEmit(ev, ...args) {
|
|
317
|
+
const og = this.#originalProcessEmit;
|
|
318
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
319
|
+
if (typeof args[0] === "number") {
|
|
320
|
+
this.#process.exitCode = args[0];
|
|
321
|
+
}
|
|
322
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
323
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
324
|
+
return ret;
|
|
325
|
+
} else {
|
|
326
|
+
return og.call(this.#process, ev, ...args);
|
|
329
327
|
}
|
|
330
|
-
const ret = og.call((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process), ev, ...args);
|
|
331
|
-
(0, import_chunk_WWAWV7DQ.__privateGet)(this, _emitter).emit("exit", (0, import_chunk_WWAWV7DQ.__privateGet)(this, _process).exitCode, null);
|
|
332
|
-
return ret;
|
|
333
|
-
} else {
|
|
334
|
-
return og.call((0, import_chunk_WWAWV7DQ.__privateGet)(this, _process), ev, ...args);
|
|
335
328
|
}
|
|
336
329
|
};
|
|
337
330
|
var process2 = globalThis.process;
|
|
@@ -16,16 +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_VAJ4VX67_exports = {};
|
|
20
|
+
__export(chunk_VAJ4VX67_exports, {
|
|
21
21
|
CaptureStdout: () => CaptureStdout
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
23
|
+
module.exports = __toCommonJS(chunk_VAJ4VX67_exports);
|
|
25
24
|
var CaptureStdout = class {
|
|
25
|
+
_capturedText;
|
|
26
|
+
_orig_stdout_write;
|
|
26
27
|
constructor() {
|
|
27
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "_capturedText");
|
|
28
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "_orig_stdout_write");
|
|
29
28
|
this._capturedText = [];
|
|
30
29
|
this._orig_stdout_write = null;
|
|
31
30
|
}
|
|
@@ -26,22 +26,22 @@ 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
|
-
__export2(
|
|
29
|
+
var chunk_VVP3QZ7Q_exports = {};
|
|
30
|
+
__export2(chunk_VVP3QZ7Q_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_VVP3QZ7Q_exports);
|
|
34
|
+
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
35
|
+
var import_chunk_K43RXWQY = require("./chunk-K43RXWQY.js");
|
|
36
36
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
38
38
|
var import_engines_version = require("@prisma/engines-version");
|
|
39
39
|
var import_internals = require("@prisma/internals");
|
|
40
40
|
var import_node_process = __toESM(require("node:process"));
|
|
41
41
|
var import_node_process2 = __toESM(require("node:process"));
|
|
42
42
|
var import_path = __toESM(require("path"));
|
|
43
43
|
var base_exports = {};
|
|
44
|
-
(0,
|
|
44
|
+
(0, import_chunk_2ESYSVXG.__export)(base_exports, {
|
|
45
45
|
beep: () => beep,
|
|
46
46
|
clearScreen: () => clearScreen,
|
|
47
47
|
clearTerminal: () => clearTerminal,
|
|
@@ -402,14 +402,14 @@ var ANSI_SGR_TERMINATOR = "m";
|
|
|
402
402
|
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
403
403
|
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
404
404
|
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
405
|
-
var wordLengths = (string) => string.split(" ").map((character) => (0,
|
|
405
|
+
var wordLengths = (string) => string.split(" ").map((character) => (0, import_chunk_URKH6SE2.stringWidth)(character));
|
|
406
406
|
var wrapWord = (rows, word, columns) => {
|
|
407
407
|
const characters = [...word];
|
|
408
408
|
let isInsideEscape = false;
|
|
409
409
|
let isInsideLinkEscape = false;
|
|
410
|
-
let visible = (0,
|
|
410
|
+
let visible = (0, import_chunk_URKH6SE2.stringWidth)((0, import_chunk_URKH6SE2.stripAnsi)(rows.at(-1)));
|
|
411
411
|
for (const [index, character] of characters.entries()) {
|
|
412
|
-
const characterLength = (0,
|
|
412
|
+
const characterLength = (0, import_chunk_URKH6SE2.stringWidth)(character);
|
|
413
413
|
if (visible + characterLength <= columns) {
|
|
414
414
|
rows[rows.length - 1] += character;
|
|
415
415
|
} else {
|
|
@@ -446,7 +446,7 @@ var stringVisibleTrimSpacesRight = (string) => {
|
|
|
446
446
|
const words = string.split(" ");
|
|
447
447
|
let last = words.length;
|
|
448
448
|
while (last > 0) {
|
|
449
|
-
if ((0,
|
|
449
|
+
if ((0, import_chunk_URKH6SE2.stringWidth)(words[last - 1]) > 0) {
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
last--;
|
|
@@ -469,7 +469,7 @@ var exec = (string, columns, options = {}) => {
|
|
|
469
469
|
if (options.trim !== false) {
|
|
470
470
|
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
471
471
|
}
|
|
472
|
-
let rowLength = (0,
|
|
472
|
+
let rowLength = (0, import_chunk_URKH6SE2.stringWidth)(rows.at(-1));
|
|
473
473
|
if (index !== 0) {
|
|
474
474
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
475
475
|
rows.push("");
|
|
@@ -547,7 +547,7 @@ function isFullwidthCodePoint(codePoint) {
|
|
|
547
547
|
if (!Number.isInteger(codePoint)) {
|
|
548
548
|
return false;
|
|
549
549
|
}
|
|
550
|
-
return (0,
|
|
550
|
+
return (0, import_chunk_URKH6SE2.eastAsianWidth)(codePoint) === 2;
|
|
551
551
|
}
|
|
552
552
|
var ESCAPES2 = /* @__PURE__ */ new Set([27, 155]);
|
|
553
553
|
var CODE_POINT_0 = "0".codePointAt(0);
|
|
@@ -683,7 +683,7 @@ var fitToTerminalHeight = (stream, text) => {
|
|
|
683
683
|
const terminalHeight = stream.rows ?? defaultTerminalHeight;
|
|
684
684
|
const lines = text.split("\n");
|
|
685
685
|
const toRemove = Math.max(0, lines.length - terminalHeight);
|
|
686
|
-
return toRemove ? sliceAnsi(text, (0,
|
|
686
|
+
return toRemove ? sliceAnsi(text, (0, import_chunk_URKH6SE2.stripAnsi)(lines.slice(0, toRemove).join("\n")).length + 1) : text;
|
|
687
687
|
};
|
|
688
688
|
function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
689
689
|
let previousLineCount = 0;
|
|
@@ -696,7 +696,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
696
696
|
};
|
|
697
697
|
const render = (...arguments_) => {
|
|
698
698
|
if (!showCursor) {
|
|
699
|
-
|
|
699
|
+
import_chunk_URKH6SE2.cli_cursor_default.hide();
|
|
700
700
|
}
|
|
701
701
|
let output = fitToTerminalHeight(stream, arguments_.join(" ") + "\n");
|
|
702
702
|
const width = getWidth(stream);
|
|
@@ -716,7 +716,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
|
|
|
716
716
|
render.done = () => {
|
|
717
717
|
reset();
|
|
718
718
|
if (!showCursor) {
|
|
719
|
-
|
|
719
|
+
import_chunk_URKH6SE2.cli_cursor_default.show();
|
|
720
720
|
}
|
|
721
721
|
};
|
|
722
722
|
return render;
|
|
@@ -726,19 +726,19 @@ var log_update_default = logUpdate;
|
|
|
726
726
|
var logUpdateStderr = createLogUpdate(import_node_process.default.stderr);
|
|
727
727
|
var packageJson = eval(`require('../package.json')`);
|
|
728
728
|
var Migrate = class {
|
|
729
|
+
engine;
|
|
730
|
+
schemaPath;
|
|
731
|
+
migrationsDirectoryPath;
|
|
729
732
|
constructor(schemaPath, enabledPreviewFeatures) {
|
|
730
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "engine");
|
|
731
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "schemaPath");
|
|
732
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "migrationsDirectoryPath");
|
|
733
733
|
if (schemaPath) {
|
|
734
734
|
this.schemaPath = import_path.default.resolve(process.cwd(), schemaPath);
|
|
735
735
|
this.migrationsDirectoryPath = import_path.default.join(import_path.default.dirname(this.schemaPath), "migrations");
|
|
736
|
-
this.engine = new
|
|
736
|
+
this.engine = new import_chunk_K43RXWQY.SchemaEngine({
|
|
737
737
|
schemaPath: this.schemaPath,
|
|
738
738
|
enabledPreviewFeatures
|
|
739
739
|
});
|
|
740
740
|
} else {
|
|
741
|
-
this.engine = new
|
|
741
|
+
this.engine = new import_chunk_K43RXWQY.SchemaEngine({
|
|
742
742
|
enabledPreviewFeatures
|
|
743
743
|
});
|
|
744
744
|
}
|
|
@@ -26,24 +26,50 @@ 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_YBNDKPPO_exports = {};
|
|
30
|
+
__export(chunk_YBNDKPPO_exports, {
|
|
31
31
|
DbPush: () => DbPush
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_YBNDKPPO_exports);
|
|
34
|
+
var import_chunk_VVP3QZ7Q = require("./chunk-VVP3QZ7Q.js");
|
|
35
35
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
36
36
|
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
37
37
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
38
38
|
var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
|
|
39
39
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
40
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
41
40
|
var import_internals = require("@prisma/internals");
|
|
42
41
|
var import_prompts = __toESM(require("prompts"));
|
|
43
|
-
var
|
|
42
|
+
var DbPush = class _DbPush {
|
|
44
43
|
static new() {
|
|
45
|
-
return new
|
|
44
|
+
return new _DbPush();
|
|
46
45
|
}
|
|
46
|
+
static help = (0, import_internals.format)(`
|
|
47
|
+
${process.platform === "win32" ? "" : "\u{1F64C} "}Push the state from your Prisma schema to your database
|
|
48
|
+
|
|
49
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
50
|
+
|
|
51
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push [options]
|
|
52
|
+
|
|
53
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
54
|
+
|
|
55
|
+
-h, --help Display this help message
|
|
56
|
+
--config Custom path to your Prisma config file
|
|
57
|
+
--schema Custom path to your Prisma schema
|
|
58
|
+
--accept-data-loss Ignore data loss warnings
|
|
59
|
+
--force-reset Force a reset of the database before push
|
|
60
|
+
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
61
|
+
|
|
62
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
63
|
+
|
|
64
|
+
Push the Prisma schema state to the database
|
|
65
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
|
|
66
|
+
|
|
67
|
+
Specify a schema
|
|
68
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --schema=./schema.prisma
|
|
69
|
+
|
|
70
|
+
Ignore data loss warnings
|
|
71
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --accept-data-loss
|
|
72
|
+
`);
|
|
47
73
|
async parse(argv, config) {
|
|
48
74
|
const args = (0, import_internals.arg)(
|
|
49
75
|
argv,
|
|
@@ -70,7 +96,7 @@ var _DbPush = class _DbPush2 {
|
|
|
70
96
|
const { schemaPath } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
71
97
|
const datasourceInfo = await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath });
|
|
72
98
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
73
|
-
const migrate = new
|
|
99
|
+
const migrate = new import_chunk_VVP3QZ7Q.Migrate(schemaPath);
|
|
74
100
|
try {
|
|
75
101
|
const wasDbCreated = await (0, import_chunk_DJMFXNR4.ensureDatabaseExists)("push", schemaPath);
|
|
76
102
|
if (wasDbCreated) {
|
|
@@ -196,36 +222,8 @@ ${rocketEmoji}${provider === "mongodb" ? migrationSuccessMongoMessage : migratio
|
|
|
196
222
|
if (error) {
|
|
197
223
|
return new import_internals.HelpError(`
|
|
198
224
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
199
|
-
${
|
|
225
|
+
${_DbPush.help}`);
|
|
200
226
|
}
|
|
201
|
-
return
|
|
227
|
+
return _DbPush.help;
|
|
202
228
|
}
|
|
203
229
|
};
|
|
204
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_DbPush, "help", (0, import_internals.format)(`
|
|
205
|
-
${process.platform === "win32" ? "" : "\u{1F64C} "}Push the state from your Prisma schema to your database
|
|
206
|
-
|
|
207
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
208
|
-
|
|
209
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push [options]
|
|
210
|
-
|
|
211
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
212
|
-
|
|
213
|
-
-h, --help Display this help message
|
|
214
|
-
--config Custom path to your Prisma config file
|
|
215
|
-
--schema Custom path to your Prisma schema
|
|
216
|
-
--accept-data-loss Ignore data loss warnings
|
|
217
|
-
--force-reset Force a reset of the database before push
|
|
218
|
-
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
219
|
-
|
|
220
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
221
|
-
|
|
222
|
-
Push the Prisma schema state to the database
|
|
223
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
|
|
224
|
-
|
|
225
|
-
Specify a schema
|
|
226
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --schema=./schema.prisma
|
|
227
|
-
|
|
228
|
-
Ignore data loss warnings
|
|
229
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --accept-data-loss
|
|
230
|
-
`));
|
|
231
|
-
var DbPush = _DbPush;
|
|
@@ -16,15 +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_YBX7R3MT_exports = {};
|
|
20
|
+
__export(chunk_YBX7R3MT_exports, {
|
|
21
21
|
getMigrationName: () => getMigrationName
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_YBX7R3MT_exports);
|
|
24
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
25
25
|
var import_internals = require("@prisma/internals");
|
|
26
26
|
var import_prompts = require("prompts");
|
|
27
|
-
var require_escape_string_regexp = (0,
|
|
27
|
+
var require_escape_string_regexp = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
28
28
|
"../../node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js"(exports, module2) {
|
|
29
29
|
"use strict";
|
|
30
30
|
module2.exports = (string) => {
|
|
@@ -35,7 +35,7 @@ var require_escape_string_regexp = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
var require_lodash = (0,
|
|
38
|
+
var require_lodash = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
39
39
|
"../../node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.js"(exports, module2) {
|
|
40
40
|
"use strict";
|
|
41
41
|
var INFINITY = 1 / 0;
|
|
@@ -279,7 +279,7 @@ var require_lodash = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
279
279
|
module2.exports = deburr;
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
var require_escape_string_regexp2 = (0,
|
|
282
|
+
var require_escape_string_regexp2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
283
283
|
"../../node_modules/.pnpm/escape-string-regexp@2.0.0/node_modules/escape-string-regexp/index.js"(exports, module2) {
|
|
284
284
|
"use strict";
|
|
285
285
|
var matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
|
|
@@ -291,7 +291,7 @@ var require_escape_string_regexp2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
|
-
var require_replacements = (0,
|
|
294
|
+
var require_replacements = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
295
295
|
"../../node_modules/.pnpm/@sindresorhus+transliterate@0.1.2/node_modules/@sindresorhus/transliterate/replacements.js"(exports, module2) {
|
|
296
296
|
"use strict";
|
|
297
297
|
module2.exports = [
|
|
@@ -1067,7 +1067,7 @@ var require_replacements = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1067
1067
|
];
|
|
1068
1068
|
}
|
|
1069
1069
|
});
|
|
1070
|
-
var require_transliterate = (0,
|
|
1070
|
+
var require_transliterate = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1071
1071
|
"../../node_modules/.pnpm/@sindresorhus+transliterate@0.1.2/node_modules/@sindresorhus/transliterate/index.js"(exports, module2) {
|
|
1072
1072
|
"use strict";
|
|
1073
1073
|
var deburr = require_lodash();
|
|
@@ -1098,7 +1098,7 @@ var require_transliterate = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
});
|
|
1101
|
-
var require_overridable_replacements = (0,
|
|
1101
|
+
var require_overridable_replacements = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1102
1102
|
"../../node_modules/.pnpm/@sindresorhus+slugify@1.1.2/node_modules/@sindresorhus/slugify/overridable-replacements.js"(exports, module2) {
|
|
1103
1103
|
"use strict";
|
|
1104
1104
|
module2.exports = [
|
|
@@ -1108,7 +1108,7 @@ var require_overridable_replacements = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1108
1108
|
];
|
|
1109
1109
|
}
|
|
1110
1110
|
});
|
|
1111
|
-
var require_slugify = (0,
|
|
1111
|
+
var require_slugify = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1112
1112
|
"../../node_modules/.pnpm/@sindresorhus+slugify@1.1.2/node_modules/@sindresorhus/slugify/index.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var escapeStringRegexp = require_escape_string_regexp();
|
|
@@ -1183,7 +1183,7 @@ var require_slugify = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1183
1183
|
module2.exports.counter = counter;
|
|
1184
1184
|
}
|
|
1185
1185
|
});
|
|
1186
|
-
var import_slugify = (0,
|
|
1186
|
+
var import_slugify = (0, import_chunk_2ESYSVXG.__toESM)(require_slugify());
|
|
1187
1187
|
async function getMigrationName(name) {
|
|
1188
1188
|
const maxMigrationNameLength = 200;
|
|
1189
1189
|
if (name) {
|