@prisma/migrate 6.6.0-dev.10 → 6.6.0-dev.101
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 +9 -6
- package/dist/SchemaEngine.js +0 -28
- package/dist/SchemaEngineCLI.js +29 -0
- package/dist/{utils/getSchemaPathAndPrint.js → SchemaEngineWasm.js} +8 -8
- package/dist/bin.js +52 -50
- 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-MKK3GSDF.js → chunk-344G2PKM.js} +9 -9
- package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-GG54LOYV.js → chunk-A4FQW4A5.js} +54 -50
- 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-N3KYWSX2.js → chunk-CCFFDJW6.js} +63 -49
- package/dist/{chunk-N4XTKFY6.js → chunk-CLSF7VUT.js} +42 -38
- package/dist/{chunk-IR55GBON.js → chunk-CU5UT2ED.js} +19 -18
- package/dist/{chunk-CQZFVAXC.js → chunk-CYEVXXRH.js} +51 -47
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-KS7IEA6Z.js → chunk-HIDSEBVV.js} +55 -54
- package/dist/{chunk-ZOEKRXDP.js → chunk-I3LT2PO3.js} +35 -57
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/chunk-IK3BVD3Y.js +233 -0
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-HCBZB4XC.js → chunk-KW633S3Y.js} +56 -52
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
- package/dist/chunk-PQKZ53DW.js +76 -0
- package/dist/{chunk-5GVIOOXU.js → chunk-QTXX5BQZ.js} +393 -533
- package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
- package/dist/{chunk-2B4IAB6L.js → chunk-RPOUM5FT.js} +392 -532
- package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
- package/dist/chunk-URKH6SE2.js +479 -0
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-WI2A2TQE.js → chunk-XO3EJLOT.js} +100 -92
- package/dist/{chunk-Q3ZLC44N.js → chunk-YBS5GSRF.js} +64 -69
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/chunk-YSWLN2IJ.js +890 -0
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +4 -5
- package/dist/commands/DbExecute.js +10 -7
- package/dist/commands/DbPull.js +17 -12
- package/dist/commands/DbPush.js +12 -10
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +14 -12
- package/dist/commands/MigrateDev.js +17 -15
- package/dist/commands/MigrateDiff.js +13 -10
- package/dist/commands/MigrateReset.js +16 -14
- package/dist/commands/MigrateResolve.js +12 -10
- package/dist/commands/MigrateStatus.js +12 -10
- package/dist/index.js +58 -57
- package/dist/internals/src/Generator.d.ts +23 -5
- package/dist/internals/src/WasmSchemaEngineLoader.d.ts +5 -0
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
- 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 +10 -8
- 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/internals/src/wasm.d.ts +3 -1
- package/dist/migrate/src/Migrate.d.ts +18 -7
- package/dist/migrate/src/SchemaEngine.d.ts +20 -50
- package/dist/migrate/src/SchemaEngineCLI.d.ts +139 -0
- package/dist/migrate/src/SchemaEngineWasm.d.ts +134 -0
- package/dist/migrate/src/commands/DbExecute.d.ts +1 -1
- package/dist/migrate/src/commands/DbPull.d.ts +1 -1
- package/dist/migrate/src/commands/DbPush.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDeploy.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDev.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateReset.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateResolve.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateStatus.d.ts +1 -1
- package/dist/migrate/src/index.d.ts +2 -2
- package/dist/migrate/src/types.d.ts +19 -19
- 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/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 +10 -5
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +10 -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 +553 -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 +12 -11
- 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
|
@@ -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_5R44VVVX_exports = {};
|
|
20
|
+
__export(chunk_5R44VVVX_exports, {
|
|
21
21
|
require_lib: () => require_lib
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var require_safer = (0,
|
|
23
|
+
module.exports = __toCommonJS(chunk_5R44VVVX_exports);
|
|
24
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
25
|
+
var require_safer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
26
26
|
"../../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js"(exports, module2) {
|
|
27
27
|
"use strict";
|
|
28
|
-
var buffer = (0,
|
|
28
|
+
var buffer = (0, import_chunk_2ESYSVXG.__require)("buffer");
|
|
29
29
|
var Buffer2 = buffer.Buffer;
|
|
30
30
|
var safer = {};
|
|
31
31
|
var key;
|
|
@@ -88,7 +88,7 @@ var require_safer = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
88
88
|
module2.exports = safer;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
var require_bom_handling = (0,
|
|
91
|
+
var require_bom_handling = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
92
92
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/bom-handling.js"(exports) {
|
|
93
93
|
"use strict";
|
|
94
94
|
var BOMChar = "\uFEFF";
|
|
@@ -130,7 +130,7 @@ var require_bom_handling = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
var require_internal = (0,
|
|
133
|
+
var require_internal = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
134
134
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.js"(exports, module2) {
|
|
135
135
|
"use strict";
|
|
136
136
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -163,7 +163,7 @@ var require_internal = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
163
163
|
}
|
|
164
164
|
InternalCodec.prototype.encoder = InternalEncoder;
|
|
165
165
|
InternalCodec.prototype.decoder = InternalDecoder;
|
|
166
|
-
var StringDecoder = (0,
|
|
166
|
+
var StringDecoder = (0, import_chunk_2ESYSVXG.__require)("string_decoder").StringDecoder;
|
|
167
167
|
if (!StringDecoder.prototype.end)
|
|
168
168
|
StringDecoder.prototype.end = function() {
|
|
169
169
|
};
|
|
@@ -280,7 +280,7 @@ var require_internal = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
|
-
var require_utf32 = (0,
|
|
283
|
+
var require_utf32 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
284
284
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.js"(exports) {
|
|
285
285
|
"use strict";
|
|
286
286
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -497,7 +497,7 @@ var require_utf32 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
});
|
|
500
|
-
var require_utf16 = (0,
|
|
500
|
+
var require_utf16 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
501
501
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.js"(exports) {
|
|
502
502
|
"use strict";
|
|
503
503
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -629,7 +629,7 @@ var require_utf16 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
|
-
var require_utf7 = (0,
|
|
632
|
+
var require_utf7 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
633
633
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.js"(exports) {
|
|
634
634
|
"use strict";
|
|
635
635
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -828,7 +828,7 @@ var require_utf7 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
830
|
});
|
|
831
|
-
var require_sbcs_codec = (0,
|
|
831
|
+
var require_sbcs_codec = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
832
832
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
|
|
833
833
|
"use strict";
|
|
834
834
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -882,7 +882,7 @@ var require_sbcs_codec = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
|
-
var require_sbcs_data = (0,
|
|
885
|
+
var require_sbcs_data = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
886
886
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data.js"(exports, module2) {
|
|
887
887
|
"use strict";
|
|
888
888
|
module2.exports = {
|
|
@@ -1033,7 +1033,7 @@ var require_sbcs_data = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
|
-
var require_sbcs_data_generated = (0,
|
|
1036
|
+
var require_sbcs_data_generated = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1037
1037
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports, module2) {
|
|
1038
1038
|
"use strict";
|
|
1039
1039
|
module2.exports = {
|
|
@@ -1486,7 +1486,7 @@ var require_sbcs_data_generated = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1486
1486
|
};
|
|
1487
1487
|
}
|
|
1488
1488
|
});
|
|
1489
|
-
var require_dbcs_codec = (0,
|
|
1489
|
+
var require_dbcs_codec = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1490
1490
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
|
|
1491
1491
|
"use strict";
|
|
1492
1492
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -1901,7 +1901,7 @@ var require_dbcs_codec = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
1903
|
});
|
|
1904
|
-
var require_shiftjis = (0,
|
|
1904
|
+
var require_shiftjis = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1905
1905
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports, module2) {
|
|
1906
1906
|
module2.exports = [
|
|
1907
1907
|
["0", "\0", 128],
|
|
@@ -2030,7 +2030,7 @@ var require_shiftjis = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2030
2030
|
];
|
|
2031
2031
|
}
|
|
2032
2032
|
});
|
|
2033
|
-
var require_eucjp = (0,
|
|
2033
|
+
var require_eucjp = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2034
2034
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/eucjp.json"(exports, module2) {
|
|
2035
2035
|
module2.exports = [
|
|
2036
2036
|
["0", "\0", 127],
|
|
@@ -2216,7 +2216,7 @@ var require_eucjp = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2216
2216
|
];
|
|
2217
2217
|
}
|
|
2218
2218
|
});
|
|
2219
|
-
var require_cp936 = (0,
|
|
2219
|
+
var require_cp936 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2220
2220
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp936.json"(exports, module2) {
|
|
2221
2221
|
module2.exports = [
|
|
2222
2222
|
["0", "\0", 127, "\u20AC"],
|
|
@@ -2484,7 +2484,7 @@ var require_cp936 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2484
2484
|
];
|
|
2485
2485
|
}
|
|
2486
2486
|
});
|
|
2487
|
-
var require_gbk_added = (0,
|
|
2487
|
+
var require_gbk_added = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2488
2488
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports, module2) {
|
|
2489
2489
|
module2.exports = [
|
|
2490
2490
|
["a140", "\uE4C6", 62],
|
|
@@ -2544,12 +2544,12 @@ var require_gbk_added = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2544
2544
|
];
|
|
2545
2545
|
}
|
|
2546
2546
|
});
|
|
2547
|
-
var require_gb18030_ranges = (0,
|
|
2547
|
+
var require_gb18030_ranges = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2548
2548
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports, module2) {
|
|
2549
2549
|
module2.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] };
|
|
2550
2550
|
}
|
|
2551
2551
|
});
|
|
2552
|
-
var require_cp949 = (0,
|
|
2552
|
+
var require_cp949 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2553
2553
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp949.json"(exports, module2) {
|
|
2554
2554
|
module2.exports = [
|
|
2555
2555
|
["0", "\0", 127],
|
|
@@ -2826,7 +2826,7 @@ var require_cp949 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
2826
2826
|
];
|
|
2827
2827
|
}
|
|
2828
2828
|
});
|
|
2829
|
-
var require_cp950 = (0,
|
|
2829
|
+
var require_cp950 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2830
2830
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/cp950.json"(exports, module2) {
|
|
2831
2831
|
module2.exports = [
|
|
2832
2832
|
["0", "\0", 127],
|
|
@@ -3007,7 +3007,7 @@ var require_cp950 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3007
3007
|
];
|
|
3008
3008
|
}
|
|
3009
3009
|
});
|
|
3010
|
-
var require_big5_added = (0,
|
|
3010
|
+
var require_big5_added = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3011
3011
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/tables/big5-added.json"(exports, module2) {
|
|
3012
3012
|
module2.exports = [
|
|
3013
3013
|
["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"],
|
|
@@ -3133,7 +3133,7 @@ var require_big5_added = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3133
3133
|
];
|
|
3134
3134
|
}
|
|
3135
3135
|
});
|
|
3136
|
-
var require_dbcs_data = (0,
|
|
3136
|
+
var require_dbcs_data = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3137
3137
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-data.js"(exports, module2) {
|
|
3138
3138
|
"use strict";
|
|
3139
3139
|
module2.exports = {
|
|
@@ -3378,7 +3378,7 @@ var require_dbcs_data = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3378
3378
|
};
|
|
3379
3379
|
}
|
|
3380
3380
|
});
|
|
3381
|
-
var require_encodings = (0,
|
|
3381
|
+
var require_encodings = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3382
3382
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/index.js"(exports, module2) {
|
|
3383
3383
|
"use strict";
|
|
3384
3384
|
var modules = [
|
|
@@ -3403,7 +3403,7 @@ var require_encodings = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3403
3403
|
var i;
|
|
3404
3404
|
}
|
|
3405
3405
|
});
|
|
3406
|
-
var require_streams = (0,
|
|
3406
|
+
var require_streams = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3407
3407
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.js"(exports, module2) {
|
|
3408
3408
|
"use strict";
|
|
3409
3409
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -3496,7 +3496,7 @@ var require_streams = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3496
3496
|
};
|
|
3497
3497
|
}
|
|
3498
3498
|
});
|
|
3499
|
-
var require_lib = (0,
|
|
3499
|
+
var require_lib = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3500
3500
|
"../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js"(exports, module2) {
|
|
3501
3501
|
"use strict";
|
|
3502
3502
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -3599,7 +3599,7 @@ var require_lib = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3599
3599
|
};
|
|
3600
3600
|
var stream_module;
|
|
3601
3601
|
try {
|
|
3602
|
-
stream_module = (0,
|
|
3602
|
+
stream_module = (0, import_chunk_2ESYSVXG.__require)("stream");
|
|
3603
3603
|
} catch (e) {
|
|
3604
3604
|
}
|
|
3605
3605
|
if (stream_module && stream_module.Transform) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,35 +17,30 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
29
|
+
var chunk_74LUB4XX_exports = {};
|
|
30
|
+
__export(chunk_74LUB4XX_exports, {
|
|
21
31
|
ensureCanConnectToDatabase: () => ensureCanConnectToDatabase,
|
|
22
32
|
ensureDatabaseExists: () => ensureDatabaseExists,
|
|
23
|
-
getDatasourceInfo: () => getDatasourceInfo,
|
|
24
33
|
getDbLocation: () => getDbLocation,
|
|
34
|
+
parseDatasourceInfo: () => parseDatasourceInfo,
|
|
25
35
|
prettifyProvider: () => prettifyProvider
|
|
26
36
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(chunk_74LUB4XX_exports);
|
|
28
38
|
var import_chunk_TWPTG4XS = require("./chunk-TWPTG4XS.js");
|
|
29
39
|
var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
|
|
30
40
|
var import_internals = require("@prisma/internals");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = {}) {
|
|
35
|
-
const schema = await (0, import_internals.getSchema)(schemaPath);
|
|
36
|
-
let config;
|
|
37
|
-
try {
|
|
38
|
-
config = await (0, import_internals.getConfig)({ datamodel: schema, ignoreEnvVarErrors: false });
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (throwIfEnvError) {
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
config = await (0, import_internals.getConfig)({ datamodel: schema, ignoreEnvVarErrors: true });
|
|
44
|
-
}
|
|
45
|
-
const firstDatasource = config.datasources[0] ? config.datasources[0] : void 0;
|
|
46
|
-
if (!firstDatasource) {
|
|
41
|
+
var import_path = __toESM(require("path"));
|
|
42
|
+
function parseDatasourceInfo(datasource) {
|
|
43
|
+
if (!datasource) {
|
|
47
44
|
return {
|
|
48
45
|
name: void 0,
|
|
49
46
|
prettyProvider: void 0,
|
|
@@ -55,67 +52,64 @@ async function getDatasourceInfo({
|
|
|
55
52
|
configDir: void 0
|
|
56
53
|
};
|
|
57
54
|
}
|
|
58
|
-
const prettyProvider = prettifyProvider(
|
|
59
|
-
const url = (0, import_internals.getEffectiveUrl)(
|
|
60
|
-
if (!url ||
|
|
55
|
+
const prettyProvider = prettifyProvider(datasource.provider);
|
|
56
|
+
const url = (0, import_internals.getEffectiveUrl)(datasource).value;
|
|
57
|
+
if (!url || datasource.provider === "sqlserver") {
|
|
61
58
|
return {
|
|
62
|
-
name:
|
|
59
|
+
name: datasource.name,
|
|
63
60
|
prettyProvider,
|
|
64
61
|
dbName: void 0,
|
|
65
62
|
dbLocation: void 0,
|
|
66
63
|
url: url || void 0,
|
|
67
64
|
schema: void 0,
|
|
68
|
-
schemas:
|
|
69
|
-
configDir: (
|
|
65
|
+
schemas: datasource.schemas,
|
|
66
|
+
configDir: import_path.default.dirname(datasource.sourceFilePath)
|
|
70
67
|
};
|
|
71
68
|
}
|
|
72
69
|
try {
|
|
73
70
|
const credentials = (0, import_internals.uriToCredentials)(url);
|
|
74
71
|
const dbLocation = getDbLocation(credentials);
|
|
75
|
-
let
|
|
76
|
-
if (["postgresql", "cockroachdb"].includes(
|
|
72
|
+
let schema = void 0;
|
|
73
|
+
if (["postgresql", "cockroachdb"].includes(datasource.provider)) {
|
|
77
74
|
if (credentials.schema) {
|
|
78
|
-
|
|
75
|
+
schema = credentials.schema;
|
|
79
76
|
} else {
|
|
80
|
-
|
|
77
|
+
schema = "public";
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
80
|
const datasourceInfo = {
|
|
84
|
-
name:
|
|
81
|
+
name: datasource.name,
|
|
85
82
|
prettyProvider,
|
|
86
83
|
dbName: credentials.database,
|
|
87
84
|
dbLocation,
|
|
88
85
|
url,
|
|
89
|
-
schema
|
|
90
|
-
schemas:
|
|
91
|
-
configDir: (
|
|
86
|
+
schema,
|
|
87
|
+
schemas: datasource.schemas,
|
|
88
|
+
configDir: import_path.default.dirname(datasource.sourceFilePath)
|
|
92
89
|
};
|
|
93
|
-
if (
|
|
90
|
+
if (datasource.provider === "postgresql" && datasourceInfo.dbName === void 0) {
|
|
94
91
|
datasourceInfo.dbName = "postgres";
|
|
95
92
|
}
|
|
96
93
|
return datasourceInfo;
|
|
97
94
|
} catch (e) {
|
|
98
95
|
return {
|
|
99
|
-
name:
|
|
96
|
+
name: datasource.name,
|
|
100
97
|
prettyProvider,
|
|
101
98
|
dbName: void 0,
|
|
102
99
|
dbLocation: void 0,
|
|
103
100
|
url,
|
|
104
101
|
schema: void 0,
|
|
105
|
-
schemas:
|
|
106
|
-
configDir: (
|
|
102
|
+
schemas: datasource.schemas,
|
|
103
|
+
configDir: import_path.default.dirname(datasource.sourceFilePath)
|
|
107
104
|
};
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
|
-
async function ensureCanConnectToDatabase(
|
|
111
|
-
|
|
112
|
-
const config = await (0, import_internals.getConfig)({ datamodel: schema, ignoreEnvVarErrors: false });
|
|
113
|
-
const firstDatasource = config.datasources[0] ? config.datasources[0] : void 0;
|
|
114
|
-
if (!firstDatasource) {
|
|
107
|
+
async function ensureCanConnectToDatabase(datasource) {
|
|
108
|
+
if (!datasource) {
|
|
115
109
|
throw new Error(`A datasource block is missing in the Prisma schema file.`);
|
|
116
110
|
}
|
|
117
|
-
const schemaDir = (
|
|
118
|
-
const url = (
|
|
111
|
+
const schemaDir = import_path.default.dirname(datasource.sourceFilePath);
|
|
112
|
+
const url = getConnectionUrl(datasource);
|
|
119
113
|
const canConnect = await (0, import_internals.canConnectToDatabase)(url, schemaDir);
|
|
120
114
|
if (canConnect === true) {
|
|
121
115
|
return true;
|
|
@@ -124,15 +118,12 @@ async function ensureCanConnectToDatabase(schemaPath) {
|
|
|
124
118
|
throw new Error(`${code}: ${message}`);
|
|
125
119
|
}
|
|
126
120
|
}
|
|
127
|
-
async function ensureDatabaseExists(
|
|
128
|
-
|
|
129
|
-
const config = await (0, import_internals.getConfig)({ datamodel: schemas, ignoreEnvVarErrors: false });
|
|
130
|
-
const firstDatasource = config.datasources[0] ? config.datasources[0] : void 0;
|
|
131
|
-
if (!firstDatasource) {
|
|
121
|
+
async function ensureDatabaseExists(datasource) {
|
|
122
|
+
if (!datasource) {
|
|
132
123
|
throw new Error(`A datasource block is missing in the Prisma schema file.`);
|
|
133
124
|
}
|
|
134
|
-
const schemaDir = (
|
|
135
|
-
const url = (
|
|
125
|
+
const schemaDir = import_path.default.dirname(datasource.sourceFilePath);
|
|
126
|
+
const url = getConnectionUrl(datasource);
|
|
136
127
|
const canConnect = await (0, import_internals.canConnectToDatabase)(url, schemaDir);
|
|
137
128
|
if (canConnect === true) {
|
|
138
129
|
return;
|
|
@@ -141,16 +132,13 @@ async function ensureDatabaseExists(action, schemaPath) {
|
|
|
141
132
|
if (code !== "P1003") {
|
|
142
133
|
throw new Error(`${code}: ${message}`);
|
|
143
134
|
}
|
|
144
|
-
if (!schemaDir) {
|
|
145
|
-
throw new Error(`Could not locate ${schemaPath || "schema.prisma"}`);
|
|
146
|
-
}
|
|
147
135
|
if (await (0, import_internals.createDatabase)(url, schemaDir)) {
|
|
148
|
-
if (
|
|
136
|
+
if (datasource.provider === "sqlserver") {
|
|
149
137
|
return `SQL Server database created.
|
|
150
138
|
`;
|
|
151
139
|
}
|
|
152
140
|
const credentials = (0, import_internals.uriToCredentials)(url);
|
|
153
|
-
const prettyProvider = prettifyProvider(
|
|
141
|
+
const prettyProvider = prettifyProvider(datasource.provider);
|
|
154
142
|
let message2 = `${prettyProvider} database${credentials.database ? ` ${credentials.database} ` : " "}created`;
|
|
155
143
|
const dbLocation = getDbLocation(credentials);
|
|
156
144
|
if (dbLocation) {
|
|
@@ -193,3 +181,14 @@ function prettifyProvider(provider) {
|
|
|
193
181
|
return `MongoDB`;
|
|
194
182
|
}
|
|
195
183
|
}
|
|
184
|
+
function getConnectionUrl(datasource) {
|
|
185
|
+
const url = (0, import_internals.getEffectiveUrl)(datasource);
|
|
186
|
+
if (!url.value) {
|
|
187
|
+
if (url.fromEnvVar) {
|
|
188
|
+
throw new Error(`Environment variable '${url.fromEnvVar}' with database connection URL was not found.`);
|
|
189
|
+
} else {
|
|
190
|
+
throw new Error(`Datasource is missing a database connection URL.`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return url.value;
|
|
194
|
+
}
|
|
@@ -26,24 +26,49 @@ 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_A4FQW4A5_exports = {};
|
|
30
|
+
__export(chunk_A4FQW4A5_exports, {
|
|
31
31
|
DbPush: () => DbPush
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var import_chunk_KOF4LGTS = require("./chunk-KOF4LGTS.js");
|
|
33
|
+
module.exports = __toCommonJS(chunk_A4FQW4A5_exports);
|
|
35
34
|
var import_chunk_3WC4XD74 = require("./chunk-3WC4XD74.js");
|
|
36
|
-
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
37
35
|
var import_chunk_QOPTDDIH = require("./chunk-QOPTDDIH.js");
|
|
38
|
-
var
|
|
36
|
+
var import_chunk_74LUB4XX = require("./chunk-74LUB4XX.js");
|
|
37
|
+
var import_chunk_YSWLN2IJ = require("./chunk-YSWLN2IJ.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 DbPush = class _DbPush {
|
|
44
42
|
static new() {
|
|
45
|
-
return new
|
|
43
|
+
return new _DbPush();
|
|
46
44
|
}
|
|
45
|
+
static help = (0, import_internals.format)(`
|
|
46
|
+
${process.platform === "win32" ? "" : "\u{1F64C} "}Push the state from your Prisma schema to your database
|
|
47
|
+
|
|
48
|
+
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
49
|
+
|
|
50
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push [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
|
+
--accept-data-loss Ignore data loss warnings
|
|
58
|
+
--force-reset Force a reset of the database before push
|
|
59
|
+
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
60
|
+
|
|
61
|
+
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
62
|
+
|
|
63
|
+
Push the Prisma schema state to the database
|
|
64
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
|
|
65
|
+
|
|
66
|
+
Specify a schema
|
|
67
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --schema=./schema.prisma
|
|
68
|
+
|
|
69
|
+
Ignore data loss warnings
|
|
70
|
+
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --accept-data-loss
|
|
71
|
+
`);
|
|
47
72
|
async parse(argv, config) {
|
|
48
73
|
const args = (0, import_internals.arg)(
|
|
49
74
|
argv,
|
|
@@ -62,23 +87,30 @@ var _DbPush = class _DbPush2 {
|
|
|
62
87
|
if ((0, import_internals.isError)(args)) {
|
|
63
88
|
return this.help(args.message);
|
|
64
89
|
}
|
|
65
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db push", args, config.schema, true);
|
|
66
90
|
if (args["--help"]) {
|
|
67
91
|
return this.help();
|
|
68
92
|
}
|
|
69
93
|
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
70
|
-
const
|
|
71
|
-
|
|
94
|
+
const schemaContext = await (0, import_internals.loadSchemaContext)({
|
|
95
|
+
schemaPathFromArg: args["--schema"],
|
|
96
|
+
schemaPathFromConfig: config.schema
|
|
97
|
+
});
|
|
98
|
+
const { migrationsDirPath } = (0, import_internals.inferDirectoryConfig)(schemaContext);
|
|
99
|
+
(0, import_internals.checkUnsupportedDataProxy)({ cmd: "db push", schemaContext });
|
|
100
|
+
const datasourceInfo = (0, import_chunk_74LUB4XX.parseDatasourceInfo)(schemaContext.primaryDatasource);
|
|
72
101
|
(0, import_chunk_QOPTDDIH.printDatasource)({ datasourceInfo });
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
const adapter = await config.migrate?.adapter(process.env);
|
|
103
|
+
const migrate = await import_chunk_YSWLN2IJ.Migrate.setup({ adapter, migrationsDirPath, schemaContext });
|
|
104
|
+
if (!adapter) {
|
|
105
|
+
try {
|
|
106
|
+
const wasDbCreated = await (0, import_chunk_74LUB4XX.ensureDatabaseExists)(schemaContext.primaryDatasource);
|
|
107
|
+
if (wasDbCreated) {
|
|
108
|
+
process.stdout.write("\n" + wasDbCreated + "\n");
|
|
109
|
+
}
|
|
110
|
+
} catch (e) {
|
|
111
|
+
process.stdout.write("\n");
|
|
112
|
+
throw e;
|
|
78
113
|
}
|
|
79
|
-
} catch (e) {
|
|
80
|
-
process.stdout.write("\n");
|
|
81
|
-
throw e;
|
|
82
114
|
}
|
|
83
115
|
let wasDatabaseReset = false;
|
|
84
116
|
if (args["--force-reset"]) {
|
|
@@ -196,36 +228,8 @@ ${rocketEmoji}${provider === "mongodb" ? migrationSuccessMongoMessage : migratio
|
|
|
196
228
|
if (error) {
|
|
197
229
|
return new import_internals.HelpError(`
|
|
198
230
|
${(0, import_chunk_SKRR5WT4.bold)((0, import_chunk_SKRR5WT4.red)(`!`))} ${error}
|
|
199
|
-
${
|
|
231
|
+
${_DbPush.help}`);
|
|
200
232
|
}
|
|
201
|
-
return
|
|
233
|
+
return _DbPush.help;
|
|
202
234
|
}
|
|
203
235
|
};
|
|
204
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(_DbPush, "help", (0, import_internals.format)(`
|
|
205
|
-
${process.platform === "win32" ? "" : "\u{1F64C} "}Push the state from your Prisma schema to your database
|
|
206
|
-
|
|
207
|
-
${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
208
|
-
|
|
209
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push [options]
|
|
210
|
-
|
|
211
|
-
${(0, import_chunk_SKRR5WT4.bold)("Options")}
|
|
212
|
-
|
|
213
|
-
-h, --help Display this help message
|
|
214
|
-
--config Custom path to your Prisma config file
|
|
215
|
-
--schema Custom path to your Prisma schema
|
|
216
|
-
--accept-data-loss Ignore data loss warnings
|
|
217
|
-
--force-reset Force a reset of the database before push
|
|
218
|
-
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|
219
|
-
|
|
220
|
-
${(0, import_chunk_SKRR5WT4.bold)("Examples")}
|
|
221
|
-
|
|
222
|
-
Push the Prisma schema state to the database
|
|
223
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push
|
|
224
|
-
|
|
225
|
-
Specify a schema
|
|
226
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --schema=./schema.prisma
|
|
227
|
-
|
|
228
|
-
Ignore data loss warnings
|
|
229
|
-
${(0, import_chunk_SKRR5WT4.dim)("$")} prisma db push --accept-data-loss
|
|
230
|
-
`));
|
|
231
|
-
var DbPush = _DbPush;
|
|
@@ -16,15 +16,15 @@ 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_AI6DH66U_exports = {};
|
|
20
|
+
__export(chunk_AI6DH66U_exports, {
|
|
21
21
|
printDatamodelObject: () => printDatamodelObject,
|
|
22
22
|
printDatasources: () => printDatasources
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var import_indent_string = (0,
|
|
24
|
+
module.exports = __toCommonJS(chunk_AI6DH66U_exports);
|
|
25
|
+
var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
|
|
26
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
27
|
+
var import_indent_string = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_2R6DII47.require_indent_string)());
|
|
28
28
|
function printDatasources(internalDatasources) {
|
|
29
29
|
return internalDatasources.map((d) => String(new InternalDataSourceClass(d))).join("\n\n");
|
|
30
30
|
}
|