@prisma/migrate 6.4.1 → 6.5.0-dev.2

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 (106) hide show
  1. package/dist/CLI.js +3 -4
  2. package/dist/Migrate.js +6 -7
  3. package/dist/SchemaEngine.js +6 -7
  4. package/dist/bin.js +116 -146
  5. package/dist/{chunk-WOOPRG54.js → chunk-255BRND3.js} +7 -14
  6. package/dist/{chunk-75EIHNAH.js → chunk-2NMFKGXM.js} +5 -6
  7. package/dist/chunk-3WC4XD74.js +98 -0
  8. package/dist/chunk-4EV2RVXY.js +226 -0
  9. package/dist/{chunk-YWWOSXMY.js → chunk-4JQIX6O7.js} +7 -15
  10. package/dist/{chunk-M5YNQ2NP.js → chunk-6DFJIBJX.js} +5 -12
  11. package/dist/{chunk-SGCF5OHF.js → chunk-7CQBDP4H.js} +6 -13
  12. package/dist/{chunk-7IT2ZO3D.js → chunk-AHJ2N6BJ.js} +3 -9
  13. package/dist/chunk-C2PR6JQR.js +266 -0
  14. package/dist/chunk-CTPONE6G.js +65 -0
  15. package/dist/{chunk-DUCG3NRP.js → chunk-D74DU52C.js} +633 -806
  16. package/dist/{chunk-UVNSK22K.js → chunk-DDHPSYC4.js} +122 -130
  17. package/dist/{chunk-CUDKD32S.js → chunk-DIAO4W7O.js} +11 -17
  18. package/dist/{chunk-XJQP3B4W.js → chunk-DJMFXNR4.js} +7 -15
  19. package/dist/{chunk-YD7GG4WS.js → chunk-FRTPDRF2.js} +66 -74
  20. package/dist/chunk-HIFVDK2U.js +96 -0
  21. package/dist/chunk-I4EY55DC.js +195 -0
  22. package/dist/{chunk-WLJHGKMK.js → chunk-IHDN3L3R.js} +7 -8
  23. package/dist/{chunk-WZT5FFN4.js → chunk-IIBRYI63.js} +634 -807
  24. package/dist/{chunk-INC2OACE.js → chunk-JFKDSUIE.js} +3 -9
  25. package/dist/{chunk-V7DE6JTG.js → chunk-JZ75RIMZ.js} +3 -9
  26. package/dist/{chunk-AAATUOV6.js → chunk-L6KOIJJ5.js} +53 -59
  27. package/dist/{chunk-GN5BY5N2.js → chunk-LGYRZ6CV.js} +4 -10
  28. package/dist/chunk-LVLRGTYH.js +148 -0
  29. package/dist/{chunk-CQQQ436N.js → chunk-MATFO4ZW.js} +186 -200
  30. package/dist/{chunk-IFCV5MY4.js → chunk-OCQGHQED.js} +5 -11
  31. package/dist/chunk-ORL3LJOT.js +470 -0
  32. package/dist/{chunk-Q7ACZDDT.js → chunk-QOPTDDIH.js} +5 -12
  33. package/dist/chunk-QTAIWPLH.js +78 -0
  34. package/dist/{chunk-35LAJN5S.js → chunk-RP2N6UXA.js} +23 -29
  35. package/dist/chunk-RQFGRXJI.js +174 -0
  36. package/dist/{chunk-QBK5XTJE.js → chunk-RR6BKMNO.js} +3 -9
  37. package/dist/{chunk-ILJRJJ3S.js → chunk-RTGQXNX6.js} +3 -9
  38. package/dist/chunk-SKRR5WT4.js +76 -0
  39. package/dist/chunk-TM3ETZES.js +153 -0
  40. package/dist/{chunk-KPUNMK5W.js → chunk-TWPTG4XS.js} +5 -12
  41. package/dist/{chunk-6QFE3AWR.js → chunk-UP6FVCDK.js} +6 -13
  42. package/dist/{chunk-YKUZUAXA.js → chunk-V3ZMNXZC.js} +16 -23
  43. package/dist/chunk-WLPX3672.js +365 -0
  44. package/dist/chunk-WNH2ACJS.js +122 -0
  45. package/dist/chunk-XSNOKQTD.js +347 -0
  46. package/dist/{chunk-X6XGFLEF.js → chunk-YZVZCC3I.js} +25 -30
  47. package/dist/commands/DbCommand.js +3 -4
  48. package/dist/commands/DbDrop.js +9 -9
  49. package/dist/commands/DbExecute.js +7 -8
  50. package/dist/commands/DbPull.js +18 -19
  51. package/dist/commands/DbPush.js +12 -13
  52. package/dist/commands/DbSeed.js +4 -5
  53. package/dist/commands/MigrateCommand.js +3 -4
  54. package/dist/commands/MigrateDeploy.js +13 -14
  55. package/dist/commands/MigrateDev.js +17 -18
  56. package/dist/commands/MigrateDiff.js +8 -9
  57. package/dist/commands/MigrateReset.js +15 -16
  58. package/dist/commands/MigrateResolve.js +11 -12
  59. package/dist/commands/MigrateStatus.js +11 -12
  60. package/dist/index.js +60 -77
  61. package/dist/internals/src/index.d.ts +0 -3
  62. package/dist/{multipart-parser-73VM3J4A.js → multipart-parser-NDLECNMN.js} +527 -561
  63. package/dist/utils/byline.js +5 -6
  64. package/dist/utils/captureStdout.js +2 -3
  65. package/dist/utils/countModelsAndTypes.js +2 -3
  66. package/dist/utils/ensureDatabaseExists.js +8 -9
  67. package/dist/utils/errors.js +8 -9
  68. package/dist/utils/flagErrors.js +5 -5
  69. package/dist/utils/getDatabaseVersionSafe.js +6 -7
  70. package/dist/utils/getSchemaPathAndPrint.js +4 -5
  71. package/dist/utils/handleEvaluateDataloss.js +3 -4
  72. package/dist/utils/introspectSql.js +6 -6
  73. package/dist/utils/isSchemaEmpty.js +2 -3
  74. package/dist/utils/printDatasource.js +3 -4
  75. package/dist/utils/printDatasources.js +3 -4
  76. package/dist/utils/printFiles.js +5 -6
  77. package/dist/utils/printIntrospectedSchema.js +2 -3
  78. package/dist/utils/printMigrationId.js +4 -5
  79. package/dist/utils/promptForMigrationName.js +2 -3
  80. package/dist/utils/removeSchemaFiles.js +2 -3
  81. package/dist/utils/replaceOrAddDatasource.js +2 -3
  82. package/dist/utils/replaceOrAddDatasource.test.js +7 -8
  83. package/dist/utils/saveSchemaFiles.js +2 -3
  84. package/dist/utils/seed.js +6 -7
  85. package/dist/utils/spinner.js +2 -3
  86. package/dist/utils/unixSocket.js +2 -3
  87. package/dist/views/handleViewsIO.js +2 -3
  88. package/package.json +6 -6
  89. package/dist/chunk-26XQQ4AG.js +0 -386
  90. package/dist/chunk-2RSEPJFX.js +0 -165
  91. package/dist/chunk-4B2LXK4R.js +0 -207
  92. package/dist/chunk-4UJBOCZJ.js +0 -130
  93. package/dist/chunk-5HZLCY6X.js +0 -161
  94. package/dist/chunk-6TE2RIPN.js +0 -80
  95. package/dist/chunk-7S3Q4MCN.js +0 -480
  96. package/dist/chunk-AOX7CJAS.js +0 -234
  97. package/dist/chunk-FF3526PX.js +0 -279
  98. package/dist/chunk-FUSFURVP.js +0 -86
  99. package/dist/chunk-GCTCQLOF.js +0 -365
  100. package/dist/chunk-K44VNAFW.js +0 -189
  101. package/dist/chunk-O4BT6W33.js +0 -104
  102. package/dist/chunk-TKAGMA5K.js +0 -72
  103. package/dist/chunk-U374EXYQ.js +0 -106
  104. package/dist/internals/src/utils/isInContainer.d.ts +0 -5
  105. package/dist/internals/src/utils/isInNpmLifecycleHook.d.ts +0 -4
  106. package/dist/internals/src/utils/maybeInGitHook.d.ts +0 -9
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_TKAGMA5K_exports = {};
20
- __export(chunk_TKAGMA5K_exports, {
21
- CaptureStdout: () => CaptureStdout,
22
- init_captureStdout: () => init_captureStdout
23
- });
24
- module.exports = __toCommonJS(chunk_TKAGMA5K_exports);
25
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
26
- var CaptureStdout;
27
- var init_captureStdout = (0, import_chunk_WWAWV7DQ.__esm)({
28
- "src/utils/captureStdout.ts"() {
29
- CaptureStdout = class {
30
- constructor() {
31
- this._capturedText = [];
32
- this._orig_stdout_write = null;
33
- }
34
- /**
35
- * Starts capturing the writes to process.stdout
36
- */
37
- startCapture() {
38
- this._orig_stdout_write = process.stdout.write;
39
- process.stdout.write = this._writeCapture.bind(this);
40
- }
41
- /**
42
- * Stops capturing the writes to process.stdout.
43
- */
44
- stopCapture() {
45
- if (this._orig_stdout_write) {
46
- process.stdout.write = this._orig_stdout_write;
47
- }
48
- }
49
- /**
50
- * Private method that is used as the replacement write function for process.stdout
51
- * @param string
52
- * @private
53
- */
54
- _writeCapture(string) {
55
- this._capturedText.push(string);
56
- }
57
- /**
58
- * Retrieve the text that has been captured since creation or since the last clear call
59
- * @returns {Array} of Strings
60
- */
61
- getCapturedText() {
62
- return this._capturedText;
63
- }
64
- /**
65
- * Clears all of the captured text
66
- */
67
- clearCaptureText() {
68
- this._capturedText = [];
69
- }
70
- };
71
- }
72
- });
@@ -1,106 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_U374EXYQ_exports = {};
20
- __export(chunk_U374EXYQ_exports, {
21
- DbDropNeedsForceError: () => DbDropNeedsForceError,
22
- DbPushIgnoreWarningsWithFlagError: () => DbPushIgnoreWarningsWithFlagError,
23
- MigrateDevEnvNonInteractiveError: () => MigrateDevEnvNonInteractiveError,
24
- MigrateNeedsForceError: () => MigrateNeedsForceError,
25
- MigrateResetEnvNonInteractiveError: () => MigrateResetEnvNonInteractiveError,
26
- NoSchemaFoundError: () => NoSchemaFoundError,
27
- init_errors: () => init_errors
28
- });
29
- module.exports = __toCommonJS(chunk_U374EXYQ_exports);
30
- var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
31
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
32
- var import_internals = require("@prisma/internals");
33
- var NoSchemaFoundError, DbPushIgnoreWarningsWithFlagError, MigrateNeedsForceError, MigrateResetEnvNonInteractiveError, MigrateDevEnvNonInteractiveError, DbDropNeedsForceError;
34
- var init_errors = (0, import_chunk_WWAWV7DQ.__esm)({
35
- "src/utils/errors.ts"() {
36
- (0, import_chunk_6TE2RIPN.init_colors)();
37
- NoSchemaFoundError = class extends Error {
38
- constructor() {
39
- super(
40
- `Could not find a ${(0, import_chunk_6TE2RIPN.bold)(
41
- "schema.prisma"
42
- )} file that is required for this command.
43
- You can either provide it with ${(0, import_chunk_6TE2RIPN.green)(
44
- "--schema"
45
- )}, set it as \`prisma.schema\` in your package.json or put it into the default location ${(0, import_chunk_6TE2RIPN.green)(
46
- "./prisma/schema.prisma"
47
- )} ${(0, import_internals.link)("https://pris.ly/d/prisma-schema-location")}`
48
- );
49
- }
50
- };
51
- (0, import_internals.setClassName)(NoSchemaFoundError, "NoSchemaFoundError");
52
- DbPushIgnoreWarningsWithFlagError = class extends Error {
53
- constructor() {
54
- super(
55
- `Use the --accept-data-loss flag to ignore the data loss warnings like ${(0, import_chunk_6TE2RIPN.bold)(
56
- (0, import_chunk_6TE2RIPN.green)((0, import_internals.getCommandWithExecutor)("prisma db push --accept-data-loss"))
57
- )}`
58
- );
59
- }
60
- };
61
- (0, import_internals.setClassName)(DbPushIgnoreWarningsWithFlagError, "DbPushIgnoreWarningsWithFlagError");
62
- MigrateNeedsForceError = class extends Error {
63
- constructor(subcommand) {
64
- super(
65
- `Use the --force flag to use the ${subcommand} command in an unattended environment like ${(0, import_chunk_6TE2RIPN.bold)(
66
- (0, import_chunk_6TE2RIPN.green)((0, import_internals.getCommandWithExecutor)(`prisma migrate ${subcommand} --force`))
67
- )}`
68
- );
69
- }
70
- };
71
- (0, import_internals.setClassName)(MigrateNeedsForceError, "MigrateNeedsForceError");
72
- MigrateResetEnvNonInteractiveError = class extends Error {
73
- constructor() {
74
- super(
75
- `Prisma Migrate has detected that the environment is non-interactive. It is recommended to run this command in an interactive environment.
76
-
77
- Use ${(0, import_chunk_6TE2RIPN.bold)((0, import_chunk_6TE2RIPN.green)(`--force`))} to run this command without user interaction.
78
- See ${(0, import_internals.link)("https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-reset")}`
79
- );
80
- }
81
- };
82
- (0, import_internals.setClassName)(MigrateResetEnvNonInteractiveError, "MigrateResetEnvNonInteractiveError");
83
- MigrateDevEnvNonInteractiveError = class extends Error {
84
- constructor() {
85
- super(
86
- `Prisma Migrate has detected that the environment is non-interactive, which is not supported.
87
-
88
- \`prisma migrate dev\` is an interactive command designed to create new migrations and evolve the database in development.
89
- To apply existing migrations in deployments, use ${(0, import_chunk_6TE2RIPN.bold)((0, import_chunk_6TE2RIPN.green)(`prisma migrate deploy`))}.
90
- See ${(0, import_internals.link)("https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-deploy")}`
91
- );
92
- }
93
- };
94
- (0, import_internals.setClassName)(MigrateDevEnvNonInteractiveError, "MigrateDevEnvNonInteractiveError");
95
- DbDropNeedsForceError = class extends Error {
96
- constructor(subcommand) {
97
- super(
98
- `Use the --force flag to use the ${subcommand} command in an unattended environment like ${(0, import_chunk_6TE2RIPN.bold)(
99
- (0, import_chunk_6TE2RIPN.green)((0, import_internals.getCommandWithExecutor)(`prisma db ${subcommand} --force --preview-feature`))
100
- )}`
101
- );
102
- }
103
- };
104
- (0, import_internals.setClassName)(DbDropNeedsForceError, "DbDropNeedsForceError");
105
- }
106
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * Check if we're running inside a container.
3
- * Checks for common signs of Docker, Podman, and Kubernetes.
4
- */
5
- export declare function isInContainer(): boolean;
@@ -1,4 +0,0 @@
1
- /**
2
- * Checks if the current process is running in an npm lifecycle hook, excluding custom npm scripts.
3
- */
4
- export declare function isInNpmLifecycleHook(): boolean;
@@ -1,9 +0,0 @@
1
- /**
2
- * Checks if we may be running inside a git hook (such as pre-commit).
3
- *
4
- * It can give false positives in edge cases, if user has `GIT_EXEC_PATH`,
5
- * `GIT_DIR`, `GIT_INDEX_FILE`, or `GIT_PREFIX` environment variable set in
6
- * their shell before running the git command (which is rare but possible).
7
- * This function should only be used where such false positives are acceptable.
8
- */
9
- export declare function maybeInGitHook(): boolean;