@prisma/migrate 6.19.0-integration-next.16 → 6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1

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 (42) hide show
  1. package/dist/Migrate.js +3 -3
  2. package/dist/bin.js +27 -26
  3. package/dist/{chunk-25AB2KOW.js → chunk-3AKRTEIK.js} +11 -10
  4. package/dist/{chunk-GIFCHCJW.js → chunk-6ORQRJLP.js} +51 -16
  5. package/dist/{chunk-AP47ZTTC.js → chunk-7TVX3D4W.js} +65 -27
  6. package/dist/{chunk-7WBJ2X2Q.js → chunk-BHJMJSM4.js} +7 -6
  7. package/dist/{chunk-WF7UXKO5.js → chunk-D4TRX77Y.js} +9 -6
  8. package/dist/{chunk-MOFG2YPJ.js → chunk-D6LYHB65.js} +7 -5
  9. package/dist/{chunk-CC6YNI65.js → chunk-F2XCBEZ4.js} +13 -10
  10. package/dist/{chunk-L2HDMVMA.js → chunk-J33EXHZB.js} +12 -9
  11. package/dist/{chunk-SIUB4YHK.js → chunk-NB4FRYRQ.js} +5 -5
  12. package/dist/{chunk-ZRKC6FIA.js → chunk-O35BTK6Y.js} +13 -9
  13. package/dist/{chunk-L7EZFBB4.js → chunk-PHXLQVPT.js} +68 -40
  14. package/dist/{chunk-IABFQ4QV.js → chunk-R4IWP35Z.js} +9 -8
  15. package/dist/chunk-RR6BKMNO.js +80 -0
  16. package/dist/{chunk-3UZC7DDN.js → chunk-TW22Y3AA.js} +7 -6
  17. package/dist/{chunk-GY34KW2I.js → chunk-Z27SI4AV.js} +4 -6
  18. package/dist/{chunk-LV343IWU.js → chunk-ZTIS675B.js} +48 -11
  19. package/dist/commands/DbDrop.js +2 -2
  20. package/dist/commands/DbExecute.js +4 -4
  21. package/dist/commands/DbPull.js +5 -4
  22. package/dist/commands/DbPush.js +4 -4
  23. package/dist/commands/DbSeed.js +3 -3
  24. package/dist/commands/MigrateDeploy.js +4 -4
  25. package/dist/commands/MigrateDev.js +5 -5
  26. package/dist/commands/MigrateDiff.js +4 -4
  27. package/dist/commands/MigrateReset.js +5 -5
  28. package/dist/commands/MigrateResolve.js +4 -4
  29. package/dist/commands/MigrateStatus.js +4 -4
  30. package/dist/index.js +31 -30
  31. package/dist/internals/src/cli/getSchema.d.ts +15 -1
  32. package/dist/migrate/src/Migrate.d.ts +2 -1
  33. package/dist/migrate/src/utils/introspectSql.d.ts +1 -2
  34. package/dist/migrate/src/utils/replaceOrAddDatasource.d.ts +2 -0
  35. package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +1 -0
  36. package/dist/migrate/src/utils/seed.d.ts +6 -0
  37. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  38. package/dist/utils/introspectSql.js +4 -4
  39. package/dist/utils/replaceOrAddDatasource.js +25 -0
  40. package/dist/utils/replaceOrAddDatasource.test.js +207 -0
  41. package/dist/utils/seed.js +3 -2
  42. package/package.json +11 -11
