@prisma/migrate 6.4.0-dev.5 → 6.4.0-dev.51

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 (65) 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-XVXYNQ6H.js → chunk-6MPIO773.js} +40 -36
  6. package/dist/{chunk-AMRGQNRR.js → chunk-75EIHNAH.js} +6 -6
  7. package/dist/{chunk-Q3SQU7C6.js → chunk-7S3Q4MCN.js} +4 -4
  8. package/dist/{chunk-NKQGJ3AE.js → chunk-A6PMXMMT.js} +29 -15
  9. package/dist/{chunk-7S3QTEWV.js → chunk-B7HCYFRO.js} +41 -37
  10. package/dist/{chunk-GRGGAY6L.js → chunk-CUDKD32S.js} +159 -5
  11. package/dist/{chunk-7QAR4NT3.js → chunk-EDQWDMXR.js} +9 -8
  12. package/dist/{chunk-43RWRQLU.js → chunk-FM4XJBEM.js} +9 -8
  13. package/dist/{chunk-JESW2ENL.js → chunk-JYXY3OJ6.js} +9 -8
  14. package/dist/{chunk-77RYI3ZW.js → chunk-KW5YM5ZK.js} +9 -8
  15. package/dist/{chunk-NJUAN6V2.js → chunk-L5WSTNST.js} +6 -6
  16. package/dist/{chunk-HAJNCOW7.js → chunk-LPSZG4BL.js} +22 -21
  17. package/dist/{chunk-JZ6FKTWG.js → chunk-MWDR5RWF.js} +5 -6
  18. package/dist/{chunk-G66QFMM5.js → chunk-N3AT4GUM.js} +11 -10
  19. package/dist/{chunk-CK5VLKFM.js → chunk-NGDFNKHZ.js} +6 -6
  20. package/dist/{chunk-E2XKFV2C.js → chunk-QV7SOU3V.js} +6 -5
  21. package/dist/{chunk-CSUAUCRR.js → chunk-REKABZBY.js} +9 -8
  22. package/dist/{chunk-I63N54YI.js → chunk-T6Y2635A.js} +10 -9
  23. package/dist/{chunk-ZKWJDQMB.js → chunk-UVNSK22K.js} +7 -7
  24. package/dist/{chunk-WJT3IOMB.js → chunk-VGYN2FAS.js} +6 -5
  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 +2 -2
  28. package/dist/commands/DbExecute.js +5 -5
  29. package/dist/commands/DbPull.js +5 -5
  30. package/dist/commands/DbPush.js +5 -5
  31. package/dist/commands/DbSeed.js +3 -3
  32. package/dist/commands/MigrateCommand.js +3 -3
  33. package/dist/commands/MigrateDeploy.js +5 -5
  34. package/dist/commands/MigrateDev.js +5 -5
  35. package/dist/commands/MigrateDiff.js +6 -6
  36. package/dist/commands/MigrateReset.js +5 -5
  37. package/dist/commands/MigrateResolve.js +5 -5
  38. package/dist/commands/MigrateStatus.js +5 -5
  39. package/dist/index.js +51 -51
  40. package/dist/internals/src/cli/getSchema.d.ts +1 -39
  41. package/dist/internals/src/cli/types.d.ts +2 -1
  42. package/dist/internals/src/index.d.ts +2 -1
  43. package/dist/internals/src/utils/loadEnvFile.d.ts +4 -2
  44. package/dist/internals/src/utils/toSchemasContainer.d.ts +1 -1
  45. package/dist/migrate/src/CLI.d.ts +2 -1
  46. package/dist/migrate/src/commands/DbCommand.d.ts +2 -1
  47. package/dist/migrate/src/commands/DbDrop.d.ts +2 -1
  48. package/dist/migrate/src/commands/DbExecute.d.ts +2 -1
  49. package/dist/migrate/src/commands/DbPull.d.ts +2 -1
  50. package/dist/migrate/src/commands/DbPush.d.ts +2 -1
  51. package/dist/migrate/src/commands/DbSeed.d.ts +2 -1
  52. package/dist/migrate/src/commands/MigrateCommand.d.ts +2 -1
  53. package/dist/migrate/src/commands/MigrateDeploy.d.ts +2 -1
  54. package/dist/migrate/src/commands/MigrateDev.d.ts +2 -1
  55. package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
  56. package/dist/migrate/src/commands/MigrateReset.d.ts +2 -1
  57. package/dist/migrate/src/commands/MigrateResolve.d.ts +2 -1
  58. package/dist/migrate/src/commands/MigrateStatus.d.ts +2 -1
  59. package/dist/migrate/src/utils/setupPostgres.d.ts +1 -1
  60. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  61. package/dist/utils/introspectSql.js +3 -3
  62. package/dist/utils/setupMSSQL.js +72 -73
  63. package/dist/utils/setupPostgres.js +4 -8
  64. package/dist/utils/spinner.js +3 -3
  65. package/package.json +7 -6
