@prisma/migrate 6.6.0-dev.6 → 6.6.0-dev.60
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 +47 -46
- 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-IR55GBON.js → chunk-5LTDMS3H.js} +18 -18
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-Q3ZLC44N.js → chunk-63X7FE2R.js} +57 -66
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-N4XTKFY6.js → chunk-7RM467G7.js} +39 -38
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
- package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
- package/dist/{chunk-P6CRNGJX.js → chunk-D25S2AO3.js} +369 -528
- package/dist/{chunk-ZOEKRXDP.js → chunk-D2DGSPW6.js} +29 -55
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-HCBZB4XC.js → chunk-FFPSJTA6.js} +53 -52
- package/dist/{chunk-N3KYWSX2.js → chunk-FZGPSDP7.js} +55 -49
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-MKK3GSDF.js → chunk-NIKXBMZL.js} +5 -5
- package/dist/{chunk-GG54LOYV.js → chunk-O6RQXRWU.js} +45 -44
- package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
- package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
- package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
- package/dist/{chunk-6LVK6LMG.js → chunk-T7SQQSVM.js} +370 -529
- package/dist/{chunk-CQZFVAXC.js → chunk-TN7JMNXD.js} +42 -41
- 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-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-KS7IEA6Z.js → chunk-YGBJA7QJ.js} +50 -52
- package/dist/{chunk-WI2A2TQE.js → chunk-ZJ4IDCRR.js} +90 -91
- package/dist/chunk-ZLHWX5PJ.js +883 -0
- 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 +11 -10
- 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 +50 -51
- package/dist/internals/src/Generator.d.ts +23 -5
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +59 -0
- package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
- package/dist/internals/src/convertCredentials.d.ts +1 -1
- package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
- package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
- package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
- package/dist/internals/src/errorReporting.d.ts +0 -1
- package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
- package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/internals/src/index.d.ts +7 -7
- package/dist/internals/src/migrateTypes.d.ts +63 -0
- package/dist/internals/src/panic.d.ts +1 -4
- package/dist/internals/src/resolvePkg.d.ts +7 -0
- package/dist/internals/src/types.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
- package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
- package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
- package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
- package/dist/migrate/src/Migrate.d.ts +7 -5
- package/dist/migrate/src/SchemaEngine.d.ts +5 -9
- package/dist/migrate/src/index.d.ts +0 -1
- package/dist/migrate/src/types.d.ts +14 -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/introspectSql.d.ts +3 -2
- package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
- package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -2
- package/dist/migrate/src/views/handleViewsIO.d.ts +2 -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/{getSchemaPathAndPrint.js → createMigration.js} +8 -8
- 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/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 +1478 -707
- 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/test-handlePanic.js +1 -30
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +10 -10
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/chunk-J46BJQHT.js +0 -268
- package/dist/chunk-KOF4LGTS.js +0 -1817
- package/dist/chunk-YYPMC5FN.js +0 -1407
- package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
- package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
|
@@ -26,24 +26,53 @@ 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_SQKGZVG3_exports = {};
|
|
30
|
+
__export(chunk_SQKGZVG3_exports, {
|
|
31
31
|
DbDrop: () => DbDrop
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_SQKGZVG3_exports);
|
|
34
34
|
var import_chunk_IHDN3L3R = require("./chunk-IHDN3L3R.js");
|
|
35
35
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
36
|
-
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
37
36
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
38
|
-
var
|
|
37
|
+
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
39
38
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
40
|
-
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
41
39
|
var import_internals = require("@prisma/internals");
|
|
42
40
|
var import_prompts = __toESM(require("prompts"));
|
|
43
|
-
var
|
|
41
|
+
var DbDrop = class _DbDrop {
|
|
44
42
|
static new() {
|
|
45
|
-
return new
|
|
43
|
+
return new _DbDrop();
|
|
46
44
|
}
|
|
45
|
+
static help = (0, import_internals.format)(`
|
|
46
|
+
${process.platform === "win32" ? "" : "\u{1F4A3} "}Drop the database
|
|
47
|
+
|
|
48
|
+
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.yellow)("WARNING"))} ${(0, import_chunk_SKRR5WT4.bold)(
|
|
49
|
+
`Prisma db drop is currently in Preview (${(0, import_internals.link)("https://pris.ly/d/preview")}).
|
|
50
|
+
There may be bugs and it's not recommended to use it in production environments.`
|
|
51
|
+
)}
|
|
52
|
+
${(0, import_chunk_SKRR5WT4.dim)("When using any of the subcommands below you need to explicitly opt-in via the --preview-feature flag.")}
|
|
53
|
+
|
|
54
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
55
|
+
|
|
56
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop [options] --preview-feature
|
|
57
|
+
|
|
58
|
+
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
59
|
+
|
|
60
|
+
-h, --help Display this help message
|
|
61
|
+
--config Custom path to your Prisma config file
|
|
62
|
+
--schema Custom path to your Prisma schema
|
|
63
|
+
-f, --force Skip the confirmation prompt
|
|
64
|
+
|
|
65
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
66
|
+
|
|
67
|
+
Drop the database
|
|
68
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature
|
|
69
|
+
|
|
70
|
+
Specify a schema
|
|
71
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --schema=./schema.prisma
|
|
72
|
+
|
|
73
|
+
Use --force to skip the confirmation prompt
|
|
74
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --force
|
|
75
|
+
`);
|
|
47
76
|
async parse(argv, config) {
|
|
48
77
|
const args = (0, import_internals.arg)(argv, {
|
|
49
78
|
"--help": Boolean,
|
|
@@ -58,7 +87,6 @@ var _DbDrop = class _DbDrop2 {
|
|
|
58
87
|
if ((0, import_internals.isError)(args)) {
|
|
59
88
|
return this.help(args.message);
|
|
60
89
|
}
|
|
61
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db drop", args, config.schema, true);
|
|
62
90
|
if (args["--help"]) {
|
|
63
91
|
return this.help();
|
|
64
92
|
}
|
|
@@ -66,8 +94,12 @@ var _DbDrop = class _DbDrop2 {
|
|
|
66
94
|
throw new import_chunk_IHDN3L3R.PreviewFlagError();
|
|
67
95
|
}
|
|
68
96
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
69
|
-
const
|
|
70
|
-
|
|
97
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
98
|
+
schemaPathFromArg: args["--schema"],
|
|
99
|
+
schemaPathFromConfig: config.schema
|
|
100
|
+
});
|
|
101
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "db drop", schemaContext });
|
|
102
|
+
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
71
103
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
72
104
|
process.stdout.write("\n");
|
|
73
105
|
if (!args["--force"]) {
|
|
@@ -100,40 +132,8 @@ ${(0, import_chunk_SKRR5WT4.red)("All data will be lost")}.`
|
|
|
100
132
|
if (error) {
|
|
101
133
|
return new import_internals.HelpError(`
|
|
102
134
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
103
|
-
${
|
|
135
|
+
${_DbDrop.help}`);
|
|
104
136
|
}
|
|
105
|
-
return
|
|
137
|
+
return _DbDrop.help;
|
|
106
138
|
}
|
|
107
139
|
};
|
|
108
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_DbDrop, "help", (0, import_internals.format)(`
|
|
109
|
-
${process.platform === "win32" ? "" : "\u{1F4A3} "}Drop the database
|
|
110
|
-
|
|
111
|
-
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.yellow)("WARNING"))} ${(0, import_chunk_SKRR5WT4.bold)(
|
|
112
|
-
`Prisma db drop is currently in Preview (${(0, import_internals.link)("https://pris.ly/d/preview")}).
|
|
113
|
-
There may be bugs and it's not recommended to use it in production environments.`
|
|
114
|
-
)}
|
|
115
|
-
${(0, import_chunk_SKRR5WT4.dim)("When using any of the subcommands below you need to explicitly opt-in via the --preview-feature flag.")}
|
|
116
|
-
|
|
117
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
118
|
-
|
|
119
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop [options] --preview-feature
|
|
120
|
-
|
|
121
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
122
|
-
|
|
123
|
-
-h, --help Display this help message
|
|
124
|
-
--config Custom path to your Prisma config file
|
|
125
|
-
--schema Custom path to your Prisma schema
|
|
126
|
-
-f, --force Skip the confirmation prompt
|
|
127
|
-
|
|
128
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
129
|
-
|
|
130
|
-
Drop the database
|
|
131
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature
|
|
132
|
-
|
|
133
|
-
Specify a schema
|
|
134
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --schema=./schema.prisma
|
|
135
|
-
|
|
136
|
-
Use --force to skip the confirmation prompt
|
|
137
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db drop --preview-feature --force
|
|
138
|
-
`));
|
|
139
|
-
var DbDrop = _DbDrop;
|