@prisma/migrate 6.4.0-dev.6 → 6.4.0-dev.60

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 (68) hide show
  1. package/dist/CLI.js +3 -3
  2. package/dist/Migrate.js +4 -4
  3. package/dist/SchemaEngine.js +4 -4
  4. package/dist/bin.js +61 -47
  5. package/dist/{chunk-HAJNCOW7.js → chunk-26XQQ4AG.js} +25 -23
  6. package/dist/{chunk-I63N54YI.js → chunk-2RSEPJFX.js} +15 -13
  7. package/dist/{chunk-77RYI3ZW.js → chunk-4B2LXK4R.js} +14 -12
  8. package/dist/{chunk-CK5VLKFM.js → chunk-4UJBOCZJ.js} +7 -6
  9. package/dist/{chunk-43RWRQLU.js → chunk-5HZLCY6X.js} +14 -12
  10. package/dist/{chunk-AMRGQNRR.js → chunk-75EIHNAH.js} +6 -6
  11. package/dist/{chunk-Q3SQU7C6.js → chunk-7S3Q4MCN.js} +4 -4
  12. package/dist/{chunk-G66QFMM5.js → chunk-AOX7CJAS.js} +14 -12
  13. package/dist/{chunk-GRGGAY6L.js → chunk-CUDKD32S.js} +159 -5
  14. package/dist/{chunk-CNAS3YE2.js → chunk-DUCG3NRP.js} +76 -42
  15. package/dist/{chunk-JESW2ENL.js → chunk-FF3526PX.js} +14 -12
  16. package/dist/{chunk-JZ6FKTWG.js → chunk-FUSFURVP.js} +6 -6
  17. package/dist/{chunk-CSUAUCRR.js → chunk-GCTCQLOF.js} +15 -13
  18. package/dist/{chunk-7QAR4NT3.js → chunk-K44VNAFW.js} +15 -13
  19. package/dist/{chunk-KZEXQFQA.js → chunk-KK5B5L6X.js} +77 -43
  20. package/dist/{chunk-EYA6AFSF.js → chunk-M5YNQ2NP.js} +5 -5
  21. package/dist/{chunk-NJUAN6V2.js → chunk-O4BT6W33.js} +7 -6
  22. package/dist/{chunk-ZKWJDQMB.js → chunk-UVNSK22K.js} +7 -7
  23. package/dist/{chunk-WJT3IOMB.js → chunk-X6XGFLEF.js} +11 -9
  24. package/dist/{chunk-E2XKFV2C.js → chunk-YD7GG4WS.js} +8 -6
  25. package/dist/{chunk-JTNVQIRB.js → chunk-YWWOSXMY.js} +6 -6
  26. package/dist/commands/DbCommand.js +3 -3
  27. package/dist/commands/DbDrop.js +3 -3
  28. package/dist/commands/DbExecute.js +5 -5
  29. package/dist/commands/DbPull.js +5 -5
  30. package/dist/commands/DbPush.js +6 -6
  31. package/dist/commands/DbSeed.js +3 -3
  32. package/dist/commands/MigrateCommand.js +3 -3
  33. package/dist/commands/MigrateDeploy.js +6 -6
  34. package/dist/commands/MigrateDev.js +6 -6
  35. package/dist/commands/MigrateDiff.js +5 -5
  36. package/dist/commands/MigrateReset.js +6 -6
  37. package/dist/commands/MigrateResolve.js +6 -6
  38. package/dist/commands/MigrateStatus.js +6 -6
  39. package/dist/index.js +54 -54
  40. package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +2 -1
  41. package/dist/internals/src/cli/getSchema.d.ts +20 -37
  42. package/dist/internals/src/cli/hashes.d.ts +2 -1
  43. package/dist/internals/src/cli/types.d.ts +2 -1
  44. package/dist/internals/src/index.d.ts +2 -1
  45. package/dist/internals/src/utils/loadEnvFile.d.ts +4 -2
  46. package/dist/internals/src/utils/toSchemasContainer.d.ts +1 -1
  47. package/dist/migrate/src/CLI.d.ts +2 -1
  48. package/dist/migrate/src/commands/DbCommand.d.ts +2 -1
  49. package/dist/migrate/src/commands/DbDrop.d.ts +2 -1
  50. package/dist/migrate/src/commands/DbExecute.d.ts +2 -1
  51. package/dist/migrate/src/commands/DbPull.d.ts +2 -1
  52. package/dist/migrate/src/commands/DbPush.d.ts +2 -1
  53. package/dist/migrate/src/commands/DbSeed.d.ts +2 -1
  54. package/dist/migrate/src/commands/MigrateCommand.d.ts +2 -1
  55. package/dist/migrate/src/commands/MigrateDeploy.d.ts +2 -1
  56. package/dist/migrate/src/commands/MigrateDev.d.ts +2 -1
  57. package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
  58. package/dist/migrate/src/commands/MigrateReset.d.ts +2 -1
  59. package/dist/migrate/src/commands/MigrateResolve.d.ts +2 -1
  60. package/dist/migrate/src/commands/MigrateStatus.d.ts +2 -1
  61. package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +3 -3
  62. package/dist/migrate/src/utils/setupPostgres.d.ts +1 -1
  63. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  64. package/dist/utils/getSchemaPathAndPrint.js +4 -4
  65. package/dist/utils/introspectSql.js +3 -3
  66. package/dist/utils/setupPostgres.js +4 -8
  67. package/dist/utils/spinner.js +3 -3
  68. package/package.json +7 -6
