@prisma/migrate 6.5.0-dev.7 → 6.5.0-dev.70
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.
- package/dist/CLI.js +2 -2
- package/dist/Migrate.js +3 -3
- package/dist/SchemaEngine.js +3 -3
- package/dist/bin.js +35 -35
- package/dist/{chunk-J77IRNPE.js → chunk-5VDXAE53.js} +45 -31
- package/dist/{chunk-PSYS5XVH.js → chunk-A4BCLP6K.js} +23 -32
- package/dist/{chunk-D74DU52C.js → chunk-AQZODMQG.js} +464 -1335
- package/dist/{chunk-CTPONE6G.js → chunk-DLLXDCI2.js} +6 -3
- package/dist/{chunk-4EV2RVXY.js → chunk-E7OXHCDR.js} +31 -37
- package/dist/{chunk-73OPZA7N.js → chunk-EGPJABTW.js} +136 -81
- package/dist/{chunk-TM3ETZES.js → chunk-EX2UWGES.js} +11 -10
- package/dist/{chunk-FRTPDRF2.js → chunk-G2XUUMKH.js} +5 -5
- package/dist/{chunk-6DFJIBJX.js → chunk-GKDFIHM2.js} +3 -3
- package/dist/{chunk-2NMFKGXM.js → chunk-IR55GBON.js} +5 -5
- package/dist/{chunk-DDHPSYC4.js → chunk-KXMACMQC.js} +9 -6
- package/dist/{chunk-I4EY55DC.js → chunk-LZOZZRHB.js} +10 -9
- package/dist/{chunk-4JQIX6O7.js → chunk-MKK3GSDF.js} +5 -5
- package/dist/{chunk-7PNPCL4P.js → chunk-RVC37LA6.js} +465 -1336
- package/dist/{chunk-LVLRGTYH.js → chunk-TPJISPJ5.js} +10 -9
- package/dist/{chunk-YZVZCC3I.js → chunk-V5TUSOJX.js} +8 -7
- package/dist/{chunk-WNH2ACJS.js → chunk-VVKOFN3Y.js} +6 -5
- package/dist/{chunk-QTAIWPLH.js → chunk-VZ23KD5C.js} +5 -4
- package/dist/{chunk-HIFVDK2U.js → chunk-W2SZNLK4.js} +6 -5
- package/dist/{chunk-WLPX3672.js → chunk-X5N72JHI.js} +8 -7
- package/dist/{chunk-RQFGRXJI.js → chunk-X6KW7BYP.js} +10 -9
- package/dist/{chunk-XRTNIFND.js → chunk-YYPMC5FN.js} +203 -108
- package/dist/{chunk-ORL3LJOT.js → chunk-ZOEKRXDP.js} +16 -7
- package/dist/{chunk-J5FHVALZ.js → chunk-ZQ3OWSVS.js} +10 -9
- package/dist/commands/DbCommand.js +2 -2
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +4 -4
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/DbPush.js +5 -5
- package/dist/commands/DbSeed.js +2 -2
- package/dist/commands/MigrateCommand.js +2 -2
- package/dist/commands/MigrateDeploy.js +5 -5
- package/dist/commands/MigrateDev.js +5 -5
- package/dist/commands/MigrateDiff.js +6 -6
- package/dist/commands/MigrateReset.js +5 -5
- package/dist/commands/MigrateResolve.js +5 -5
- package/dist/commands/MigrateStatus.js +5 -5
- package/dist/index.js +39 -39
- package/dist/internals/src/errorReporting.d.ts +1 -0
- package/dist/utils/captureStdout.js +2 -2
- package/dist/utils/getDatabaseVersionSafe.js +3 -3
- package/dist/utils/getSchemaPathAndPrint.js +3 -3
- package/dist/utils/introspectSql.js +3 -3
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +13 -13
- package/dist/utils/setupMongo.js +3 -3
- package/dist/utils/setupMysql.js +231 -99
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +14 -14
|
@@ -16,16 +16,17 @@ 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
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_EX2UWGES_exports = {};
|
|
20
|
+
__export(chunk_EX2UWGES_exports, {
|
|
21
21
|
MigrateResolve: () => MigrateResolve
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_EX2UWGES_exports);
|
|
24
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
25
|
+
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
26
26
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
27
27
|
var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
|
|
28
28
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
29
|
+
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
29
30
|
var import_internals = require("@prisma/internals");
|
|
30
31
|
var _MigrateResolve = class _MigrateResolve2 {
|
|
31
32
|
static new() {
|
|
@@ -53,7 +54,7 @@ var _MigrateResolve = class _MigrateResolve2 {
|
|
|
53
54
|
return this.help();
|
|
54
55
|
}
|
|
55
56
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
56
|
-
const { schemaPath } = await (0,
|
|
57
|
+
const { schemaPath } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
57
58
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath }) });
|
|
58
59
|
if (!args["--applied"] && !args["--rolled-back"]) {
|
|
59
60
|
throw new Error(
|
|
@@ -73,7 +74,7 @@ ${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.green)((0, import_in
|
|
|
73
74
|
);
|
|
74
75
|
}
|
|
75
76
|
await (0, import_chunk_DJMFXNR4.ensureCanConnectToDatabase)(schemaPath);
|
|
76
|
-
const migrate = new
|
|
77
|
+
const migrate = new import_chunk_KXMACMQC.Migrate(schemaPath);
|
|
77
78
|
try {
|
|
78
79
|
await migrate.markMigrationApplied({
|
|
79
80
|
migrationId: args["--applied"]
|
|
@@ -94,7 +95,7 @@ Migration ${args["--applied"]} marked as applied.
|
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
97
|
await (0, import_chunk_DJMFXNR4.ensureCanConnectToDatabase)(schemaPath);
|
|
97
|
-
const migrate = new
|
|
98
|
+
const migrate = new import_chunk_KXMACMQC.Migrate(schemaPath);
|
|
98
99
|
try {
|
|
99
100
|
await migrate.markMigrationRolledBack({
|
|
100
101
|
migrationId: args["--rolled-back"]
|
|
@@ -117,7 +118,7 @@ ${_MigrateResolve2.help}`);
|
|
|
117
118
|
return _MigrateResolve2.help;
|
|
118
119
|
}
|
|
119
120
|
};
|
|
120
|
-
_MigrateResolve
|
|
121
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(_MigrateResolve, "help", (0, import_internals.format)(`
|
|
121
122
|
Resolve issues with database migrations in deployment databases:
|
|
122
123
|
- recover from failed migrations
|
|
123
124
|
- baseline databases when starting to use Prisma Migrate on existing databases
|
|
@@ -149,5 +150,5 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
149
150
|
|
|
150
151
|
Specify a schema
|
|
151
152
|
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma
|
|
152
|
-
`);
|
|
153
|
+
`));
|
|
153
154
|
var MigrateResolve = _MigrateResolve;
|
|
@@ -16,11 +16,11 @@ 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
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_G2XUUMKH_exports = {};
|
|
20
|
+
__export(chunk_G2XUUMKH_exports, {
|
|
21
21
|
DbSeed: () => DbSeed
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_G2XUUMKH_exports);
|
|
24
24
|
var import_chunk_V3ZMNXZC = require("./chunk-V3ZMNXZC.js");
|
|
25
25
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
@@ -224,7 +224,7 @@ ${_DbSeed2.help}`);
|
|
|
224
224
|
return _DbSeed2.help;
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
_DbSeed
|
|
227
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(_DbSeed, "help", (0, import_internals.format)(`
|
|
228
228
|
${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
|
|
229
229
|
|
|
230
230
|
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
@@ -240,5 +240,5 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
240
240
|
|
|
241
241
|
Passing extra arguments to the seed command
|
|
242
242
|
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
|
|
243
|
-
`);
|
|
243
|
+
`));
|
|
244
244
|
var DbSeed = _DbSeed;
|
|
@@ -26,12 +26,12 @@ 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
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_GKDFIHM2_exports = {};
|
|
30
|
+
__export(chunk_GKDFIHM2_exports, {
|
|
31
31
|
getSchemaPathAndPrint: () => getSchemaPathAndPrint,
|
|
32
32
|
printSchemaLoadedMessage: () => printSchemaLoadedMessage
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_GKDFIHM2_exports);
|
|
35
35
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
36
36
|
var import_internals = require("@prisma/internals");
|
|
37
37
|
var import_path = __toESM(require("path"));
|
|
@@ -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
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_IR55GBON_exports = {};
|
|
20
|
+
__export(chunk_IR55GBON_exports, {
|
|
21
21
|
introspectSql: () => introspectSql
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_IR55GBON_exports);
|
|
24
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
25
25
|
var import_internals = require("@prisma/internals");
|
|
26
26
|
var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
|
|
27
27
|
async function introspectSql(schemaPath, queries) {
|
|
@@ -41,7 +41,7 @@ async function introspectSql(schemaPath, queries) {
|
|
|
41
41
|
if (!url) {
|
|
42
42
|
throw new Error(`Could not get url from datasource ${firstDatasource.name} in ${schema.schemaPath}`);
|
|
43
43
|
}
|
|
44
|
-
const schemaEngine = new
|
|
44
|
+
const schemaEngine = new import_chunk_ZOEKRXDP.SchemaEngine({ schemaPath: schema.schemaPath });
|
|
45
45
|
const results = [];
|
|
46
46
|
const errors = [];
|
|
47
47
|
try {
|
|
@@ -26,13 +26,13 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_KXMACMQC_exports = {};
|
|
30
|
+
__export(chunk_KXMACMQC_exports, {
|
|
31
31
|
Migrate: () => Migrate
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_KXMACMQC_exports);
|
|
34
34
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
36
36
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
37
37
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
38
38
|
var import_engines_version = require("@prisma/engines-version");
|
|
@@ -541,15 +541,18 @@ var import_log_update = (0, import_chunk_WWAWV7DQ.__toESM)(require_log_update())
|
|
|
541
541
|
var packageJson = eval(`require('../package.json')`);
|
|
542
542
|
var Migrate = class {
|
|
543
543
|
constructor(schemaPath, enabledPreviewFeatures) {
|
|
544
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "engine");
|
|
545
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "schemaPath");
|
|
546
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(this, "migrationsDirectoryPath");
|
|
544
547
|
if (schemaPath) {
|
|
545
548
|
this.schemaPath = import_path.default.resolve(process.cwd(), schemaPath);
|
|
546
549
|
this.migrationsDirectoryPath = import_path.default.join(import_path.default.dirname(this.schemaPath), "migrations");
|
|
547
|
-
this.engine = new
|
|
550
|
+
this.engine = new import_chunk_ZOEKRXDP.SchemaEngine({
|
|
548
551
|
schemaPath: this.schemaPath,
|
|
549
552
|
enabledPreviewFeatures
|
|
550
553
|
});
|
|
551
554
|
} else {
|
|
552
|
-
this.engine = new
|
|
555
|
+
this.engine = new import_chunk_ZOEKRXDP.SchemaEngine({
|
|
553
556
|
enabledPreviewFeatures
|
|
554
557
|
});
|
|
555
558
|
}
|
|
@@ -26,16 +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
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_LZOZZRHB_exports = {};
|
|
30
|
+
__export(chunk_LZOZZRHB_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_LZOZZRHB_exports);
|
|
34
|
+
var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
|
|
35
|
+
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
36
36
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
37
37
|
var import_chunk_DJMFXNR4 = require("./chunk-DJMFXNR4.js");
|
|
38
38
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
39
|
+
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
39
40
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
40
41
|
var import_internals = require("@prisma/internals");
|
|
41
42
|
var debug = (0, import_debug.default)("prisma:migrate:status");
|
|
@@ -63,9 +64,9 @@ var _MigrateStatus = class _MigrateStatus2 {
|
|
|
63
64
|
return this.help();
|
|
64
65
|
}
|
|
65
66
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
66
|
-
const { schemaPath } = await (0,
|
|
67
|
+
const { schemaPath } = await (0, import_chunk_GKDFIHM2.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
67
68
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: await (0, import_chunk_DJMFXNR4.getDatasourceInfo)({ schemaPath }) });
|
|
68
|
-
const migrate = new
|
|
69
|
+
const migrate = new import_chunk_KXMACMQC.Migrate(schemaPath);
|
|
69
70
|
await (0, import_chunk_DJMFXNR4.ensureCanConnectToDatabase)(schemaPath);
|
|
70
71
|
let diagnoseResult;
|
|
71
72
|
let listMigrationDirectoriesResult;
|
|
@@ -171,7 +172,7 @@ ${_MigrateStatus2.help}`);
|
|
|
171
172
|
return _MigrateStatus2.help;
|
|
172
173
|
}
|
|
173
174
|
};
|
|
174
|
-
_MigrateStatus
|
|
175
|
+
(0, import_chunk_WWAWV7DQ.__publicField)(_MigrateStatus, "help", (0, import_internals.format)(`
|
|
175
176
|
Check the status of your database migrations
|
|
176
177
|
|
|
177
178
|
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
@@ -191,5 +192,5 @@ Check the status of your database migrations
|
|
|
191
192
|
|
|
192
193
|
Specify a schema
|
|
193
194
|
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status --schema=./schema.prisma
|
|
194
|
-
`);
|
|
195
|
+
`));
|
|
195
196
|
var MigrateStatus = _MigrateStatus;
|
|
@@ -26,19 +26,19 @@ 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
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_MKK3GSDF_exports = {};
|
|
30
|
+
__export(chunk_MKK3GSDF_exports, {
|
|
31
31
|
getDatabaseVersionSafe: () => getDatabaseVersionSafe
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_MKK3GSDF_exports);
|
|
34
|
+
var import_chunk_ZOEKRXDP = require("./chunk-ZOEKRXDP.js");
|
|
35
35
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
36
36
|
var debug = (0, import_debug.default)("prisma:cli");
|
|
37
37
|
async function getDatabaseVersionSafe(args) {
|
|
38
38
|
let engine;
|
|
39
39
|
let dbVersion;
|
|
40
40
|
try {
|
|
41
|
-
engine = new
|
|
41
|
+
engine = new import_chunk_ZOEKRXDP.SchemaEngine({});
|
|
42
42
|
dbVersion = await engine.getDatabaseVersion(args);
|
|
43
43
|
} catch (e) {
|
|
44
44
|
debug(e);
|