@prisma/migrate 6.17.0-dev.3 → 6.17.0-dev.31

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.
Files changed (51) hide show
  1. package/dist/Migrate.js +6 -5
  2. package/dist/SchemaEngineCLI.js +3 -3
  3. package/dist/SchemaEngineWasm.js +3 -3
  4. package/dist/bin.js +36 -35
  5. package/dist/chunk-3WDCTXHL.js +270 -0
  6. package/dist/{chunk-UQEITMMV.js → chunk-4UHTKK7E.js} +12 -8
  7. package/dist/{chunk-B64PYCYC.js → chunk-5ETYUPYJ.js} +17 -11
  8. package/dist/{chunk-ORBFWBKN.js → chunk-CR34IQRC.js} +5 -5
  9. package/dist/{chunk-DYXEUKV3.js → chunk-D4TRX77Y.js} +6 -6
  10. package/dist/{chunk-YEUENY2G.js → chunk-DDD7GPGH.js} +11 -5
  11. package/dist/{chunk-EXY2VDLY.js → chunk-FBDQVK4W.js} +5 -4
  12. package/dist/{chunk-WXE3X4AN.js → chunk-FSKMAMBM.js} +13 -7
  13. package/dist/{chunk-QF5OMSPA.js → chunk-H5CDIF7X.js} +5 -5
  14. package/dist/{chunk-BKW5AGJV.js → chunk-M22W35EN.js} +11 -5
  15. package/dist/{chunk-U62JTEME.js → chunk-MCGCRK5I.js} +5 -5
  16. package/dist/{chunk-EJUXYFV3.js → chunk-OP2BDF75.js} +5 -4
  17. package/dist/{chunk-CXSHCKU6.js → chunk-OXN62EEV.js} +5 -5
  18. package/dist/chunk-PHXLQVPT.js +1890 -0
  19. package/dist/{chunk-F3JIZWIS.js → chunk-PSCP5S54.js} +17 -17
  20. package/dist/{chunk-CD4AWGFA.js → chunk-RHCOFXBR.js} +9 -4
  21. package/dist/{chunk-R2YKCEAN.js → chunk-RUJYIYAK.js} +5 -5
  22. package/dist/{chunk-RNQEWSLQ.js → chunk-VDFDEQDX.js} +16 -6
  23. package/dist/{chunk-YQ6GTOKJ.js → chunk-VSNIZVYG.js} +11 -10
  24. package/dist/{chunk-IINN7QUV.js → chunk-VU5BLQUI.js} +8 -8
  25. package/dist/{chunk-G56DQP5E.js → chunk-VUKPTQSN.js} +5 -5
  26. package/dist/{chunk-URKH6SE2.js → chunk-VV4M6AN7.js} +5 -251
  27. package/dist/commands/DbDrop.js +3 -3
  28. package/dist/commands/DbExecute.js +7 -6
  29. package/dist/commands/DbPull.js +10 -9
  30. package/dist/commands/DbPush.js +8 -7
  31. package/dist/commands/DbSeed.js +4 -3
  32. package/dist/commands/MigrateDeploy.js +7 -6
  33. package/dist/commands/MigrateDev.js +9 -8
  34. package/dist/commands/MigrateDiff.js +7 -6
  35. package/dist/commands/MigrateReset.js +10 -9
  36. package/dist/commands/MigrateResolve.js +7 -6
  37. package/dist/commands/MigrateStatus.js +7 -6
  38. package/dist/extensions.js +1 -0
  39. package/dist/index.js +43 -42
  40. package/dist/migrate/src/Migrate.d.ts +2 -0
  41. package/dist/migrate/src/SchemaEngineCLI.d.ts +3 -0
  42. package/dist/migrate/src/extensions.d.ts +13 -0
  43. package/dist/utils/ai-safety.js +2 -2
  44. package/dist/utils/getDatabaseVersionSafe.js +7 -6
  45. package/dist/utils/introspectSql.js +7 -6
  46. package/dist/utils/seed.js +4 -3
  47. package/dist/utils/setupMSSQL.js +544 -16
  48. package/dist/utils/setupMongo.js +3 -3
  49. package/dist/utils/spinner.js +4 -3
  50. package/package.json +11 -11
  51. package/dist/chunk-HFXUQT52.js +0 -1982