@@ -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 chunk_CNAS3YE2_exports = {};
30
- __export(chunk_CNAS3YE2_exports, {
29
+ var chunk_DUCG3NRP_exports = {};
30
+ __export(chunk_DUCG3NRP_exports, {
31
31
  MigrateDiff: () => MigrateDiff,
32
32
  init_MigrateDiff: () => init_MigrateDiff
33
33
  });
34
- module.exports = __toCommonJS(chunk_CNAS3YE2_exports);
34
+ module.exports = __toCommonJS(chunk_DUCG3NRP_exports);
35
35
  var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
36
36
  var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
37
37
  var import_chunk_TKAGMA5K = require("./chunk-TKAGMA5K.js");
38
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
38
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
39
39
  var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
40
40
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
41
41
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
@@ -6164,6 +6164,7 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
6164
6164
  __export2(index_exports, {
6165
6165
  CompositeFilesResolver: () => CompositeFilesResolver,
6166
6166
  InMemoryFilesResolver: () => InMemoryFilesResolver,
6167
+ ensureType: () => ensureType2,
6167
6168
  loadRelatedSchemaFiles: () => loadRelatedSchemaFiles,
6168
6169
  loadSchemaFiles: () => loadSchemaFiles2,
6169
6170
  realFsResolver: () => realFsResolver,
@@ -6394,6 +6395,24 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
6394
6395
  }
6395
6396
  return void 0;
6396
6397
  }
6398
+ var import_promises3 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("node:fs/promises"));
6399
+ async function ensureType2(entryPath, expectedType) {
6400
+ try {
6401
+ const pathStat = await import_promises3.default.stat(entryPath);
6402
+ if (expectedType === "file" && pathStat.isFile()) {
6403
+ return void 0;
6404
+ }
6405
+ if (expectedType === "directory" && pathStat.isDirectory()) {
6406
+ return void 0;
6407
+ }
6408
+ return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
6409
+ } catch (e) {
6410
+ if (e.code === "ENOENT") {
6411
+ return { kind: "NotFound", path: entryPath, expectedType };
6412
+ }
6413
+ throw e;
6414
+ }
6415
+ }
6397
6416
  }
6398
6417
  });