package/dist/CLI.js CHANGED
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var CLI_exports = {};
20
20
  __export(CLI_exports, {
21
- CLI: () => import_chunk_JZ6FKTWG.CLI
21
+ CLI: () => import_chunk_MWDR5RWF.CLI
22
22
  });
23
23
  module.exports = __toCommonJS(CLI_exports);
24
- var import_chunk_JZ6FKTWG = require("./chunk-JZ6FKTWG.js");
24
+ var import_chunk_MWDR5RWF = require("./chunk-MWDR5RWF.js");
25
25
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
26
26
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
27
- (0, import_chunk_JZ6FKTWG.init_CLI)();
27
+ (0, import_chunk_MWDR5RWF.init_CLI)();
package/dist/Migrate.js CHANGED
@@ -18,15 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var Migrate_exports = {};
20
20
  __export(Migrate_exports, {
21
- Migrate: () => import_chunk_ZKWJDQMB.Migrate
21
+ Migrate: () => import_chunk_UVNSK22K.Migrate
22
22
  });
23
23
  module.exports = __toCommonJS(Migrate_exports);
24
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
24
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
25
25
  var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
26
26
  var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
27
- var import_chunk_Q3SQU7C6 = require("./chunk-Q3SQU7C6.js");
27
+ var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
28
28
  var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
29
29
  var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
30
30
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
31
31
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
32
- (0, import_chunk_ZKWJDQMB.init_Migrate)();
32
+ (0, import_chunk_UVNSK22K.init_Migrate)();
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var SchemaEngine_exports = {};
20
20
  __export(SchemaEngine_exports, {
21
- EngineError: () => import_chunk_Q3SQU7C6.EngineError,
22
- SchemaEngine: () => import_chunk_Q3SQU7C6.SchemaEngine
21
+ EngineError: () => import_chunk_7S3Q4MCN.EngineError,
22
+ SchemaEngine: () => import_chunk_7S3Q4MCN.SchemaEngine
23
23
  });
24
24
  module.exports = __toCommonJS(SchemaEngine_exports);
25
- var import_chunk_Q3SQU7C6 = require("./chunk-Q3SQU7C6.js");
25
+ var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
26
26
  var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
27
27
  var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
28
28
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
29
29
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
30
- (0, import_chunk_Q3SQU7C6.init_SchemaEngine)();
30
+ (0, import_chunk_7S3Q4MCN.init_SchemaEngine)();
package/dist/bin.js CHANGED
@@ -32,14 +32,14 @@ __export(bin_exports, {
32
32
  default: () => bin_default
33
33
  });
34
34
  module.exports = __toCommonJS(bin_exports);