@@ -1,3 +1,9 @@
1
+ /**
2
+ * User's Prisma configuration should live in `prisma.config.ts` instead of `package.json#prisma`.
3
+ * See: https://pris.ly/prisma-config.
4
+ * @deprecated
5
+ */
6
+ export declare function getSeedCommandFromPackageJson(cwd: string): Promise<string | null>;
1
7
  export declare function executeSeedCommand({ commandFromConfig, extraArgs, }: {
2
8
  commandFromConfig: string;
3
9
  extraArgs?: string;
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var getDatabaseVersionSafe_exports = {};
20
20
  __export(getDatabaseVersionSafe_exports, {
21
- getDatabaseVersionSafe: () => import_chunk_SIUB4YHK.getDatabaseVersionSafe
21
+ getDatabaseVersionSafe: () => import_chunk_NB4FRYRQ.getDatabaseVersionSafe
22
22
  });
23
23
  module.exports = __toCommonJS(getDatabaseVersionSafe_exports);
24
- var import_chunk_SIUB4YHK = require("../chunk-SIUB4YHK.js");
25
- var import_chunk_MOFG2YPJ = require("../chunk-MOFG2YPJ.js");
26
- var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
24
+ var import_chunk_NB4FRYRQ = require("../chunk-NB4FRYRQ.js");
25
+ var import_chunk_D6LYHB65 = require("../chunk-D6LYHB65.js");
27
26
  var import_chunk_T64SUJ5L = require("../chunk-T64SUJ5L.js");
27
+ var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
28
28
  var import_chunk_GGA2F64G = require("../chunk-GGA2F64G.js");
29
29
  var import_chunk_23DZXSTI = require("../chunk-23DZXSTI.js");
30
30
  var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var introspectSql_exports = {};
20
20
  __export(introspectSql_exports, {
21
- introspectSql: () => import_chunk_ZRKC6FIA.introspectSql
21
+ introspectSql: () => import_chunk_O35BTK6Y.introspectSql
22
22
  });
23
23
  module.exports = __toCommonJS(introspectSql_exports);
24
- var import_chunk_ZRKC6FIA = require("../chunk-ZRKC6FIA.js");
25
- var import_chunk_MOFG2YPJ = require("../chunk-MOFG2YPJ.js");
26
- var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
24
+ var import_chunk_O35BTK6Y = require("../chunk-O35BTK6Y.js");
25
+ var import_chunk_D6LYHB65 = require("../chunk-D6LYHB65.js");
27
26
  var import_chunk_T64SUJ5L = require("../chunk-T64SUJ5L.js");
27
+ var import_chunk_VV4M6AN7 = require("../chunk-VV4M6AN7.js");
28
28
  var import_chunk_GGA2F64G = require("../chunk-GGA2F64G.js");
29
29
  var import_chunk_23DZXSTI = require("../chunk-23DZXSTI.js");
30
30
  var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
@@ -0,0 +1,25 @@
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 replaceOrAddDatasource_exports = {};
20
+ __export(replaceOrAddDatasource_exports, {
21
+ replaceOrAddDatasource: () => import_chunk_RR6BKMNO.replaceOrAddDatasource
22
+ });
23
+ module.exports = __toCommonJS(replaceOrAddDatasource_exports);
24
+ var import_chunk_RR6BKMNO = require("../chunk-RR6BKMNO.js");
25
+ var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ var import_chunk_RR6BKMNO = require("../chunk-RR6BKMNO.js");
3
+ var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
4
+ var replacement = `datasource new {
5
+ provider = "sqlite"
6
+ url = "file:new.db"
7
+ }`;
8
+ test("single file, with existing datasource", () => {
9
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [
10
+ [
11
+ "a.prisma",
12
+ `
13
+ datasource db {
14
+ provider = "postgresql"
15
+ url = "postgresql://example.com/db"
16
+ }
17
+
18
+ model A {
19
+ id Int @id
20
+ }
21
+ `
22
+ ]
23
+ ]);
24
+ expect(result).toMatchInlineSnapshot(`
25
+ [
26
+ [
27
+ "a.prisma",
28
+ "datasource new {
29
+ provider = "sqlite"
30
+ url = "file:new.db"
31
+ }
32
+
33
+ model A {
34
+ id Int @id
35
+ }",
36
+ ],
37
+ ]
38
+ `);
39
+ });
40
+ test("single file, with no datasource", () => {
41
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [
42
+ [
43
+ "a.prisma",
44
+ `
45
+ model A {
46
+ id Int @id
47
+ }
48
+ `
49
+ ]
50
+ ]);
51
+ expect(result).toMatchInlineSnapshot(`
52
+ [
53
+ [
54
+ "a.prisma",
55
+ "datasource new {
56
+ provider = "sqlite"
57
+ url = "file:new.db"
58
+ }
59
+
60
+ model A {
61
+ id Int @id
62
+ }
63
+ ",
64
+ ],
65
+ ]
66
+ `);
67
+ });
68
+ test("single file, empty", () => {
69
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [["a.prisma", ""]]);
70
+ expect(result).toMatchInlineSnapshot(`
71
+ [
72
+ [
73
+ "a.prisma",
74
+ "datasource new {
75
+ provider = "sqlite"
76
+ url = "file:new.db"
77
+ }
78
+ ",
79
+ ],
80
+ ]
81
+ `);
82
+ });
83
+ test("single file, with existing datasource and commented out closing bracket", () => {
84
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [
85
+ [
86
+ "a.prisma",
87
+ `
88
+ datasource db {
89
+ provider = "postgresql"
90
+ url = "postgresql://example.com/db"
91
+ // }
92
+ }
93
+
94
+ model A {
95
+ id Int @id
96
+ }
97
+ `
98
+ ]
99
+ ]);
100
+ expect(result).toMatchInlineSnapshot(`
101
+ [
102
+ [
103
+ "a.prisma",
104
+ "datasource new {
105
+ provider = "sqlite"
106
+ url = "file:new.db"
107
+ }
108
+
109
+ model A {
110
+ id Int @id
111
+ }",
112
+ ],
113
+ ]
114
+ `);
115
+ });
116
+ test("multiple files, with existing datasource", () => {
117
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [
118
+ [
119
+ "a.prisma",
120
+ `
121
+ model A {
122
+ id Int @id
123
+ }
124
+ `
125
+ ],
126
+ [
127
+ "b.prisma",
128
+ `
129
+ datasource db {
130
+ provider = "postgresql"
131
+ url = "postgresql://example.com/db"
132
+ }
133
+
134
+ model B {
135
+ id Int @id
136
+ }
137
+ `
138
+ ]
139
+ ]);
140
+ expect(result).toMatchInlineSnapshot(`
141
+ [
142
+ [
143
+ "a.prisma",
144
+ "
145
+ model A {
146
+ id Int @id
147
+ }
148
+ ",
149
+ ],
150
+ [
151
+ "b.prisma",
152
+ "datasource new {
153
+ provider = "sqlite"
154
+ url = "file:new.db"
155
+ }
156
+
157
+ model B {
158
+ id Int @id
159
+ }",
160
+ ],
161
+ ]
162
+ `);
163
+ });
164
+ test("multiple files, no datasource", () => {
165
+ const result = (0, import_chunk_RR6BKMNO.replaceOrAddDatasource)(replacement, [
166
+ [
167
+ "a.prisma",
168
+ `
169
+ model A {
170
+ id Int @id
171
+ }
172
+ `
173
+ ],
174
+ [
175
+ "b.prisma",
176
+ `
177
+ model B {
178
+ id Int @id
179
+ }
180
+ `
181
+ ]
182
+ ]);
183
+ expect(result).toMatchInlineSnapshot(`
184
+ [
185
+ [
186
+ "a.prisma",
187
+ "datasource new {
188
+ provider = "sqlite"
189
+ url = "file:new.db"
190
+ }
191
+
192
+ model A {
193
+ id Int @id
194
+ }
195
+ ",
196
+ ],
197
+ [
198
+ "b.prisma",
199
+ "
200
+ model B {
201
+ id Int @id
202
+ }
203
+ ",
204
+ ],
205
+ ]
206
+ `);
207
+ });
@@ -18,10 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var seed_exports = {};
20
20
  __export(seed_exports, {
21
- executeSeedCommand: () => import_chunk_L7EZFBB4.executeSeedCommand
21
+ executeSeedCommand: () => import_chunk_PHXLQVPT.executeSeedCommand,
22
+ getSeedCommandFromPackageJson: () => import_chunk_PHXLQVPT.getSeedCommandFromPackageJson
22
23
  });