6399
6418
  async function findUp(name, {
@@ -11623,12 +11642,13 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
11623
11642
  yarn: "1.22.22"
11624
11643
  },
11625
11644
  dependencies: {
11645
+ "@prisma/config": "workspace:*",
11626
11646
  "@prisma/debug": "workspace:*",
11627
11647
  "@prisma/engines": "workspace:*",
11628
11648
  "@prisma/fetch-engine": "workspace:*",
11629
11649
  "@prisma/generator-helper": "workspace:*",
11630
11650
  "@prisma/get-platform": "workspace:*",
11631
- "@prisma/prisma-schema-wasm": "6.4.0-4.e2a33755136ec1c2b3a5d7d322f86a8fb1205a40",
11651
+ "@prisma/prisma-schema-wasm": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d",
11632
11652
  "@prisma/schema-files-loader": "workspace:*",
11633
11653
  arg: "5.0.2",
11634
11654
  prompts: "2.4.2"
@@ -11910,8 +11930,8 @@ var init_engine_commands = (0, import_chunk_WWAWV7DQ.__esm)({
11910
11930
  init_getConfig();
11911
11931
  }
11912
11932
  });
11913
- async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
11914
- const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
11933
+ async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
11934
+ const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
11915
11935
  if (result.ok) {
11916
11936
  return result.schema;
11917
11937
  }
@@ -11919,7 +11939,7 @@ async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argu
11919
11939
  }
11920
11940
  async function readSchemaFromSingleFile(schemaPath) {
11921
11941
  debug2("Reading schema from single file", schemaPath);
11922
- const typeError = await ensureType(schemaPath, "file");
11942
+ const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath, "file");
11923
11943
  if (typeError) {
11924
11944
  return { ok: false, error: typeError };
11925
11945
  }
@@ -11932,7 +11952,7 @@ async function readSchemaFromSingleFile(schemaPath) {
11932
11952
  }
11933
11953
  async function readSchemaFromDirectory(schemaPath) {
11934
11954
  debug2("Reading schema from multiple files", schemaPath);
11935
- const typeError = await ensureType(schemaPath, "directory");
11955
+ const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath, "directory");
11936
11956
  if (typeError) {
11937
11957
  return { ok: false, error: typeError };
11938
11958
  }
@@ -11948,23 +11968,6 @@ async function readSchemaFromDirectory(schemaPath) {
11948
11968
  }
11949
11969
  return { ok: true, schema: { schemaPath, schemaRootDir: schemaPath, schemas: files } };
11950
11970
  }
11951
- async function ensureType(entryPath, expectedType) {
11952
- try {
11953
- const pathStat = await stat(entryPath);
11954
- if (expectedType === "file" && pathStat.isFile()) {
11955
- return void 0;
11956
- }
11957
- if (expectedType === "directory" && pathStat.isDirectory()) {
11958
- return void 0;
11959
- }
11960
- return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
11961
- } catch (e) {
11962
- if (e.code === "ENOENT") {
11963
- return { kind: "NotFound", path: entryPath, expectedType };
11964
- }
11965
- throw e;
11966
- }
11967
- }
11968
11971
  async function readSchemaFromFileOrDirectory(schemaPath) {
11969
11972
  let stats;
11970
11973
  try {
@@ -11983,7 +11986,7 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
11983
11986
  }
11984
11987
  return { ok: false, error: { kind: "WrongType", path: schemaPath, expectedTypes: ["file", "directory"] } };
11985
11988
  }
11986
- async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName }) {
11989
+ async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
11987
11990
  if (schemaPathFromArgs) {
11988
11991
  const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
11989
11992
  const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
@@ -11997,6 +12000,10 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
11997
12000
  }
11998
12001
  return customSchemaResult;
11999
12002
  }
12003
+ const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
12004
+ if (prismaConfigResult.ok) {
12005
+ return prismaConfigResult;
12006
+ }
12000
12007
  const pkgJsonResult = await getSchemaFromPackageJson(cwd);