35
- var import_chunk_JZ6FKTWG = require("./chunk-JZ6FKTWG.js");
36
- var import_chunk_JTNVQIRB = require("./chunk-JTNVQIRB.js");
37
- var import_chunk_7QAR4NT3 = require("./chunk-7QAR4NT3.js");
38
- var import_chunk_I63N54YI = require("./chunk-I63N54YI.js");
39
- var import_chunk_77RYI3ZW = require("./chunk-77RYI3ZW.js");
40
- var import_chunk_G66QFMM5 = require("./chunk-G66QFMM5.js");
41
- var import_chunk_HAJNCOW7 = require("./chunk-HAJNCOW7.js");
42
- var import_chunk_GRGGAY6L = require("./chunk-GRGGAY6L.js");
35
+ var import_chunk_MWDR5RWF = require("./chunk-MWDR5RWF.js");
36
+ var import_chunk_YWWOSXMY = require("./chunk-YWWOSXMY.js");
37
+ var import_chunk_EDQWDMXR = require("./chunk-EDQWDMXR.js");
38
+ var import_chunk_T6Y2635A = require("./chunk-T6Y2635A.js");
39
+ var import_chunk_KW5YM5ZK = require("./chunk-KW5YM5ZK.js");
40
+ var import_chunk_N3AT4GUM = require("./chunk-N3AT4GUM.js");
41
+ var import_chunk_LPSZG4BL = require("./chunk-LPSZG4BL.js");
42
+ var import_chunk_CUDKD32S = require("./chunk-CUDKD32S.js");
43
43
  var import_chunk_ILJRJJ3S = require("./chunk-ILJRJJ3S.js");
44
44
  var import_chunk_YUCPBDWV = require("./chunk-YUCPBDWV.js");
45
45
  var import_chunk_RM5LJIEV = require("./chunk-RM5LJIEV.js");
@@ -49,28 +49,28 @@ var import_chunk_V7DE6JTG = require("./chunk-V7DE6JTG.js");
49
49
  var import_chunk_QBK5XTJE = require("./chunk-QBK5XTJE.js");
50
50
  var import_chunk_INC2OACE = require("./chunk-INC2OACE.js");
51
51
  var import_chunk_GN5BY5N2 = require("./chunk-GN5BY5N2.js");
52
- var import_chunk_JESW2ENL = require("./chunk-JESW2ENL.js");
53
- var import_chunk_E2XKFV2C = require("./chunk-E2XKFV2C.js");
54
- var import_chunk_CK5VLKFM = require("./chunk-CK5VLKFM.js");
55
- var import_chunk_43RWRQLU = require("./chunk-43RWRQLU.js");
56
- var import_chunk_CSUAUCRR = require("./chunk-CSUAUCRR.js");
52
+ var import_chunk_JYXY3OJ6 = require("./chunk-JYXY3OJ6.js");
53
+ var import_chunk_QV7SOU3V = require("./chunk-QV7SOU3V.js");
54
+ var import_chunk_NGDFNKHZ = require("./chunk-NGDFNKHZ.js");
55
+ var import_chunk_FM4XJBEM = require("./chunk-FM4XJBEM.js");
56
+ var import_chunk_REKABZBY = require("./chunk-REKABZBY.js");
57
57
  var import_chunk_IFCV5MY4 = require("./chunk-IFCV5MY4.js");
58
58
  var import_chunk_SGCF5OHF = require("./chunk-SGCF5OHF.js");
59
59
  var import_chunk_YKUZUAXA = require("./chunk-YKUZUAXA.js");
60
60
  var import_chunk_WOOPRG54 = require("./chunk-WOOPRG54.js");
61
61
  var import_chunk_6QFE3AWR = require("./chunk-6QFE3AWR.js");
62
62
  var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
63
- var import_chunk_7S3QTEWV = require("./chunk-7S3QTEWV.js");
64
- var import_chunk_NKQGJ3AE = require("./chunk-NKQGJ3AE.js");
63
+ var import_chunk_B7HCYFRO = require("./chunk-B7HCYFRO.js");
64
+ var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
65
65
  var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
66
66
  var import_chunk_TKAGMA5K = require("./chunk-TKAGMA5K.js");
67
- var import_chunk_ZKWJDQMB = require("./chunk-ZKWJDQMB.js");
67
+ var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
68
68
  var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
69
69
  var import_chunk_J46BJQHT = require("./chunk-J46BJQHT.js");
70
- var import_chunk_Q3SQU7C6 = require("./chunk-Q3SQU7C6.js");
70
+ var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
71
71
  var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
72
72
  var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
73
- var import_chunk_NJUAN6V2 = require("./chunk-NJUAN6V2.js");
73
+ var import_chunk_L5WSTNST = require("./chunk-L5WSTNST.js");
74
74
  var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
75
75
  var import_chunk_EYA6AFSF = require("./chunk-EYA6AFSF.js");
76
76
  var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
@@ -78,26 +78,27 @@ var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
78
78
  var import_chunk_KPUNMK5W = require("./chunk-KPUNMK5W.js");