@@ -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 chunk_F3JIZWIS_exports = {};
30
- __export(chunk_F3JIZWIS_exports, {
29
+ var chunk_PSCP5S54_exports = {};
30
+ __export(chunk_PSCP5S54_exports, {
31
31
  Migrate: () => Migrate
32
32
  });
33
- module.exports = __toCommonJS(chunk_F3JIZWIS_exports);
33
+ module.exports = __toCommonJS(chunk_PSCP5S54_exports);
34
34
  var import_chunk_PCTCQIOH = require("./chunk-PCTCQIOH.js");
35
- var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.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 import_chunk_ORBFWBKN = require("./chunk-ORBFWBKN.js");
39
- var import_chunk_CD4AWGFA = require("./chunk-CD4AWGFA.js");
38
+ var import_chunk_CR34IQRC = require("./chunk-CR34IQRC.js");
39
+ var import_chunk_RHCOFXBR = require("./chunk-RHCOFXBR.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");
@@ -406,14 +406,14 @@ var ANSI_SGR_TERMINATOR = "m";
406
406
  var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
407
407
  var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
408
408
  var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
409
- var wordLengths = (string) => string.split(" ").map((character) => (0, import_chunk_URKH6SE2.stringWidth)(character));
409
+ var wordLengths = (string) => string.split(" ").map((character) => (0, import_chunk_VV4M6AN7.stringWidth)(character));
410
410
  var wrapWord = (rows, word, columns) => {
411
411
  const characters = [...word];
412
412
  let isInsideEscape = false;
413
413
  let isInsideLinkEscape = false;
414
- let visible = (0, import_chunk_URKH6SE2.stringWidth)((0, import_chunk_URKH6SE2.stripAnsi)(rows.at(-1)));
414
+ let visible = (0, import_chunk_VV4M6AN7.stringWidth)((0, import_chunk_VV4M6AN7.stripAnsi)(rows.at(-1)));
415
415
  for (const [index, character] of characters.entries()) {
416
- const characterLength = (0, import_chunk_URKH6SE2.stringWidth)(character);
416
+ const characterLength = (0, import_chunk_VV4M6AN7.stringWidth)(character);
417
417
  if (visible + characterLength <= columns) {
418
418
  rows[rows.length - 1] += character;
419
419
  } else {
@@ -450,7 +450,7 @@ var stringVisibleTrimSpacesRight = (string) => {
450
450
  const words = string.split(" ");
451
451
  let last = words.length;
452
452
  while (last > 0) {
453
- if ((0, import_chunk_URKH6SE2.stringWidth)(words[last - 1]) > 0) {
453
+ if ((0, import_chunk_VV4M6AN7.stringWidth)(words[last - 1]) > 0) {
454
454
  break;
455
455
  }
456
456
  last--;
@@ -473,7 +473,7 @@ var exec = (string, columns, options = {}) => {
473
473
  if (options.trim !== false) {
474
474
  rows[rows.length - 1] = rows.at(-1).trimStart();
475
475
  }
476
- let rowLength = (0, import_chunk_URKH6SE2.stringWidth)(rows.at(-1));
476
+ let rowLength = (0, import_chunk_VV4M6AN7.stringWidth)(rows.at(-1));
477
477
  if (index !== 0) {
478
478
  if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
479
479
  rows.push("");
@@ -551,7 +551,7 @@ function isFullwidthCodePoint(codePoint) {
551
551
  if (!Number.isInteger(codePoint)) {
552
552
  return false;
553
553
  }
554
- return (0, import_chunk_URKH6SE2.eastAsianWidth)(codePoint) === 2;
554
+ return (0, import_chunk_VV4M6AN7.eastAsianWidth)(codePoint) === 2;
555
555
  }
556
556
  var ESCAPES2 = /* @__PURE__ */ new Set([27, 155]);
557
557
  var CODE_POINT_0 = "0".codePointAt(0);
@@ -687,7 +687,7 @@ var fitToTerminalHeight = (stream, text) => {
687
687
  const terminalHeight = stream.rows ?? defaultTerminalHeight;
688
688
  const lines = text.split("\n");
689
689
  const toRemove = Math.max(0, lines.length - terminalHeight);
690
- return toRemove ? sliceAnsi(text, (0, import_chunk_URKH6SE2.stripAnsi)(lines.slice(0, toRemove).join("\n")).length + 1) : text;
690
+ return toRemove ? sliceAnsi(text, (0, import_chunk_VV4M6AN7.stripAnsi)(lines.slice(0, toRemove).join("\n")).length + 1) : text;
691
691
  };
692
692
  function createLogUpdate(stream, { showCursor = false } = {}) {
693
693
  let previousLineCount = 0;
@@ -700,7 +700,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
700
700
  };
701
701
  const render = (...arguments_) => {
702
702
  if (!showCursor) {
703
- import_chunk_URKH6SE2.cli_cursor_default.hide();
703
+ import_chunk_VV4M6AN7.cli_cursor_default.hide();
704
704
  }
705
705
  let output = fitToTerminalHeight(stream, arguments_.join(" ") + "\n");
706
706
  const width = getWidth(stream);
@@ -720,7 +720,7 @@ function createLogUpdate(stream, { showCursor = false } = {}) {
720
720
  render.done = () => {
721
721
  reset();
722
722
  if (!showCursor) {
723
- import_chunk_URKH6SE2.cli_cursor_default.show();
723
+ import_chunk_VV4M6AN7.cli_cursor_default.show();
724
724
  }
725
725
  };
726
726
  return render;
@@ -744,9 +744,9 @@ var Migrate = class _Migrate {
744
744
  static async setup({ adapter, schemaContext, ...rest }) {
745
745
  const engine = await (async () => {
746
746
  if (adapter) {
747
- return await import_chunk_ORBFWBKN.SchemaEngineWasm.setup({ adapter, schemaContext, ...rest });
747
+ return await import_chunk_CR34IQRC.SchemaEngineWasm.setup({ adapter, schemaContext, ...rest });
748
748
  } else {
749
- return await import_chunk_CD4AWGFA.SchemaEngineCLI.setup({ schemaContext, ...rest });
749
+ return await import_chunk_RHCOFXBR.SchemaEngineCLI.setup({ schemaContext, ...rest });
750
750
  }
751
751
  })();
752
752
  (0, import_chunk_PCTCQIOH.warnDatasourceDriverAdapter)(schemaContext, adapter);
@@ -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 chunk_CD4AWGFA_exports = {};
30
- __export(chunk_CD4AWGFA_exports, {
29
+ var chunk_RHCOFXBR_exports = {};
30
+ __export(chunk_RHCOFXBR_exports, {
31
31
  EngineError: () => EngineError,
32
32
  SchemaEngineCLI: () => SchemaEngineCLI
33
33
  });
34
- module.exports = __toCommonJS(chunk_CD4AWGFA_exports);
34
+ module.exports = __toCommonJS(chunk_RHCOFXBR_exports);
35
35
  var import_chunk_AXR7LS2N = require("./chunk-AXR7LS2N.js");
36
36
  var import_chunk_L6KOIJJ5 = require("./chunk-L6KOIJJ5.js");
37
37
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
@@ -62,18 +62,20 @@ var SchemaEngineCLI = class _SchemaEngineCLI {
62
62
  lastError = null;
63
63
  initPromise;
64
64
  enabledPreviewFeatures;
65
+ extensionConfig;
65
66
  // `latestSchema` is set to the latest schema that was used in `introspect()`
66
67
  // TODO: remove, it's not used anywhere.
67
68
  latestSchema;
68
69
  // `isRunning` is set to true when the engine is initialized, and set to false when the engine is stopped
69
70
  isRunning = false;
70
- constructor({ debug = false, schemaContext, enabledPreviewFeatures }) {
71
+ constructor({ debug = false, schemaContext, enabledPreviewFeatures, extensions }) {
71
72
  this.schemaContext = schemaContext;
72
73
  if (debug) {
73
74
  import_debug.default.enable("SchemaEngine*");
74
75
  }
75
76
  this.debug = debug;
76
77
  this.enabledPreviewFeatures = enabledPreviewFeatures;
78
+ this.extensionConfig = extensions ? { types: extensions.flatMap((ext) => ext.types) } : void 0;
77
79
  }
78
80
  static setup(input) {
79
81
  return Promise.resolve(new _SchemaEngineCLI(input));
@@ -320,6 +322,9 @@ var SchemaEngineCLI = class _SchemaEngineCLI {
320
322
  if (this.enabledPreviewFeatures && Array.isArray(this.enabledPreviewFeatures) && this.enabledPreviewFeatures.length > 0) {
321
323
  args.push(...["--enabled-preview-features", this.enabledPreviewFeatures.join(",")]);
322
324
  }
325
+ if (this.extensionConfig) {
326
+ args.push(...["--extension-types", JSON.stringify(this.extensionConfig)]);
327
+ }
323
328
  this.child = (0, import_child_process.spawn)(binaryPath, args, {
324
329
  cwd: projectDir,
325
330
  stdio: ["pipe", "pipe", this.debug ? process.stderr : "pipe"],
@@ -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 chunk_R2YKCEAN_exports = {};
30
- __export(chunk_R2YKCEAN_exports, {
29
+ var chunk_RUJYIYAK_exports = {};
30
+ __export(chunk_RUJYIYAK_exports, {
31
31
  getDatabaseVersionSafe: () => getDatabaseVersionSafe
32
32
  });
33
- module.exports = __toCommonJS(chunk_R2YKCEAN_exports);
34
- var import_chunk_F3JIZWIS = require("./chunk-F3JIZWIS.js");
33
+ module.exports = __toCommonJS(chunk_RUJYIYAK_exports);
34
+ var import_chunk_PSCP5S54 = require("./chunk-PSCP5S54.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 import_chunk_F3JIZWIS.Migrate.setup({});
41
+ migrate = await import_chunk_PSCP5S54.Migrate.setup({});
42
42
  dbVersion = await migrate.engine.getDatabaseVersion(args);
43
43
  } catch (e) {
44
44
  debug(e);
@@ -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 chunk_RNQEWSLQ_exports = {};
20
- __export(chunk_RNQEWSLQ_exports, {
19
+ var chunk_VDFDEQDX_exports = {};
20
+ __export(chunk_VDFDEQDX_exports, {
21
21
  MigrateResolve: () => MigrateResolve
22
22
  });
23
- module.exports = __toCommonJS(chunk_RNQEWSLQ_exports);
23
+ module.exports = __toCommonJS(chunk_VDFDEQDX_exports);
24
24
  var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
25
25
  var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
26
- var import_chunk_F3JIZWIS = require("./chunk-F3JIZWIS.js");
26
+ var import_chunk_PSCP5S54 = require("./chunk-PSCP5S54.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 {
@@ -112,7 +112,12 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_in
112
112
  if (!adapter) {
113
113
  await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
114
114
  }
115
- const migrate = await import_chunk_F3JIZWIS.Migrate.setup({ adapter, migrationsDirPath, schemaContext });
115
+ const migrate = await import_chunk_PSCP5S54.Migrate.setup({
116
+ adapter,
117
+ migrationsDirPath,
118
+ schemaContext,
119
+ extensions: config["extensions"]
120
+ });
116
121
  try {
117
122
  await migrate.markMigrationApplied({
118
123
  migrationId: args["--applied"]
@@ -133,7 +138,12 @@ Migration ${args["--applied"]} marked as applied.
133
138
  );
134
139
  }
135
140
  await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
136
- const migrate = await import_chunk_F3JIZWIS.Migrate.setup({ adapter: void 0, migrationsDirPath, schemaContext });
141
+ const migrate = await import_chunk_PSCP5S54.Migrate.setup({
142
+ adapter: void 0,
143
+ migrationsDirPath,
144
+ schemaContext,
145
+ extensions: config["extensions"]
146
+ });
137
147
  try {
138
148
  await migrate.markMigrationRolledBack({
139
149
  migrationId: args["--rolled-back"]
@@ -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 chunk_YQ6GTOKJ_exports = {};
30
- __export(chunk_YQ6GTOKJ_exports, {
29
+ var chunk_VSNIZVYG_exports = {};
30
+ __export(chunk_VSNIZVYG_exports, {
31
31
  MigrateDev: () => MigrateDev
32
32
  });
33
- module.exports = __toCommonJS(chunk_YQ6GTOKJ_exports);
33
+ module.exports = __toCommonJS(chunk_VSNIZVYG_exports);
34
34
  var import_chunk_C3722PDA = require("./chunk-C3722PDA.js");
35
35
  var import_chunk_7CQBDP4H = require("./chunk-7CQBDP4H.js");
36
- var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
37
- var import_chunk_HFXUQT52 = require("./chunk-HFXUQT52.js");
38
36
  var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
39
37
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
38
+ var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
40
39
  var import_chunk_2FXU5NZQ = require("./chunk-2FXU5NZQ.js");
41
40
  var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
42
- var import_chunk_F3JIZWIS = require("./chunk-F3JIZWIS.js");
41
+ var import_chunk_PHXLQVPT = require("./chunk-PHXLQVPT.js");
42
+ var import_chunk_PSCP5S54 = require("./chunk-PSCP5S54.js");
43
43
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
44
44
  var import_node_path = __toESM(require("node:path"));
45
45
  var import_debug = __toESM(require("@prisma/debug"));
@@ -123,12 +123,13 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
123
123
  externalTables: config.tables?.external ?? [],
124
124
  externalEnums: config.enums?.external ?? []
125
125
  };
126
- const migrate = await import_chunk_F3JIZWIS.Migrate.setup({
126
+ const migrate = await import_chunk_PSCP5S54.Migrate.setup({
127
127
  adapter,
128
128
  migrationsDirPath,
129
129
  schemaContext,
130
130
  schemaFilter,
131
- shadowDbInitScript: config.migrations?.initShadowDb
131
+ shadowDbInitScript: config.migrations?.initShadowDb,
132
+ extensions: config["extensions"]
132
133
  });
133
134
  let devDiagnostic;
134
135
  try {
@@ -285,11 +286,11 @@ ${(0, import_chunk_SKRR5WT4.green)("Your database is now in sync with your schem
285
286
  if (wasDbCreated && !process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
286
287
  try {
287
288
  const seedCommandFromPrismaConfig = config.migrations?.seed;
288
- const seedCommandFromPkgJson = await (0, import_chunk_HFXUQT52.getSeedCommandFromPackageJson)(process.cwd());
289
+ const seedCommandFromPkgJson = await (0, import_chunk_PHXLQVPT.getSeedCommandFromPackageJson)(process.cwd());
289
290
  const seedCommand = seedCommandFromPrismaConfig ?? seedCommandFromPkgJson;
290
291
  if (seedCommand) {
291
292
  process.stdout.write("\n");
292
- const successfulSeeding = await (0, import_chunk_HFXUQT52.executeSeedCommand)({ commandFromConfig: seedCommand });
293
+ const successfulSeeding = await (0, import_chunk_PHXLQVPT.executeSeedCommand)({ commandFromConfig: seedCommand });
293
294
  if (successfulSeeding) {
294
295
  process.stdout.write(`
295
296
  ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
@@ -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 chunk_IINN7QUV_exports = {};
30
- __export(chunk_IINN7QUV_exports, {
29
+ var chunk_VU5BLQUI_exports = {};
30
+ __export(chunk_VU5BLQUI_exports, {
31
31
  createSpinner: () => createSpinner
32
32
  });
33
- module.exports = __toCommonJS(chunk_IINN7QUV_exports);
34
- var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
33
+ module.exports = __toCommonJS(chunk_VU5BLQUI_exports);
34
+ var import_chunk_VV4M6AN7 = require("./chunk-VV4M6AN7.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"));
@@ -2382,8 +2382,8 @@ var Ora = class {
2382
2382
  const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
2383
2383
  const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
2384
2384
  this.#lineCount = 0;
2385
- for (const line of (0, import_chunk_URKH6SE2.stripAnsi)(fullText).split("\n")) {
2386
- this.#lineCount += Math.max(1, Math.ceil((0, import_chunk_URKH6SE2.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns));
2385
+ for (const line of (0, import_chunk_VV4M6AN7.stripAnsi)(fullText).split("\n")) {
2386
+ this.#lineCount += Math.max(1, Math.ceil((0, import_chunk_VV4M6AN7.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns));
2387
2387
  }
2388
2388
  }
2389
2389
  get isEnabled() {
@@ -2465,7 +2465,7 @@ var Ora = class {
2465
2465
  return this;
2466
2466
  }
2467
2467
  if (this.#options.hideCursor) {
2468
- import_chunk_URKH6SE2.cli_cursor_default.hide(this.#stream);
2468
+ import_chunk_VV4M6AN7.cli_cursor_default.hide(this.#stream);
2469
2469
  }
2470
2470
  if (this.#options.discardStdin && import_node_process.default.stdin.isTTY) {
2471
2471
  this.#isDiscardingStdin = true;
@@ -2484,7 +2484,7 @@ var Ora = class {
2484
2484
  this.#frameIndex = 0;
2485
2485
  this.clear();
2486
2486
  if (this.#options.hideCursor) {
2487
- import_chunk_URKH6SE2.cli_cursor_default.show(this.#stream);
2487
+ import_chunk_VV4M6AN7.cli_cursor_default.show(this.#stream);
2488
2488
  }
2489
2489
  if (this.#options.discardStdin && import_node_process.default.stdin.isTTY && this.#isDiscardingStdin) {
2490
2490
  stdin_discarder_default.stop();
@@ -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 chunk_G56DQP5E_exports = {};
20
- __export(chunk_G56DQP5E_exports, {
19
+ var chunk_VUKPTQSN_exports = {};
20
+ __export(chunk_VUKPTQSN_exports, {
21
21
  introspectSql: () => introspectSql
22
22
  });
23
- module.exports = __toCommonJS(chunk_G56DQP5E_exports);
24
- var import_chunk_F3JIZWIS = require("./chunk-F3JIZWIS.js");
23
+ module.exports = __toCommonJS(chunk_VUKPTQSN_exports);
24
+ var import_chunk_PSCP5S54 = require("./chunk-PSCP5S54.js");
25
25
  var import_internals = require("@prisma/internals");
26
26
  var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
27
27
  async function introspectSql(schemaContext, queries) {
@@ -41,7 +41,7 @@ async function introspectSql(schemaContext, queries) {
41
41
  `Could not get url from datasource ${firstDatasource.name} in ${schemaContext.loadedFromPathForLogMessages}`
42
42
  );
43
43
  }
44
- const migrate = await import_chunk_F3JIZWIS.Migrate.setup({ schemaContext });
44
+ const migrate = await import_chunk_PSCP5S54.Migrate.setup({ schemaContext });
45
45
  const schemaEngine = migrate.engine;
46
46
  const results = [];
47
47
  const errors = [];
@@ -26,14 +26,15 @@ 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 chunk_URKH6SE2_exports = {};
30
- __export(chunk_URKH6SE2_exports, {
29
+ var chunk_VV4M6AN7_exports = {};
30
+ __export(chunk_VV4M6AN7_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(chunk_URKH6SE2_exports);
36
+ module.exports = __toCommonJS(chunk_VV4M6AN7_exports);
37
+ var import_chunk_3WDCTXHL = require("./chunk-3WDCTXHL.js");
37
38
  var import_node_process = __toESM(require("node:process"));
38
39
  var import_node_process2 = __toESM(require("node:process"));
39
40
  var copyProperty = (to, from, property, ignoreNonConfigurable) => {
@@ -109,256 +110,9 @@ onetime.callCount = (function_) => {
109
110
  return calledFunctions.get(function_);
110
111
  };
111
112
  var onetime_default = onetime;
112
- var signals = [];
113
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
114
- if (process.platform !== "win32") {
115
- signals.push(
116
- "SIGALRM",
117
- "SIGABRT",
118
- "SIGVTALRM",
119
- "SIGXCPU",
120
- "SIGXFSZ",
121
- "SIGUSR2",
122
- "SIGTRAP",
123
- "SIGSYS",
124
- "SIGQUIT",
125
- "SIGIOT"
126
- // should detect profiler and enable/disable accordingly.
127
- // see #21
128
- // 'SIGPROF'
129
- );
130
- }
131
- if (process.platform === "linux") {
132
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
133
- }
134
- var processOk = (process5) => !!process5 && typeof process5 === "object" && typeof process5.removeListener === "function" && typeof process5.emit === "function" && typeof process5.reallyExit === "function" && typeof process5.listeners === "function" && typeof process5.kill === "function" && typeof process5.pid === "number" && typeof process5.on === "function";
135
- var kExitEmitter = Symbol.for("signal-exit emitter");
136
- var global = globalThis;
137
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
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();
149
- constructor() {
150
- if (global[kExitEmitter]) {
151
- return global[kExitEmitter];
152
- }
153
- ObjectDefineProperty(global, kExitEmitter, {
154
- value: this,
155
- writable: false,
156
- enumerable: false,
157
- configurable: false
158
- });
159
- }
160
- on(ev, fn) {
161
- this.listeners[ev].push(fn);
162
- }
163
- removeListener(ev, fn) {
164
- const list = this.listeners[ev];
165
- const i = list.indexOf(fn);
166
- if (i === -1) {
167
- return;
168
- }
169
- if (i === 0 && list.length === 1) {
170
- list.length = 0;
171
- } else {
172
- list.splice(i, 1);
173
- }
174
- }
175
- emit(ev, code, signal) {
176
- if (this.emitted[ev]) {
177
- return false;
178
- }
179
- this.emitted[ev] = true;
180
- let ret = false;
181
- for (const fn of this.listeners[ev]) {
182
- ret = fn(code, signal) === true || ret;
183
- }
184
- if (ev === "exit") {
185
- ret = this.emit("afterExit", code, signal) || ret;
186
- }
187
- return ret;
188
- }
189
- };
190
- var SignalExitBase = class {
191
- };
192
- var signalExitWrap = (handler) => {
193
- return {
194
- onExit(cb, opts) {
195
- return handler.onExit(cb, opts);
196
- },
197
- load() {
198
- return handler.load();
199
- },
200
- unload() {
201
- return handler.unload();
202
- }
203
- };
204
- };
205
- var SignalExitFallback = class extends SignalExitBase {
206
- onExit() {
207
- return () => {
208
- };
209
- }
210
- load() {
211
- }
212
- unload() {
213
- }
214
- };
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;
227
- constructor(process5) {
228
- super();
229
- this.#process = process5;
230
- this.#sigListeners = {};
231
- for (const sig of signals) {
232
- this.#sigListeners[sig] = () => {
233
- const listeners = this.#process.listeners(sig);
234
- let { count } = this.#emitter;
235
- const p = process5;
236
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
237
- count += p.__signal_exit_emitter__.count;
238
- }
239
- if (listeners.length === count) {
240
- this.unload();
241
- const ret = this.#emitter.emit("exit", null, sig);
242
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
243
- if (!ret)
244
- process5.kill(process5.pid, s);
245
- }
246
- };
247
- }
248
- this.#originalProcessReallyExit = process5.reallyExit;
249
- this.#originalProcessEmit = process5.emit;
250
- }
251
- onExit(cb, opts) {
252
- if (!processOk(this.#process)) {
253
- return () => {
254
- };
255
- }
256
- if (this.#loaded === false) {
257
- this.load();
258
- }
259
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
260
- this.#emitter.on(ev, cb);
261
- return () => {
262
- this.#emitter.removeListener(ev, cb);
263
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
264
- this.unload();
265
- }
266
- };
267
- }
268
- load() {
269
- if (this.#loaded) {
270
- return;
271
- }
272
- this.#loaded = true;
273
- this.#emitter.count += 1;
274
- for (const sig of signals) {
275
- try {
276
- const fn = this.#sigListeners[sig];
277
- if (fn)
278
- this.#process.on(sig, fn);
279
- } catch (_) {
280
- }
281
- }
282
- this.#process.emit = (ev, ...a) => {
283
- return this.#processEmit(ev, ...a);
284
- };
285
- this.#process.reallyExit = (code) => {
286
- return this.#processReallyExit(code);
287
- };
288
- }
289
- unload() {
290
- if (!this.#loaded) {
291
- return;
292
- }
293
- this.#loaded = false;
294
- signals.forEach((sig) => {
295
- const listener = this.#sigListeners[sig];
296
- if (!listener) {
297
- throw new Error("Listener not defined for signal: " + sig);
298
- }
299
- try {
300
- this.#process.removeListener(sig, listener);
301
- } catch (_) {
302
- }
303
- });
304
- this.#process.emit = this.#originalProcessEmit;
305
- this.#process.reallyExit = this.#originalProcessReallyExit;
306
- this.#emitter.count -= 1;
307
- }
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);
327
- }
328
- }
329
- };
330
- var process2 = globalThis.process;
331
- var {
332
- /**
333
- * Called when the process is exiting, whether via signal, explicit
334
- * exit, or running out of stuff to do.
335
- *
336
- * If the global process object is not suitable for instrumentation,
337
- * then this will be a no-op.
338
- *
339
- * Returns a function that may be used to unload signal-exit.
340
- */
341
- onExit,
342
- /**
343
- * Load the listeners. Likely you never need to call this, unless
344
- * doing a rather deep integration with signal-exit functionality.
345
- * Mostly exposed for the benefit of testing.
346
- *
347
- * @internal
348
- */
349
- load,
350
- /**
351
- * Unload the listeners. Likely you never need to call this, unless
352
- * doing a rather deep integration with signal-exit functionality.
353
- * Mostly exposed for the benefit of testing.
354
- *
355
- * @internal
356
- */
357
- unload
358
- } = signalExitWrap(processOk(process2) ? new SignalExit(process2) : new SignalExitFallback());
359
113
  var terminal = import_node_process2.default.stderr.isTTY ? import_node_process2.default.stderr : import_node_process2.default.stdout.isTTY ? import_node_process2.default.stdout : void 0;
360
114
  var restoreCursor = terminal ? onetime_default(() => {
361
- onExit(() => {
115
+ (0, import_chunk_3WDCTXHL.onExit)(() => {
362
116
  terminal.write("\x1B[?25h");
363
117
  }, { alwaysLast: true });
364
118
  }) : () => {
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var DbDrop_exports = {};
20
20
  __export(DbDrop_exports, {
21
- DbDrop: () => import_chunk_CXSHCKU6.DbDrop
21
+ DbDrop: () => import_chunk_OXN62EEV.DbDrop
22
22
  });
23
23
  module.exports = __toCommonJS(DbDrop_exports);
24
- var import_chunk_CXSHCKU6 = require("../chunk-CXSHCKU6.js");
24
+ var import_chunk_OXN62EEV = require("../chunk-OXN62EEV.js");
25
25
  var import_chunk_IHDN3L3R = require("../chunk-IHDN3L3R.js");
26
- var import_chunk_EXY2VDLY = require("../chunk-EXY2VDLY.js");
26
+ var import_chunk_FBDQVK4W = require("../chunk-FBDQVK4W.js");
27
27
  var import_chunk_3WC4XD74 = require("../chunk-3WC4XD74.js");
28
28
  var import_chunk_2FXU5NZQ = require("../chunk-2FXU5NZQ.js");
29
29
  var import_chunk_74LUB4XX = require("../chunk-74LUB4XX.js");