12001
12008
  if (pkgJsonResult.ok) {
12002
12009
  return pkgJsonResult;
@@ -12052,6 +12059,31 @@ async function getPrismaConfigFromPackageJson(cwd) {
12052
12059
  packagePath: pkgJson.path
12053
12060
  };
12054
12061
  }
12062
+ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
12063
+ if (!schemaPathFromConfig) {
12064
+ return {
12065
+ ok: false,
12066
+ error: { kind: "PrismaConfigNotConfigured" }
12067
+ };
12068
+ }
12069
+ let schemaResult;
12070
+ if (schemaPathFromConfig.kind === "single") {
12071
+ schemaResult = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
12072
+ if (!schemaResult.ok) {
12073
+ throw new Error(
12074
+ `Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
12075
+ );
12076
+ }
12077
+ } else {
12078
+ schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
12079
+ if (!schemaResult.ok) {
12080
+ throw new Error(
12081
+ `Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
12082
+ );
12083
+ }
12084
+ }
12085
+ return schemaResult;
12086
+ }
12055
12087
  async function getSchemaFromPackageJson(cwd) {
12056
12088
  const prismaConfig = await getPrismaConfigFromPackageJson(cwd);
12057
12089
  debug2("prismaConfig", prismaConfig);
@@ -12165,7 +12197,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
12165
12197
  import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
12166
12198
  (0, import_chunk_6TE2RIPN.init_colors)();
12167
12199
  init_getSchema();
12168
- (0, import_chunk_ZKWJDQMB.init_Migrate)();
12200
+ (0, import_chunk_UVNSK22K.init_Migrate)();
12169
12201
  (0, import_chunk_TKAGMA5K.init_captureStdout)();
12170
12202
  debug3 = (0, import_debug3.default)("prisma:migrate:diff");
12171
12203
  helpOptions = (0, import_internals.format)(
@@ -12176,6 +12208,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
12176
12208
  ${(0, import_chunk_6TE2RIPN.bold)("Options")}
12177
12209
 
12178
12210
  -h, --help Display this help message
12211
+ --config Custom path to your Prisma config file
12179
12212
  -o, --output Writes to a file instead of stdout
12180
12213
 
12181
12214
  ${(0, import_chunk_6TE2RIPN.italic)("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
@@ -12209,7 +12242,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12209
12242
  static new() {
12210
12243
  return new _MigrateDiff2();
12211
12244
  }
12212
- async parse(argv) {
12245
+ async parse(argv, config) {
12213
12246
  const args = (0, import_internals.arg)(
12214
12247
  argv,
12215
12248
  {
@@ -12235,14 +12268,15 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12235
12268
  "--shadow-database-url": String,
12236
12269
  "--script": Boolean,
12237
12270
  "--exit-code": Boolean,
12238
- "--telemetry-information": String
12271
+ "--telemetry-information": String,
12272
+ "--config": String
12239
12273
  },
12240
12274
  false
12241
12275
  );
12242
12276
  if ((0, import_internals.isError)(args)) {
12243
12277
  return this.help(args.message);
12244
12278
  }
12245
- await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, false);
12279
+ await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, config.schema, false);
12246
12280
  if (args["--help"]) {
12247
12281
  return this.help();
12248
12282
  }
@@ -12269,17 +12303,17 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12269
12303
  tag: "empty"
12270
12304
  };
12271
12305
  } else if (args["--from-schema-datasource"]) {
12272
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false });
12273
- const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), {
12306
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
12307
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), config.schema, {
12274
12308
  argumentName: "--from-schema-datasource"
12275
12309
  });
12276
- const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12310
+ const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12277
12311
  from = {
12278
12312
  tag: "schemaDatasource",
12279
- ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12313
+ ...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
12280
12314
  };
12281
12315
  } else if (args["--from-schema-datamodel"]) {
12282
- const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), {
12316
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), config.schema, {
12283
12317
  argumentName: "--from-schema-datamodel"
12284
12318
  });