79
79
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
80
80
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
81
+ var import_config = require("@prisma/config");
81
82
  var import_debug = __toESM(require("@prisma/debug"));
82
83
  var import_engines_version = require("@prisma/engines-version");
83
84
  var import_internals = require("@prisma/internals");
84
85
  var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
85
86
  "src/bin.ts"(exports, module) {
86
87
  (0, import_chunk_6TE2RIPN.init_colors)();
87
- (0, import_chunk_JZ6FKTWG.init_CLI)();
88
- (0, import_chunk_NJUAN6V2.init_DbCommand)();
89
- (0, import_chunk_G66QFMM5.init_DbExecute)();
90
- (0, import_chunk_HAJNCOW7.init_DbPull)();
91
- (0, import_chunk_JESW2ENL.init_DbPush)();
92
- (0, import_chunk_E2XKFV2C.init_DbSeed)();
93
- (0, import_chunk_CK5VLKFM.init_MigrateCommand)();
94
- (0, import_chunk_43RWRQLU.init_MigrateDeploy)();
95
- (0, import_chunk_CSUAUCRR.init_MigrateDev)();
96
- (0, import_chunk_7S3QTEWV.init_MigrateDiff)();
97
- (0, import_chunk_7QAR4NT3.init_MigrateReset)();
98
- (0, import_chunk_I63N54YI.init_MigrateResolve)();
99
- (0, import_chunk_77RYI3ZW.init_MigrateStatus)();
100
- (0, import_chunk_JTNVQIRB.init_getDatabaseVersionSafe)();
88
+ (0, import_chunk_MWDR5RWF.init_CLI)();
89
+ (0, import_chunk_L5WSTNST.init_DbCommand)();
90
+ (0, import_chunk_N3AT4GUM.init_DbExecute)();
91
+ (0, import_chunk_LPSZG4BL.init_DbPull)();
92
+ (0, import_chunk_JYXY3OJ6.init_DbPush)();
93
+ (0, import_chunk_QV7SOU3V.init_DbSeed)();
94
+ (0, import_chunk_NGDFNKHZ.init_MigrateCommand)();
95
+ (0, import_chunk_FM4XJBEM.init_MigrateDeploy)();
96
+ (0, import_chunk_REKABZBY.init_MigrateDev)();
97
+ (0, import_chunk_B7HCYFRO.init_MigrateDiff)();
98
+ (0, import_chunk_EDQWDMXR.init_MigrateReset)();
99
+ (0, import_chunk_T6Y2635A.init_MigrateResolve)();
100
+ (0, import_chunk_KW5YM5ZK.init_MigrateStatus)();
101
+ (0, import_chunk_YWWOSXMY.init_getDatabaseVersionSafe)();
101
102
  process.on("uncaughtException", (e) => {
102
103
  console.log(e);
103
104
  });
@@ -108,26 +109,39 @@ var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
108
109
  process.exit(130);
109
110
  });
110
111
  var commandArray = process.argv.slice(2);
112
+ var args = (0, import_internals.arg)(
113
+ commandArray,
114
+ {
115
+ "--config": String
116
+ },
117
+ false,
118
+ true
119
+ );
111
120
  var packageJson = eval(`require('../package.json')`);
