@prisma/migrate 6.6.0-dev.3 → 6.6.0-dev.30
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 +3 -3
- package/dist/Migrate.js +8 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +48 -47
- package/dist/chunk-23DZXSTI.js +62 -0
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
- package/dist/chunk-5Q5BJS5B.js +889 -0
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-GG54LOYV.js → chunk-63ZT25OL.js} +43 -43
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-IR55GBON.js → chunk-ABQZ5J74.js} +5 -5
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-KS7IEA6Z.js → chunk-AM7BRZFD.js} +48 -51
- package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
- package/dist/{chunk-N4XTKFY6.js → chunk-BUAYZ4KA.js} +37 -37
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-MATFO4ZW.js → chunk-G7PJKEOV.js} +33 -33
- package/dist/{chunk-ZOEKRXDP.js → chunk-GHZAN2PG.js} +21 -24
- package/dist/{chunk-V5TUSOJX.js → chunk-HPT54KSO.js} +44 -44
- package/dist/{chunk-HCBZB4XC.js → chunk-HQJ7FIWN.js} +51 -51
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/{chunk-CQZFVAXC.js → chunk-IRYXRMQC.js} +40 -40
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-N3KYWSX2.js → chunk-LAEOX7QH.js} +53 -48
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-MKK3GSDF.js → chunk-MTJFLQI4.js} +5 -5
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-WI2A2TQE.js → chunk-SCH55BRJ.js} +84 -87
- package/dist/{chunk-EGPJABTW.js → chunk-TGV6QGEF.js} +69 -69
- package/dist/chunk-URKH6SE2.js +479 -0
- package/dist/chunk-V6PVGSDJ.js +76 -0
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-4RDVKU5F.js → chunk-VZVF5FOX.js} +331 -344
- package/dist/{chunk-OWIFBVPC.js → chunk-WJ6HO7L7.js} +330 -343
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-A6PMXMMT.js → chunk-ZB5NPOJW.js} +13 -13
- package/dist/{chunk-Q3ZLC44N.js → chunk-ZCR4PTT3.js} +54 -64
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +4 -5
- package/dist/commands/DbExecute.js +9 -7
- package/dist/commands/DbPull.js +12 -11
- package/dist/commands/DbPush.js +10 -9
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +12 -11
- package/dist/commands/MigrateDev.js +14 -13
- package/dist/commands/MigrateDiff.js +12 -10
- package/dist/commands/MigrateReset.js +13 -12
- package/dist/commands/MigrateResolve.js +10 -9
- package/dist/commands/MigrateStatus.js +10 -9
- package/dist/index.js +52 -50
- package/dist/internals/src/cli/schemaContext.d.ts +43 -0
- package/dist/internals/src/index.d.ts +1 -0
- package/dist/internals/src/migrateTypes.d.ts +63 -0
- package/dist/migrate/src/Migrate.d.ts +3 -1
- package/dist/migrate/src/SchemaEngine.d.ts +0 -4
- package/dist/migrate/src/types.d.ts +13 -10
- package/dist/migrate/src/utils/createMigration.d.ts +21 -0
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
- package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
- package/dist/migrate/src/utils/seed.d.ts +0 -2
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/createMigration.js +27 -0
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +7 -7
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/getSchemaPathAndPrint.js +1 -1
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/listMigrations.js +25 -0
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -7
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +759 -675
- package/dist/utils/setupMongo.js +552 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -3
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +9 -9
- package/dist/chunk-J46BJQHT.js +0 -268
- package/dist/chunk-KOF4LGTS.js +0 -1817
- package/dist/chunk-YYPMC5FN.js +0 -1407
|
@@ -26,26 +26,51 @@ 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_AM7BRZFD_exports = {};
|
|
30
|
+
__export(chunk_AM7BRZFD_exports, {
|
|
31
31
|
MigrateReset: () => MigrateReset
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_AM7BRZFD_exports);
|
|
34
|
+
var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
35
|
+
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
36
|
+
var import_chunk_5Q5BJS5B = require("./chunk-5Q5BJS5B.js");
|
|
37
37
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
38
|
-
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
39
38
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
40
|
-
var
|
|
39
|
+
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
41
40
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
42
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
43
41
|
var import_internals = require("@prisma/internals");
|
|
44
42
|
var import_prompts = __toESM(require("prompts"));
|
|
45
|
-
var
|
|
43
|
+
var MigrateReset = class _MigrateReset {
|
|
46
44
|
static new() {
|
|
47
|
-
return new
|
|
45
|
+
return new _MigrateReset();
|
|
48
46
|
}
|
|
47
|
+
static help = (0, import_internals.format)(`
|
|
48
|
+
Reset your database and apply all migrations, all data will be lost
|
|
49
|
+
|
|
50
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
51
|
+
|
|
52
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset [options]
|
|
53
|
+
|
|
54
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
55
|
+
|
|
56
|
+
-h, --help Display this help message
|
|
57
|
+
--config Custom path to your Prisma config file
|
|
58
|
+
--schema Custom path to your Prisma schema
|
|
59
|
+
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
60
|
+
--skip-seed Skip triggering seed
|
|
61
|
+
-f, --force Skip the confirmation prompt
|
|
62
|
+
|
|
63
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
64
|
+
|
|
65
|
+
Reset your database and apply all migrations, all data will be lost
|
|
66
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset
|
|
67
|
+
|
|
68
|
+
Specify a schema
|
|
69
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --schema=./schema.prisma
|
|
70
|
+
|
|
71
|
+
Use --force to skip the confirmation prompt
|
|
72
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --force
|
|
73
|
+
`);
|
|
49
74
|
async parse(argv, config) {
|
|
50
75
|
const args = (0, import_internals.arg)(argv, {
|
|
51
76
|
"--help": Boolean,
|
|
@@ -66,10 +91,13 @@ var _MigrateReset = class _MigrateReset2 {
|
|
|
66
91
|
return this.help();
|
|
67
92
|
}
|
|
68
93
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
69
|
-
const
|
|
70
|
-
|
|
94
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
95
|
+
schemaPathFromArg: args["--schema"],
|
|
96
|
+
schemaPathFromConfig: config.schema
|
|
97
|
+
});
|
|
98
|
+
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
71
99
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
72
|
-
const wasDbCreated = await (0,
|
|
100
|
+
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
73
101
|
if (wasDbCreated) {
|
|
74
102
|
process.stdout.write("\n" + wasDbCreated + "\n");
|
|
75
103
|
}
|
|
@@ -89,7 +117,7 @@ var _MigrateReset = class _MigrateReset2 {
|
|
|
89
117
|
process.exit(130);
|
|
90
118
|
}
|
|
91
119
|
}
|
|
92
|
-
const migrate = new
|
|
120
|
+
const migrate = new import_chunk_5Q5BJS5B.Migrate(schemaContext.schemaPath);
|
|
93
121
|
let migrationIds;
|
|
94
122
|
try {
|
|
95
123
|
await migrate.reset();
|
|
@@ -108,7 +136,7 @@ var _MigrateReset = class _MigrateReset2 {
|
|
|
108
136
|
|
|
109
137
|
The following migration(s) have been applied:
|
|
110
138
|
|
|
111
|
-
${(0,
|
|
139
|
+
${(0, import_chunk_KRQEFTDT.printFilesFromMigrationIds)("migrations", migrationIds, {
|
|
112
140
|
"migration.sql": ""
|
|
113
141
|
})}
|
|
114
142
|
`
|
|
@@ -118,10 +146,10 @@ ${(0, import_chunk_255BRND3.printFilesFromMigrationIds)("migrations", migrationI
|
|
|
118
146
|
await migrate.tryToRunGenerate(datasourceInfo);
|
|
119
147
|
}
|
|
120
148
|
if (!process.env.PRISMA_MIGRATE_SKIP_SEED && !args["--skip-seed"]) {
|
|
121
|
-
const seedCommandFromPkgJson = await (0,
|
|
149
|
+
const seedCommandFromPkgJson = await (0, import_chunk_5LKIRKDL.getSeedCommandFromPackageJson)(process.cwd());
|
|
122
150
|
if (seedCommandFromPkgJson) {
|
|
123
151
|
process.stdout.write("\n");
|
|
124
|
-
const successfulSeeding = await (0,
|
|
152
|
+
const successfulSeeding = await (0, import_chunk_5LKIRKDL.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson });
|
|
125
153
|
if (successfulSeeding) {
|
|
126
154
|
process.stdout.write(`
|
|
127
155
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.
|
|
@@ -129,9 +157,6 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
|
|
|
129
157
|
} else {
|
|
130
158
|
process.exit(1);
|
|
131
159
|
}
|
|
132
|
-
} else {
|
|
133
|
-
const { schemaPath: schemaPath2 } = await (0, import_internals.getSchemaWithPath)(args["--schema"], config.schema);
|
|
134
|
-
await (0, import_chunk_V3ZMNXZC.verifySeedConfigAndReturnMessage)(schemaPath2);
|
|
135
160
|
}
|
|
136
161
|
}
|
|
137
162
|
return ``;
|
|
@@ -140,36 +165,8 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
|
|
|
140
165
|
if (error) {
|
|
141
166
|
return new import_internals.HelpError(`
|
|
142
167
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
143
|
-
${
|
|
168
|
+
${_MigrateReset.help}`);
|
|
144
169
|
}
|
|
145
|
-
return
|
|
170
|
+
return _MigrateReset.help;
|
|
146
171
|
}
|
|
147
172
|
};
|
|
148
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_MigrateReset, "help", (0, import_internals.format)(`
|
|
149
|
-
Reset your database and apply all migrations, all data will be lost
|
|
150
|
-
|
|
151
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
152
|
-
|
|
153
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset [options]
|
|
154
|
-
|
|
155
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
156
|
-
|
|
157
|
-
-h, --help Display this help message
|
|
158
|
-
--config Custom path to your Prisma config file
|
|
159
|
-
--schema Custom path to your Prisma schema
|
|
160
|
-
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
161
|
-
--skip-seed Skip triggering seed
|
|
162
|
-
-f, --force Skip the confirmation prompt
|
|
163
|
-
|
|
164
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
165
|
-
|
|
166
|
-
Reset your database and apply all migrations, all data will be lost
|
|
167
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset
|
|
168
|
-
|
|
169
|
-
Specify a schema
|
|
170
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --schema=./schema.prisma
|
|
171
|
-
|
|
172
|
-
Use --force to skip the confirmation prompt
|
|
173
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate reset --force
|
|
174
|
-
`));
|
|
175
|
-
var MigrateReset = _MigrateReset;
|
|
@@ -16,16 +16,16 @@ 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_B4SUSDC2_exports = {};
|
|
20
|
+
__export(chunk_B4SUSDC2_exports, {
|
|
21
21
|
DbSeed: () => DbSeed
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_B4SUSDC2_exports);
|
|
24
|
+
var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
25
25
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
26
|
-
var
|
|
26
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
28
|
-
var require_arg = (0,
|
|
28
|
+
var require_arg = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
29
29
|
"../../node_modules/.pnpm/arg@5.0.2/node_modules/arg/index.js"(exports, module2) {
|
|
30
30
|
"use strict";
|
|
31
31
|
var flagSymbol = Symbol("arg flag");
|
|
@@ -168,11 +168,28 @@ var require_arg = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
168
168
|
module2.exports = arg2;
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
|
-
var import_arg = (0,
|
|
172
|
-
var
|
|
171
|
+
var import_arg = (0, import_chunk_2ESYSVXG.__toESM)(require_arg());
|
|
172
|
+
var DbSeed = class _DbSeed {
|
|
173
173
|
static new() {
|
|
174
|
-
return new
|
|
174
|
+
return new _DbSeed();
|
|
175
175
|
}
|
|
176
|
+
static help = (0, import_internals.format)(`
|
|
177
|
+
${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
|
|
178
|
+
|
|
179
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
180
|
+
|
|
181
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed [options]
|
|
182
|
+
|
|
183
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
184
|
+
|
|
185
|
+
-h, --help Display this help message
|
|
186
|
+
--config Custom path to your Prisma config file
|
|
187
|
+
|
|
188
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
189
|
+
|
|
190
|
+
Passing extra arguments to the seed command
|
|
191
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
|
|
192
|
+
`);
|
|
176
193
|
async parse(argv, config) {
|
|
177
194
|
const args = (0, import_internals.arg)(
|
|
178
195
|
argv,
|
|
@@ -197,17 +214,10 @@ ${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 va
|
|
|
197
214
|
return this.help();
|
|
198
215
|
}
|
|
199
216
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
200
|
-
const seedCommandFromPkgJson = await (0,
|
|
201
|
-
if (!seedCommandFromPkgJson)
|
|
202
|
-
const schemaResult = await (0, import_internals.getSchemaWithPath)(args["--schema"], config.schema);
|
|
203
|
-
const message = await (0, import_chunk_V3ZMNXZC.verifySeedConfigAndReturnMessage)(schemaResult?.schemaPath ?? null);
|
|
204
|
-
if (message) {
|
|
205
|
-
throw new Error(message);
|
|
206
|
-
}
|
|
207
|
-
return ``;
|
|
208
|
-
}
|
|
217
|
+
const seedCommandFromPkgJson = await (0, import_chunk_5LKIRKDL.getSeedCommandFromPackageJson)(process.cwd());
|
|
218
|
+
if (!seedCommandFromPkgJson) return ``;
|
|
209
219
|
const extraArgs = args._.join(" ");
|
|
210
|
-
const successfulSeeding = await (0,
|
|
220
|
+
const successfulSeeding = await (0, import_chunk_5LKIRKDL.executeSeedCommand)({ commandFromConfig: seedCommandFromPkgJson, extraArgs });
|
|
211
221
|
if (successfulSeeding) {
|
|
212
222
|
return `
|
|
213
223
|
${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been executed.`;
|
|
@@ -219,26 +229,8 @@ ${process.platform === "win32" ? "" : "\u{1F331} "}The seed command has been ex
|
|
|
219
229
|
if (error) {
|
|
220
230
|
return new import_internals.HelpError(`
|
|
221
231
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
222
|
-
${
|
|
232
|
+
${_DbSeed.help}`);
|
|
223
233
|
}
|
|
224
|
-
return
|
|
234
|
+
return _DbSeed.help;
|
|
225
235
|
}
|
|
226
236
|
};
|
|
227
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_DbSeed, "help", (0, import_internals.format)(`
|
|
228
|
-
${process.platform === "win32" ? "" : "\u{1F64C} "}Seed your database
|
|
229
|
-
|
|
230
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
231
|
-
|
|
232
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed [options]
|
|
233
|
-
|
|
234
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
235
|
-
|
|
236
|
-
-h, --help Display this help message
|
|
237
|
-
--config Custom path to your Prisma config file
|
|
238
|
-
|
|
239
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
240
|
-
|
|
241
|
-
Passing extra arguments to the seed command
|
|
242
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db seed -- --arg1 value1 --arg2 value2
|
|
243
|
-
`));
|
|
244
|
-
var DbSeed = _DbSeed;
|
|
@@ -26,24 +26,43 @@ 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_BUAYZ4KA_exports = {};
|
|
30
|
+
__export(chunk_BUAYZ4KA_exports, {
|
|
31
31
|
MigrateStatus: () => MigrateStatus
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
33
|
+
module.exports = __toCommonJS(chunk_BUAYZ4KA_exports);
|
|
34
|
+
var import_chunk_5Q5BJS5B = require("./chunk-5Q5BJS5B.js");
|
|
36
35
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
37
|
-
var
|
|
36
|
+
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
38
37
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
39
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
40
38
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
41
39
|
var import_internals = require("@prisma/internals");
|
|
42
40
|
var debug = (0, import_debug.default)("prisma:migrate:status");
|
|
43
|
-
var
|
|
41
|
+
var MigrateStatus = class _MigrateStatus {
|
|
44
42
|
static new() {
|
|
45
|
-
return new
|
|
43
|
+
return new _MigrateStatus();
|
|
46
44
|
}
|
|
45
|
+
static help = (0, import_internals.format)(`
|
|
46
|
+
Check the status of your database migrations
|
|
47
|
+
|
|
48
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
49
|
+
|
|
50
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status [options]
|
|
51
|
+
|
|
52
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
53
|
+
|
|
54
|
+
-h, --help Display this help message
|
|
55
|
+
--config Custom path to your Prisma config file
|
|
56
|
+
--schema Custom path to your Prisma schema
|
|
57
|
+
|
|
58
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
59
|
+
|
|
60
|
+
Check the status of your database migrations
|
|
61
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status
|
|
62
|
+
|
|
63
|
+
Specify a schema
|
|
64
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status --schema=./schema.prisma
|
|
65
|
+
`);
|
|
47
66
|
async parse(argv, config) {
|
|
48
67
|
const args = (0, import_internals.arg)(
|
|
49
68
|
argv,
|
|
@@ -64,10 +83,13 @@ var _MigrateStatus = class _MigrateStatus2 {
|
|
|
64
83
|
return this.help();
|
|
65
84
|
}
|
|
66
85
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
87
|
+
schemaPathFromArg: args["--schema"],
|
|
88
|
+
schemaPathFromConfig: config.schema
|
|
89
|
+
});
|
|
90
|
+
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo: (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource) });
|
|
91
|
+
const migrate = new import_chunk_5Q5BJS5B.Migrate(schemaContext.schemaPath);
|
|
92
|
+
await (0, import_chunk_74LUB4XX.ensureCanConnectToDatabase)(schemaContext.primaryDatasource);
|
|
71
93
|
let diagnoseResult;
|
|
72
94
|
let listMigrationDirectoriesResult;
|
|
73
95
|
try {
|
|
@@ -167,30 +189,8 @@ ${(0, import_internals.link)("https://pris.ly/d/migrate-resolve")}`);
|
|
|
167
189
|
if (error) {
|
|
168
190
|
return new import_internals.HelpError(`
|
|
169
191
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
170
|
-
${
|
|
192
|
+
${_MigrateStatus.help}`);
|
|
171
193
|
}
|
|
172
|
-
return
|
|
194
|
+
return _MigrateStatus.help;
|
|
173
195
|
}
|
|
174
196
|
};
|
|
175
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_MigrateStatus, "help", (0, import_internals.format)(`
|
|
176
|
-
Check the status of your database migrations
|
|
177
|
-
|
|
178
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
179
|
-
|
|
180
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status [options]
|
|
181
|
-
|
|
182
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
183
|
-
|
|
184
|
-
-h, --help Display this help message
|
|
185
|
-
--config Custom path to your Prisma config file
|
|
186
|
-
--schema Custom path to your Prisma schema
|
|
187
|
-
|
|
188
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
189
|
-
|
|
190
|
-
Check the status of your database migrations
|
|
191
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status
|
|
192
|
-
|
|
193
|
-
Specify a schema
|
|
194
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma migrate status --schema=./schema.prisma
|
|
195
|
-
`));
|
|
196
|
-
var MigrateStatus = _MigrateStatus;
|
|
@@ -16,52 +16,21 @@ 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_EJG7GKM7_exports = {};
|
|
20
|
+
__export(chunk_EJG7GKM7_exports, {
|
|
21
21
|
DbCommand: () => DbCommand
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_EJG7GKM7_exports);
|
|
24
24
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
25
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
26
25
|
var import_internals = require("@prisma/internals");
|
|
27
|
-
var
|
|
26
|
+
var DbCommand = class _DbCommand {
|
|
28
27
|
constructor(cmds) {
|
|
29
28
|
this.cmds = cmds;
|
|
30
29
|
}
|
|
31
30
|
static new(cmds) {
|
|
32
|
-
return new
|
|
31
|
+
return new _DbCommand(cmds);
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
const args = (0, import_internals.arg)(argv, {
|
|
36
|
-
"--help": Boolean,
|
|
37
|
-
"-h": "--help",
|
|
38
|
-
"--config": String,
|
|
39
|
-
"--preview-feature": Boolean,
|
|
40
|
-
"--telemetry-information": String
|
|
41
|
-
});
|
|
42
|
-
if ((0, import_internals.isError)(args)) {
|
|
43
|
-
return this.help(args.message);
|
|
44
|
-
}
|
|
45
|
-
if (args._.length === 0 || args["--help"]) {
|
|
46
|
-
return this.help();
|
|
47
|
-
}
|
|
48
|
-
const cmd = this.cmds[args._[0]];
|
|
49
|
-
if (cmd) {
|
|
50
|
-
const argsForCmd = args["--preview-feature"] ? [...args._.slice(1), `--preview-feature`] : args._.slice(1);
|
|
51
|
-
return cmd.parse(argsForCmd, config);
|
|
52
|
-
}
|
|
53
|
-
return (0, import_internals.unknownCommand)(_DbCommand2.help, args._[0]);
|
|
54
|
-
}
|
|
55
|
-
help(error) {
|
|
56
|
-
if (error) {
|
|
57
|
-
return new import_internals.HelpError(`
|
|
58
|
-
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
59
|
-
${_DbCommand2.help}`);
|
|
60
|
-
}
|
|
61
|
-
return _DbCommand2.help;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_DbCommand, "help", (0, import_internals.format)(`
|
|
33
|
+
static help = (0, import_internals.format)(`
|
|
65
34
|
${process.platform === "win32" ? "" : "\u{1F3CB}\uFE0F "}Manage your database schema and lifecycle during development.
|
|
66
35
|
|
|
67
36
|
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
@@ -93,5 +62,34 @@ ${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
|
93
62
|
|
|
94
63
|
Run \`prisma db execute\`
|
|
95
64
|
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db execute
|
|
96
|
-
`)
|
|
97
|
-
|
|
65
|
+
`);
|
|
66
|
+
async parse(argv, config) {
|
|
67
|
+
const args = (0, import_internals.arg)(argv, {
|
|
68
|
+
"--help": Boolean,
|
|
69
|
+
"-h": "--help",
|
|
70
|
+
"--config": String,
|
|
71
|
+
"--preview-feature": Boolean,
|
|
72
|
+
"--telemetry-information": String
|
|
73
|
+
});
|
|
74
|
+
if ((0, import_internals.isError)(args)) {
|
|
75
|
+
return this.help(args.message);
|
|
76
|
+
}
|
|
77
|
+
if (args._.length === 0 || args["--help"]) {
|
|
78
|
+
return this.help();
|
|
79
|
+
}
|
|
80
|
+
const cmd = this.cmds[args._[0]];
|
|
81
|
+
if (cmd) {
|
|
82
|
+
const argsForCmd = args["--preview-feature"] ? [...args._.slice(1), `--preview-feature`] : args._.slice(1);
|
|
83
|
+
return cmd.parse(argsForCmd, config);
|
|
84
|
+
}
|
|
85
|
+
return (0, import_internals.unknownCommand)(_DbCommand.help, args._[0]);
|
|
86
|
+
}
|
|
87
|
+
help(error) {
|
|
88
|
+
if (error) {
|
|
89
|
+
return new import_internals.HelpError(`
|
|
90
|
+
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
91
|
+
${_DbCommand.help}`);
|
|
92
|
+
}
|
|
93
|
+
return _DbCommand.help;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
@@ -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
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_EJUXYFV3_exports = {};
|
|
20
|
+
__export(chunk_EJUXYFV3_exports, {
|
|
21
21
|
require_ms: () => require_ms,
|
|
22
22
|
require_src: () => require_src
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
var require_ms = (0,
|
|
24
|
+
module.exports = __toCommonJS(chunk_EJUXYFV3_exports);
|
|
25
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
26
|
+
var require_ms = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
27
27
|
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module2) {
|
|
28
28
|
"use strict";
|
|
29
29
|
var s = 1e3;
|
|
@@ -138,7 +138,7 @@ var require_ms = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
|
-
var require_common = (0,
|
|
141
|
+
var require_common = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
142
142
|
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports, module2) {
|
|
143
143
|
"use strict";
|
|
144
144
|
function setup(env) {
|
|
@@ -314,7 +314,7 @@ var require_common = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
314
314
|
module2.exports = setup;
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
|
-
var require_browser = (0,
|
|
317
|
+
var require_browser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
318
318
|
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports, module2) {
|
|
319
319
|
"use strict";
|
|
320
320
|
exports.formatArgs = formatArgs;
|
|
@@ -483,7 +483,7 @@ var require_browser = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
|
-
var require_has_flag = (0,
|
|
486
|
+
var require_has_flag = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
487
487
|
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
|
|
488
488
|
"use strict";
|
|
489
489
|
module2.exports = (flag, argv = process.argv) => {
|
|
@@ -494,11 +494,11 @@ var require_has_flag = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
|
-
var require_supports_color = (0,
|
|
497
|
+
var require_supports_color = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
498
498
|
"../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module2) {
|
|
499
499
|
"use strict";
|
|
500
|
-
var os = (0,
|
|
501
|
-
var tty = (0,
|
|
500
|
+
var os = (0, import_chunk_2ESYSVXG.__require)("os");
|
|
501
|
+
var tty = (0, import_chunk_2ESYSVXG.__require)("tty");
|
|
502
502
|
var hasFlag = require_has_flag();
|
|
503
503
|
var { env } = process;
|
|
504
504
|
var flagForceColor;
|
|
@@ -606,11 +606,11 @@ var require_supports_color = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
|
-
var require_node = (0,
|
|
609
|
+
var require_node = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
610
610
|
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports, module2) {
|
|
611
611
|
"use strict";
|
|
612
|
-
var tty = (0,
|
|
613
|
-
var util = (0,
|
|
612
|
+
var tty = (0, import_chunk_2ESYSVXG.__require)("tty");
|
|
613
|
+
var util = (0, import_chunk_2ESYSVXG.__require)("util");
|
|
614
614
|
exports.init = init;
|
|
615
615
|
exports.log = log;
|
|
616
616
|
exports.formatArgs = formatArgs;
|
|
@@ -779,7 +779,7 @@ var require_node = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
781
|
});
|
|
782
|
-
var require_src = (0,
|
|
782
|
+
var require_src = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
783
783
|
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports, module2) {
|
|
784
784
|
"use strict";
|
|
785
785
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|