23
24
  module.exports = __toCommonJS(seed_exports);
24
- var import_chunk_L7EZFBB4 = require("../chunk-L7EZFBB4.js");
25
+ var import_chunk_PHXLQVPT = require("../chunk-PHXLQVPT.js");
25
26
  var import_chunk_3WDCTXHL = require("../chunk-3WDCTXHL.js");
26
27
  var import_chunk_SKRR5WT4 = require("../chunk-SKRR5WT4.js");
27
28
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/migrate",
3
- "version": "6.19.0-integration-next.16",
3
+ "version": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/migrate/src/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "@swc/core": "1.11.5",
22
22
  "@swc/jest": "0.2.37",
23
23
  "@types/jest": "29.5.14",
24
- "@types/node": "~20.19.0",
24
+ "@types/node": "18.19.76",
25
25
  "@types/pg": "8.11.11",
26
26
  "@types/prompts": "2.4.9",
27
27
  "@types/sqlite3": "3.1.11",
@@ -44,21 +44,21 @@
44
44
  "tempy": "1.0.1",
45
45
  "ts-pattern": "5.6.2",
46
46
  "typescript": "5.4.5",
47
- "@prisma/adapter-libsql": "6.19.0-integration-next.16"
47
+ "@prisma/adapter-libsql": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@prisma/internals": "*"
51
51
  },
52
52
  "dependencies": {
53
- "@prisma/engines-version": "6.19.0-31.next-6f525e2b254a97a9c547ae5f2b29c54a171f6b23",
53
+ "@prisma/engines-version": "6.19.0-32.next-568b222d0ab829bbbe5f2fd48ed587836813346c",
54
54
  "prompts": "2.4.2",
55
- "@prisma/config": "6.19.0-integration-next.16",
56
- "@prisma/debug": "6.19.0-integration-next.16",
57
- "@prisma/driver-adapter-utils": "6.19.0-integration-next.16",
58
- "@prisma/client-generator-registry": "6.19.0-integration-next.16",
59
- "@prisma/generator": "6.19.0-integration-next.16",
60
- "@prisma/get-platform": "6.19.0-integration-next.16",
61
- "@prisma/internals": "6.19.0-integration-next.16"
55
+ "@prisma/client-generator-registry": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
56
+ "@prisma/config": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
57
+ "@prisma/debug": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
58
+ "@prisma/driver-adapter-utils": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
59
+ "@prisma/get-platform": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
60
+ "@prisma/generator": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1",
61
+ "@prisma/internals": "6.19.0-integration-engines-6-19-0-32-next-568b222d0ab829bbbe5f2fd48ed587836813346c.1"
62
62
  },
63
63
  "files": [
64
64
  "README.md",