12285
12319
  from = {
@@ -12309,17 +12343,17 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12309
12343
  tag: "empty"
12310
12344
  };
12311
12345
  } else if (args["--to-schema-datasource"]) {
12312
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false });
12313
- const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), {
12346
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
12347
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), config.schema, {
12314
12348
  argumentName: "--to-schema-datasource"
12315
12349
  });
12316
- const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12350
+ const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12317
12351
  to = {
12318
12352
  tag: "schemaDatasource",
12319
- ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12353
+ ...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
12320
12354
  };
12321
12355
  } else if (args["--to-schema-datamodel"]) {
12322
- const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), {
12356
+ const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), config.schema, {
12323
12357
  argumentName: "--to-schema-datamodel"
12324
12358
  });
12325
12359
  to = {
@@ -12343,7 +12377,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12343
12377
  url: `file:${d1Database}`
12344
12378
  };
12345
12379
  }
12346
- const migrate = new import_chunk_ZKWJDQMB.Migrate();
12380
+ const migrate = new import_chunk_UVNSK22K.Migrate();
12347
12381
  const captureStdout = new import_chunk_TKAGMA5K.CaptureStdout();
12348
12382
  const outputPath = args["--output"];
12349
12383
  const isOutputDefined = Boolean(outputPath);
@@ -26,15 +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_JESW2ENL_exports = {};
30
- __export(chunk_JESW2ENL_exports, {
29
+ var chunk_FF3526PX_exports = {};
30
+ __export(chunk_FF3526PX_exports, {
31
31
  DbPush: () => DbPush,
32
32
  init_DbPush: () => init_DbPush
33
33
  });
34
- module.exports = __toCommonJS(chunk_JESW2ENL_exports);
35
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
34
+ module.exports = __toCommonJS(chunk_FF3526PX_exports);
35
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
36
36
  var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
37
- var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
37
+ var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
38
38
  var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
39
39
  var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
40
40
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
@@ -45,16 +45,16 @@ 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, import_chunk_ZKWJDQMB.init_Migrate)();
48
+ (0, import_chunk_UVNSK22K.init_Migrate)();
49
49
  (0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
50
50
  (0, import_chunk_U374EXYQ.init_errors)();
51
- (0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
51
+ (0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
52
52
  (0, import_chunk_Q7ACZDDT.init_printDatasource)();
53
53
  _DbPush = class _DbPush2 {
54
54
  static new() {
55
55
  return new _DbPush2();
56
56
  }
57
- async parse(argv) {
57
+ async parse(argv, config) {
58
58
  const args = (0, import_internals.arg)(
59
59
  argv,
60
60
  {
@@ -64,6 +64,7 @@ var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
64
64
  "--force-reset": Boolean,
65
65
  "--skip-generate": Boolean,
66
66
  "--schema": String,
67
+ "--config": String,
67
68
  "--telemetry-information": String
68
69
  },
69
70
  false
@@ -71,15 +72,15 @@ var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
71
72
  if ((0, import_internals.isError)(args)) {
72
73
  return this.help(args.message);
73
74
  }
74
- await (0, import_internals.checkUnsupportedDataProxy)("db push", args, true);
75
+ await (0, import_internals.checkUnsupportedDataProxy)("db push", args, config.schema, true);
75
76
  if (args["--help"]) {
76
77
  return this.help();
77
78
  }
78
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
79
- const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
79
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
80
+ const { schemaPath } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
80
81
  const datasourceInfo = await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath });
81
82
  (0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo });
82
- const migrate = new import_chunk_ZKWJDQMB.Migrate(schemaPath);
83
+ const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
83
84
  try {
84
85
  const wasDbCreated = await (0, import_chunk_XJQP3B4W.ensureDatabaseExists)("push", schemaPath);
85
86
  if (wasDbCreated) {
@@ -256,6 +257,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Usage")}
256
257
  ${(0, import_chunk_6TE2RIPN.bold)("Options")}
257
258
 
258
259
  -h, --help Display this help message
260
+ --config Custom path to your Prisma config file
259
261
  --schema Custom path to your Prisma schema
260
262
  --accept-data-loss Ignore data loss warnings
261
263
  --force-reset Force a reset of the database before push
@@ -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_JZ6FKTWG_exports = {};
20
- __export(chunk_JZ6FKTWG_exports, {
19
+ var chunk_FUSFURVP_exports = {};
20
+ __export(chunk_FUSFURVP_exports, {
21
21
  CLI: () => CLI,
22
22
  init_CLI: () => init_CLI
23
23
  });
24
- module.exports = __toCommonJS(chunk_JZ6FKTWG_exports);
24
+ module.exports = __toCommonJS(chunk_FUSFURVP_exports);
25
25
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
26
26
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
27
27
  var import_internals = require("@prisma/internals");
@@ -36,11 +36,11 @@ var init_CLI = (0, import_chunk_WWAWV7DQ.__esm)({
36
36
  static new(cmds) {
37
37
  return new _CLI2(cmds);
38
38
  }
39
- // eslint-disable-next-line @typescript-eslint/require-await
40
- async parse(argv) {
39
+ async parse(argv, config) {
41
40
  const args = (0, import_internals.arg)(argv, {
42
41
  "--help": Boolean,
43
42
  "-h": "--help",
43
+ "--config": String,
44
44
  "--json": Boolean,
45
45
  // for -v
46
46
  "--experimental": Boolean,
@@ -67,7 +67,7 @@ var init_CLI = (0, import_chunk_WWAWV7DQ.__esm)({
67
67
  } else {
68
68
  argsForCmd = args._.slice(1);
69
69
  }
70
- return cmd.parse(argsForCmd);
70
+ return cmd.parse(argsForCmd, config);
71
71
  }
72
72
  return (0, import_internals.unknownCommand)(this.help(), args._[0]);
73
73
  }
@@ -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_CSUAUCRR_exports = {};
30
- __export(chunk_CSUAUCRR_exports, {
29
+ var chunk_GCTCQLOF_exports = {};
30
+ __export(chunk_GCTCQLOF_exports, {
31
31
  MigrateDev: () => MigrateDev,
32
32
  init_MigrateDev: () => init_MigrateDev
33
33
  });
34
- module.exports = __toCommonJS(chunk_CSUAUCRR_exports);
34
+ module.exports = __toCommonJS(chunk_GCTCQLOF_exports);
35
35
  var import_chunk_IFCV5MY4 = require("./chunk-IFCV5MY4.js");
36
36
  var import_chunk_SGCF5OHF = require("./chunk-SGCF5OHF.js");
37
37
  var import_chunk_YKUZUAXA = require("./chunk-YKUZUAXA.js");
38
38
  var import_chunk_WOOPRG54 = require("./chunk-WOOPRG54.js");
39
39
  var import_chunk_6QFE3AWR = require("./chunk-6QFE3AWR.js");
40
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
40
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
41
41
  var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
42
- var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
42
+ var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
43
43
  var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
44
44
  var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
45
45
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
@@ -51,10 +51,10 @@ var debug, _MigrateDev, MigrateDev;
51
51
  var init_MigrateDev = (0, import_chunk_WWAWV7DQ.__esm)({
52
52
  "src/commands/MigrateDev.ts"() {
53
53
  (0, import_chunk_6TE2RIPN.init_colors)();
54
- (0, import_chunk_ZKWJDQMB.init_Migrate)();
54
+ (0, import_chunk_UVNSK22K.init_Migrate)();
55
55
  (0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
56
56
  (0, import_chunk_U374EXYQ.init_errors)();
57
- (0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
57
+ (0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
58
58
  (0, import_chunk_SGCF5OHF.init_handleEvaluateDataloss)();
59
59
  (0, import_chunk_Q7ACZDDT.init_printDatasource)();
60
60
  (0, import_chunk_WOOPRG54.init_printFiles)();
@@ -66,7 +66,7 @@ var init_MigrateDev = (0, import_chunk_WWAWV7DQ.__esm)({
66
66
  static new() {
67
67
  return new _MigrateDev2();
68
68
  }
69
- async parse(argv) {
69
+ async parse(argv, config) {
70
70
  const args = (0, import_internals.arg)(argv, {
71
71
  "--help": Boolean,
72
72
  "-h": "--help",
@@ -76,6 +76,7 @@ var init_MigrateDev = (0, import_chunk_WWAWV7DQ.__esm)({
76
76
  // '-f': '--force',
77
77
  "--create-only": Boolean,
78
78
  "--schema": String,
79
+ "--config": String,
79
80
  "--skip-generate": Boolean,
80
81
  "--skip-seed": Boolean,
81
82
  "--telemetry-information": String
@@ -83,12 +84,12 @@ var init_MigrateDev = (0, import_chunk_WWAWV7DQ.__esm)({
83
84
  if ((0, import_internals.isError)(args)) {
84
85
  return this.help(args.message);
85
86
  }
86
- await (0, import_internals.checkUnsupportedDataProxy)("migrate dev", args, true);
87
+ await (0, import_internals.checkUnsupportedDataProxy)("migrate dev", args, config.schema, true);
87
88
  if (args["--help"]) {
88
89
  return this.help();
89
90
  }
90
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
91
- const { schemaPath, schemas } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
91
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
92
+ const { schemaPath, schemas } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
92
93
  const datasourceInfo = await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath });
93
94
  (0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo });
94
95
  process.stdout.write("\n");
@@ -103,7 +104,7 @@ var init_MigrateDev = (0, import_chunk_WWAWV7DQ.__esm)({
103
104
  if (wasDbCreated) {
104
105
  process.stdout.write(wasDbCreated + "\n\n");
105
106
  }
106
- const migrate = new import_chunk_ZKWJDQMB.Migrate(schemaPath);
107
+ const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
107
108
  let devDiagnostic;
108
109
  try {
109
110
  devDiagnostic = await migrate.devDiagnostic();
@@ -280,7 +281,7 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
280
281
  process.exit(1);
281
282
  }
282
283
  } else {
283
- const { schemaPath: schemaPath2 } = await (0, import_internals.getSchemaWithPath)(args["--schema"]);
284
+ const { schemaPath: schemaPath2 } = await (0, import_internals.getSchemaWithPath)(args["--schema"], config.schema);
284
285
  await (0, import_chunk_YKUZUAXA.verifySeedConfigAndReturnMessage)(schemaPath2);
285
286
  }
286
287
  } catch (e) {
@@ -340,6 +341,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Usage")}
340
341
  ${(0, import_chunk_6TE2RIPN.bold)("Options")}
341
342
 
342
343
  -h, --help Display this help message
344
+ --config Custom path to your Prisma config file
343
345
  --schema Custom path to your Prisma schema
344
346
  -n, --name Name the migration
345
347
  --create-only Create a new migration but do not apply it
@@ -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_7QAR4NT3_exports = {};
30
- __export(chunk_7QAR4NT3_exports, {
29
+ var chunk_K44VNAFW_exports = {};
30
+ __export(chunk_K44VNAFW_exports, {
31
31
  MigrateReset: () => MigrateReset,
32
32
  init_MigrateReset: () => init_MigrateReset
33
33
  });
34
- module.exports = __toCommonJS(chunk_7QAR4NT3_exports);
34
+ module.exports = __toCommonJS(chunk_K44VNAFW_exports);
35
35
  var import_chunk_YKUZUAXA = require("./chunk-YKUZUAXA.js");
36
36
  var import_chunk_WOOPRG54 = require("./chunk-WOOPRG54.js");
37
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
37
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
38
38
  var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
39
- var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
39
+ var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
40
40
  var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
41
41
  var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
42
42
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
@@ -47,10 +47,10 @@ var _MigrateReset, MigrateReset;
47
47
  var init_MigrateReset = (0, import_chunk_WWAWV7DQ.__esm)({
48
48
  "src/commands/MigrateReset.ts"() {
49
49
  (0, import_chunk_6TE2RIPN.init_colors)();
50
- (0, import_chunk_ZKWJDQMB.init_Migrate)();
50
+ (0, import_chunk_UVNSK22K.init_Migrate)();
51
51
  (0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
52
52
  (0, import_chunk_U374EXYQ.init_errors)();
53
- (0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
53
+ (0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
54
54
  (0, import_chunk_Q7ACZDDT.init_printDatasource)();
55
55
  (0, import_chunk_WOOPRG54.init_printFiles)();
56
56
  (0, import_chunk_YKUZUAXA.init_seed)();
@@ -58,7 +58,7 @@ var init_MigrateReset = (0, import_chunk_WWAWV7DQ.__esm)({
58
58
  static new() {
59
59
  return new _MigrateReset2();
60
60
  }
61
- async parse(argv) {
61
+ async parse(argv, config) {
62
62
  const args = (0, import_internals.arg)(argv, {
63
63
  "--help": Boolean,
64
64
  "-h": "--help",
@@ -67,17 +67,18 @@ var init_MigrateReset = (0, import_chunk_WWAWV7DQ.__esm)({
67
67
  "--skip-generate": Boolean,
68
68
  "--skip-seed": Boolean,
69
69
  "--schema": String,
70
+ "--config": String,
70
71
  "--telemetry-information": String
71
72
  });
72
73
  if ((0, import_internals.isError)(args)) {
73
74
  return this.help(args.message);
74
75
  }
75
- await (0, import_internals.checkUnsupportedDataProxy)("migrate reset", args, true);
76
+ await (0, import_internals.checkUnsupportedDataProxy)("migrate reset", args, config.schema, true);
76
77
  if (args["--help"]) {
77
78
  return this.help();
78
79
  }
79
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
80
- const { schemaPath } = await (0, import_chunk_EYA6AFSF.getSchemaPathAndPrint)(args["--schema"]);
80
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
81
+ const { schemaPath } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
81
82
  const datasourceInfo = await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath });
82
83
  (0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo });
83
84
  const wasDbCreated = await (0, import_chunk_XJQP3B4W.ensureDatabaseExists)("create", schemaPath);
@@ -100,7 +101,7 @@ var init_MigrateReset = (0, import_chunk_WWAWV7DQ.__esm)({
100
101
  process.exit(130);
101
102
  }
102
103
  }
103
- const migrate = new import_chunk_ZKWJDQMB.Migrate(schemaPath);
104
+ const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
104
105
  let migrationIds;
105
106
  try {
106
107
  await migrate.reset();
@@ -141,7 +142,7 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
141
142
  process.exit(1);
142
143
  }
143
144
  } else {
144
- const { schemaPath: schemaPath2 } = await (0, import_internals.getSchemaWithPath)(args["--schema"]);
145
+ const { schemaPath: schemaPath2 } = await (0, import_internals.getSchemaWithPath)(args["--schema"], config.schema);
145
146
  await (0, import_chunk_YKUZUAXA.verifySeedConfigAndReturnMessage)(schemaPath2);
146
147
  }
147
148
  }
@@ -166,6 +167,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Usage")}
166
167
  ${(0, import_chunk_6TE2RIPN.bold)("Options")}
167
168
 
168
169
  -h, --help Display this help message
170
+ --config Custom path to your Prisma config file
169
171
  --schema Custom path to your Prisma schema
170
172
  --skip-generate Skip triggering generators (e.g. Prisma Client)
171
173
  --skip-seed Skip triggering seed