112
121
  async function main() {
113
- const cli = import_chunk_JZ6FKTWG.CLI.new({
114
- migrate: import_chunk_CK5VLKFM.MigrateCommand.new({
115
- dev: import_chunk_CSUAUCRR.MigrateDev.new(),
116
- status: import_chunk_77RYI3ZW.MigrateStatus.new(),
117
- resolve: import_chunk_I63N54YI.MigrateResolve.new(),
118
- reset: import_chunk_7QAR4NT3.MigrateReset.new(),
119
- deploy: import_chunk_43RWRQLU.MigrateDeploy.new(),
120
- diff: import_chunk_7S3QTEWV.MigrateDiff.new()
122
+ const cli = import_chunk_MWDR5RWF.CLI.new({
123
+ migrate: import_chunk_NGDFNKHZ.MigrateCommand.new({
124
+ dev: import_chunk_REKABZBY.MigrateDev.new(),
125
+ status: import_chunk_KW5YM5ZK.MigrateStatus.new(),
126
+ resolve: import_chunk_T6Y2635A.MigrateResolve.new(),
127
+ reset: import_chunk_EDQWDMXR.MigrateReset.new(),
128
+ deploy: import_chunk_FM4XJBEM.MigrateDeploy.new(),
129
+ diff: import_chunk_B7HCYFRO.MigrateDiff.new()
121
130
  }),
122
- db: import_chunk_NJUAN6V2.DbCommand.new({
123
- execute: import_chunk_G66QFMM5.DbExecute.new(),
124
- pull: import_chunk_HAJNCOW7.DbPull.new(),
125
- push: import_chunk_JESW2ENL.DbPush.new(),
131
+ db: import_chunk_L5WSTNST.DbCommand.new({
132
+ execute: import_chunk_N3AT4GUM.DbExecute.new(),
133
+ pull: import_chunk_LPSZG4BL.DbPull.new(),
134
+ push: import_chunk_JYXY3OJ6.DbPush.new(),
126
135
  // drop: DbDrop.new(),
127
- seed: import_chunk_E2XKFV2C.DbSeed.new()
136
+ seed: import_chunk_QV7SOU3V.DbSeed.new()
128
137
  })
129
138
  });
130
- const result = await cli.parse(commandArray);
139
+ const { config, error } = await (0, import_config.loadConfigFromFile)({ configFile: args["--config"] });
140
+ if (error) {
141
+ console.error(`Failed to load config file: ${error._tag}`);
142
+ return 1;
143
+ }
144
+ const result = await cli.parse(commandArray, { ...(0, import_config.defaultConfig)(), ...config });
131
145
  if (result instanceof import_internals.HelpError) {
132
146
  console.error(result);
133
147
  return 1;
@@ -149,7 +163,7 @@ var require_bin = (0, import_chunk_WWAWV7DQ.__commonJS)({
149
163
  cliVersion: packageJson.version,
150
164
  enginesVersion: import_engines_version.enginesVersion,
151
165
  command: commandArray.join(" "),
152
- getDatabaseVersionSafe: import_chunk_JTNVQIRB.getDatabaseVersionSafe
166
+ getDatabaseVersionSafe: import_chunk_YWWOSXMY.getDatabaseVersionSafe
153
167
  }).catch((e) => {
154
168
  if (import_debug.default.enabled("migrate")) {
155
169
  console.error((0, import_chunk_6TE2RIPN.red)((0, import_chunk_6TE2RIPN.bold)("Error: ")) + e.stack);
@@ -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_XVXYNQ6H_exports = {};
30
- __export(chunk_XVXYNQ6H_exports, {
29
+ var chunk_6MPIO773_exports = {};
30
+ __export(chunk_6MPIO773_exports, {
31
31
  MigrateDiff: () => MigrateDiff,
32
32
  init_MigrateDiff: () => init_MigrateDiff
33
33
  });
34
- module.exports = __toCommonJS(chunk_XVXYNQ6H_exports);
35
- var import_chunk_NKQGJ3AE = require("./chunk-NKQGJ3AE.js");
34
+ module.exports = __toCommonJS(chunk_6MPIO773_exports);
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, {
@@ -10706,8 +10725,8 @@ var require_typos = (0, import_chunk_WWAWV7DQ.__commonJS)({
10706
10725
  var require_fixer = (0, import_chunk_WWAWV7DQ.__commonJS)({
10707
10726
  "../../node_modules/.pnpm/normalize-package-data@6.0.0/node_modules/normalize-package-data/lib/fixer.js"(exports, module2) {
10708
10727
  "use strict";
10709
- var isValidSemver = (0, import_chunk_NKQGJ3AE.require_valid)();
10710
- var cleanSemver = (0, import_chunk_NKQGJ3AE.require_clean)();
10728
+ var isValidSemver = (0, import_chunk_A6PMXMMT.require_valid)();
10729
+ var cleanSemver = (0, import_chunk_A6PMXMMT.require_clean)();
10711
10730
  var validateLicense = require_validate_npm_package_license();
10712
10731
  var hostedGitInfo = require_lib5();
10713
10732
  var isBuiltinModule = require_is_core_module();
@@ -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-24.b06b231b59f731b5063a26ba21c36320ce2feb4b",
11632
11652
  "@prisma/schema-files-loader": "workspace:*",
11633
11653
  arg: "5.0.2",
11634
11654
  prompts: "2.4.2"
@@ -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 {
@@ -12165,7 +12168,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
12165
12168
  import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
12166
12169
  (0, import_chunk_6TE2RIPN.init_colors)();
12167
12170
  init_getSchema();
12168
- (0, import_chunk_ZKWJDQMB.init_Migrate)();
12171
+ (0, import_chunk_UVNSK22K.init_Migrate)();
12169
12172
  (0, import_chunk_TKAGMA5K.init_captureStdout)();
12170
12173
  debug3 = (0, import_debug3.default)("prisma:migrate:diff");
12171
12174
  helpOptions = (0, import_internals.format)(
@@ -12176,6 +12179,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
12176
12179
  ${(0, import_chunk_6TE2RIPN.bold)("Options")}
12177
12180
 
12178
12181
  -h, --help Display this help message
12182
+ --config Custom path to your Prisma config file
12179
12183
  -o, --output Writes to a file instead of stdout
12180
12184
 
12181
12185
  ${(0, import_chunk_6TE2RIPN.italic)("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
@@ -12209,7 +12213,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12209
12213
  static new() {
12210
12214
  return new _MigrateDiff2();
12211
12215
  }
12212
- async parse(argv) {
12216
+ async parse(argv, config) {
12213
12217
  const args = (0, import_internals.arg)(
12214
12218
  argv,
12215
12219
  {
@@ -12269,14 +12273,14 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12269
12273
  tag: "empty"
12270
12274
  };
12271
12275
  } else if (args["--from-schema-datasource"]) {
12272
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false });
12276
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
12273
12277
  const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), {
12274
12278
  argumentName: "--from-schema-datasource"
12275
12279
  });
12276
- const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12280
+ const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12277
12281
  from = {
12278
12282
  tag: "schemaDatasource",
12279
- ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12283
+ ...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
12280
12284
  };
12281
12285
  } else if (args["--from-schema-datamodel"]) {
12282
12286
  const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), {
@@ -12309,14 +12313,14 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12309
12313
  tag: "empty"
12310
12314
  };
12311
12315
  } else if (args["--to-schema-datasource"]) {
12312
- await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false });
12316
+ await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
12313
12317
  const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), {
12314
12318
  argumentName: "--to-schema-datasource"
12315
12319
  });
12316
- const config = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12320
+ const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
12317
12321
  to = {
12318
12322
  tag: "schemaDatasource",
12319
- ...(0, import_internals.toSchemasWithConfigDir)(schema, config)
12323
+ ...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
12320
12324
  };
12321
12325
  } else if (args["--to-schema-datamodel"]) {
12322
12326
  const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), {
@@ -12343,7 +12347,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
12343
12347
  url: `file:${d1Database}`
12344
12348
  };
12345
12349
  }
12346
- const migrate = new import_chunk_ZKWJDQMB.Migrate();
12350
+ const migrate = new import_chunk_UVNSK22K.Migrate();
12347
12351
  const captureStdout = new import_chunk_TKAGMA5K.CaptureStdout();
12348
12352
  const outputPath = args["--output"];
12349
12353
  const isOutputDefined = Boolean(outputPath);
@@ -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_AMRGQNRR_exports = {};
20
- __export(chunk_AMRGQNRR_exports, {
19
+ var chunk_75EIHNAH_exports = {};
20
+ __export(chunk_75EIHNAH_exports, {
21
21
  introspectSql: () => introspectSql
22
22
  });
23
- module.exports = __toCommonJS(chunk_AMRGQNRR_exports);
24
- var import_chunk_Q3SQU7C6 = require("./chunk-Q3SQU7C6.js");
23
+ module.exports = __toCommonJS(chunk_75EIHNAH_exports);
24
+ var import_chunk_7S3Q4MCN = require("./chunk-7S3Q4MCN.js");
25
25
  var import_internals = require("@prisma/internals");
26
- (0, import_chunk_Q3SQU7C6.init_SchemaEngine)();
26
+ (0, import_chunk_7S3Q4MCN.init_SchemaEngine)();
27
27
  var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
28
28
  async function introspectSql(schemaPath, queries) {
29
29
  const schema = await (0, import_internals.getSchemaWithPath)(schemaPath);
@@ -42,7 +42,7 @@ async function introspectSql(schemaPath, queries) {
42
42
  if (!url) {
43
43
  throw new Error(`Could not get url from datasource ${firstDatasource.name} in ${schema.schemaPath}`);
44
44
  }
45
- const schemaEngine = new import_chunk_Q3SQU7C6.SchemaEngine({ schemaPath: schema.schemaPath });
45
+ const schemaEngine = new import_chunk_7S3Q4MCN.SchemaEngine({ schemaPath: schema.schemaPath });
46
46
  const results = [];
47
47
  const errors = [];
48
48
  try {
@@ -26,13 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_Q3SQU7C6_exports = {};
30
- __export(chunk_Q3SQU7C6_exports, {
29
+ var chunk_7S3Q4MCN_exports = {};
30
+ __export(chunk_7S3Q4MCN_exports, {
31
31
  EngineError: () => EngineError,
32
32
  SchemaEngine: () => SchemaEngine,
33
33
  init_SchemaEngine: () => init_SchemaEngine
34
34
  });
35
- module.exports = __toCommonJS(chunk_Q3SQU7C6_exports);
35
+ module.exports = __toCommonJS(chunk_7S3Q4MCN_exports);
36
36
  var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
37
37
  var import_chunk_AAATUOV6 = require("./chunk-AAATUOV6.js");
38
38
  var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
@@ -260,7 +260,7 @@ var init_SchemaEngine = (0, import_chunk_WWAWV7DQ.__esm)({
260
260
  try {
261
261
  result = JSON.parse(response);
262
262
  } catch (e) {
263
- console.error(`Could not parse Schema engine response: ${response.slice(0, 200)}`);
263
+ console.error(`Could not parse Schema engine response: ${response.slice(0, 200)}. Error: ${e.message}`);
264
264
  }
265
265
  if (result) {
266
266
  if (result.id && (result.result !== void 0 || result.error !== void 0)) {
@@ -16,8 +16,8 @@ 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_NKQGJ3AE_exports = {};
20
- __export(chunk_NKQGJ3AE_exports, {
19
+ var chunk_A6PMXMMT_exports = {};
20
+ __export(chunk_A6PMXMMT_exports, {
21
21
  require_clean: () => require_clean,
22
22
  require_constants: () => require_constants,
23
23
  require_debug: () => require_debug,
@@ -28,10 +28,10 @@ __export(chunk_NKQGJ3AE_exports, {
28
28
  require_semver: () => require_semver,
29
29
  require_valid: () => require_valid
30
30
  });
31
- module.exports = __toCommonJS(chunk_NKQGJ3AE_exports);
31
+ module.exports = __toCommonJS(chunk_A6PMXMMT_exports);
32
32
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
33
33
  var require_debug = (0, import_chunk_WWAWV7DQ.__commonJS)({
34
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js"(exports, module2) {
34
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/debug.js"(exports, module2) {
35
35
  "use strict";
36
36
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
37
37
  };
@@ -39,7 +39,7 @@ var require_debug = (0, import_chunk_WWAWV7DQ.__commonJS)({
39
39
  }
40
40
  });
41
41
  var require_constants = (0, import_chunk_WWAWV7DQ.__commonJS)({
42
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js"(exports, module2) {
42
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/constants.js"(exports, module2) {
43
43
  "use strict";
44
44
  var SEMVER_SPEC_VERSION = "2.0.0";
45
45
  var MAX_LENGTH = 256;
@@ -69,7 +69,7 @@ var require_constants = (0, import_chunk_WWAWV7DQ.__commonJS)({
69
69
  }
70
70
  });
71
71
  var require_re = (0, import_chunk_WWAWV7DQ.__commonJS)({
72
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js"(exports, module2) {
72
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/re.js"(exports, module2) {
73
73
  "use strict";
74
74
  var {
75
75
  MAX_SAFE_COMPONENT_LENGTH,
@@ -153,7 +153,7 @@ var require_re = (0, import_chunk_WWAWV7DQ.__commonJS)({
153
153
  }
154
154
  });
155
155
  var require_parse_options = (0, import_chunk_WWAWV7DQ.__commonJS)({
156
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js"(exports, module2) {
156
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/parse-options.js"(exports, module2) {
157
157
  "use strict";
158
158
  var looseOption = Object.freeze({ loose: true });
159
159
  var emptyOpts = Object.freeze({});
@@ -170,7 +170,7 @@ var require_parse_options = (0, import_chunk_WWAWV7DQ.__commonJS)({
170
170
  }
171
171
  });
172
172
  var require_identifiers = (0, import_chunk_WWAWV7DQ.__commonJS)({
173
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js"(exports, module2) {
173
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/identifiers.js"(exports, module2) {
174
174
  "use strict";
175
175
  var numeric = /^[0-9]+$/;
176
176
  var compareIdentifiers = (a, b) => {
@@ -190,7 +190,7 @@ var require_identifiers = (0, import_chunk_WWAWV7DQ.__commonJS)({
190
190
  }
191
191
  });
192
192
  var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
193
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js"(exports, module2) {
193
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/classes/semver.js"(exports, module2) {
194
194
  "use strict";
195
195
  var debug = require_debug();
196
196
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
@@ -334,6 +334,17 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
334
334
  // preminor will bump the version up to the next minor release, and immediately
335
335
  // down to pre-release. premajor and prepatch work the same way.
336
336
  inc(release, identifier, identifierBase) {
337
+ if (release.startsWith("pre")) {
338
+ if (!identifier && identifierBase === false) {
339
+ throw new Error("invalid increment argument: identifier is empty");
340
+ }
341
+ if (identifier) {
342
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
343
+ if (!match || match[1] !== identifier) {
344
+ throw new Error(`invalid identifier: ${identifier}`);
345
+ }
346
+ }
347
+ }
337
348
  switch (release) {
338
349
  case "premajor":
339
350
  this.prerelease.length = 0;
@@ -361,6 +372,12 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
361
372
  }
362
373
  this.inc("pre", identifier, identifierBase);
363
374
  break;
375
+ case "release":
376
+ if (this.prerelease.length === 0) {
377
+ throw new Error(`version ${this.raw} is not a prerelease`);
378
+ }
379
+ this.prerelease.length = 0;
380
+ break;
364
381
  case "major":
365
382
  if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
366
383
  this.major++;
@@ -386,9 +403,6 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
386
403
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
387
404
  case "pre": {
388
405
  const base = Number(identifierBase) ? 1 : 0;
389
- if (!identifier && identifierBase === false) {
390
- throw new Error("invalid increment argument: identifier is empty");
391
- }
392
406
  if (this.prerelease.length === 0) {
393
407
  this.prerelease = [base];
394
408
  } else {
@@ -435,7 +449,7 @@ var require_semver = (0, import_chunk_WWAWV7DQ.__commonJS)({
435
449
  }
436
450
  });
437
451
  var require_parse = (0, import_chunk_WWAWV7DQ.__commonJS)({
438
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js"(exports, module2) {
452
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/functions/parse.js"(exports, module2) {
439
453
  "use strict";
440
454
  var SemVer = require_semver();
441
455
  var parse = (version, options, throwErrors = false) => {
@@ -455,7 +469,7 @@ var require_parse = (0, import_chunk_WWAWV7DQ.__commonJS)({
455
469
  }
456
470
  });
457
471
  var require_valid = (0, import_chunk_WWAWV7DQ.__commonJS)({
458
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js"(exports, module2) {
472
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/functions/valid.js"(exports, module2) {
459
473
  "use strict";
460
474
  var parse = require_parse();
461
475
  var valid = (version, options) => {
@@ -466,7 +480,7 @@ var require_valid = (0, import_chunk_WWAWV7DQ.__commonJS)({
466
480
  }
467
481
  });
468
482
  var require_clean = (0, import_chunk_WWAWV7DQ.__commonJS)({
469
- "../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js"(exports, module2) {
483
+ "../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/functions/clean.js"(exports, module2) {
470
484
  "use strict";
471
485
  var parse = require_parse();
472
486
  var clean = (version, options) => {