@prisma/migrate 6.19.0-integration-next.11 → 6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.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 (41) hide show
  1. package/dist/Migrate.js +3 -3
  2. package/dist/bin.js +27 -26
  3. package/dist/{chunk-NG4757TP.js → chunk-3AKRTEIK.js} +7 -7
  4. package/dist/{chunk-OPD3GTJ2.js → chunk-6ORQRJLP.js} +45 -14
  5. package/dist/{chunk-AP47ZTTC.js → chunk-7TVX3D4W.js} +65 -27
  6. package/dist/{chunk-ANMWKEMD.js → chunk-BHJMJSM4.js} +6 -6
  7. package/dist/{chunk-W2NKGYXF.js → chunk-D4TRX77Y.js} +9 -7
  8. package/dist/{chunk-MOFG2YPJ.js → chunk-D6LYHB65.js} +7 -5
  9. package/dist/{chunk-4LNQFWQD.js → chunk-F2XCBEZ4.js} +12 -10
  10. package/dist/{chunk-UJA5DXI3.js → chunk-J33EXHZB.js} +12 -10
  11. package/dist/{chunk-SIUB4YHK.js → chunk-NB4FRYRQ.js} +5 -5
  12. package/dist/{chunk-XAPRGBTZ.js → chunk-O35BTK6Y.js} +5 -5
  13. package/dist/{chunk-L7EZFBB4.js → chunk-PHXLQVPT.js} +68 -40
  14. package/dist/{chunk-Q66L2LFA.js → chunk-R4IWP35Z.js} +6 -6
  15. package/dist/chunk-RR6BKMNO.js +80 -0
  16. package/dist/{chunk-CQLPPAWH.js → chunk-TW22Y3AA.js} +7 -7
  17. package/dist/{chunk-43R3GFIU.js → chunk-Z27SI4AV.js} +4 -4
  18. package/dist/{chunk-HDTRNRXE.js → chunk-ZTIS675B.js} +42 -7
  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/replaceOrAddDatasource.d.ts +2 -0
  34. package/dist/migrate/src/utils/replaceOrAddDatasource.test.d.ts +1 -0
  35. package/dist/migrate/src/utils/seed.d.ts +6 -0
  36. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  37. package/dist/utils/introspectSql.js +4 -4
  38. package/dist/utils/replaceOrAddDatasource.js +25 -0
  39. package/dist/utils/replaceOrAddDatasource.test.js +207 -0
  40. package/dist/utils/seed.js +3 -2
  41. package/package.json +11 -11
@@ -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.11",
3
+ "version": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.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.11"
47
+ "@prisma/adapter-libsql": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@prisma/internals": "*"
51
51
  },
52
52
  "dependencies": {
53
- "@prisma/engines-version": "6.19.0-21.next-3ab778d6c5a8df0d39fd88ffd67461d3395af732",
53
+ "@prisma/engines-version": "6.19.0-27.feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2",
54
54
  "prompts": "2.4.2",
55
- "@prisma/client-generator-registry": "6.19.0-integration-next.11",
56
- "@prisma/debug": "6.19.0-integration-next.11",
57
- "@prisma/config": "6.19.0-integration-next.11",
58
- "@prisma/generator": "6.19.0-integration-next.11",
59
- "@prisma/get-platform": "6.19.0-integration-next.11",
60
- "@prisma/driver-adapter-utils": "6.19.0-integration-next.11",
61
- "@prisma/internals": "6.19.0-integration-next.11"
55
+ "@prisma/client-generator-registry": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
56
+ "@prisma/debug": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
57
+ "@prisma/config": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
58
+ "@prisma/driver-adapter-utils": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
59
+ "@prisma/generator": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
60
+ "@prisma/internals": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1",
61
+ "@prisma/get-platform": "6.19.0-integration-engines-6-19-0-27-feat-bump-database-versions-2-4b6e368f6da3d45f65f44068ed2758da3adcf9e2.1"
62
62
  },
63
63
  "files": [
64
64
  "README.md",