@prisma/migrate 6.4.0-dev.6 → 6.4.0-dev.61
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 +4 -4
- package/dist/SchemaEngine.js +4 -4
- package/dist/bin.js +61 -47
- package/dist/{chunk-HAJNCOW7.js → chunk-26XQQ4AG.js} +25 -23
- package/dist/{chunk-I63N54YI.js → chunk-2RSEPJFX.js} +15 -13
- package/dist/{chunk-77RYI3ZW.js → chunk-4B2LXK4R.js} +14 -12
- package/dist/{chunk-CK5VLKFM.js → chunk-4UJBOCZJ.js} +7 -6
- package/dist/{chunk-43RWRQLU.js → chunk-5HZLCY6X.js} +14 -12
- package/dist/{chunk-KZEXQFQA.js → chunk-6WCHFXD2.js} +77 -43
- package/dist/{chunk-AMRGQNRR.js → chunk-75EIHNAH.js} +6 -6
- package/dist/{chunk-Q3SQU7C6.js → chunk-7S3Q4MCN.js} +4 -4
- package/dist/{chunk-G66QFMM5.js → chunk-AOX7CJAS.js} +14 -12
- package/dist/{chunk-GRGGAY6L.js → chunk-CUDKD32S.js} +159 -5
- package/dist/{chunk-CNAS3YE2.js → chunk-DUCG3NRP.js} +76 -42
- package/dist/{chunk-JESW2ENL.js → chunk-FF3526PX.js} +14 -12
- package/dist/{chunk-JZ6FKTWG.js → chunk-FUSFURVP.js} +6 -6
- package/dist/{chunk-CSUAUCRR.js → chunk-GCTCQLOF.js} +15 -13
- package/dist/{chunk-7QAR4NT3.js → chunk-K44VNAFW.js} +15 -13
- package/dist/{chunk-EYA6AFSF.js → chunk-M5YNQ2NP.js} +5 -5
- package/dist/{chunk-NJUAN6V2.js → chunk-O4BT6W33.js} +7 -6
- package/dist/{chunk-ZKWJDQMB.js → chunk-UVNSK22K.js} +7 -7
- package/dist/{chunk-WJT3IOMB.js → chunk-X6XGFLEF.js} +11 -9
- package/dist/{chunk-E2XKFV2C.js → chunk-YD7GG4WS.js} +8 -6
- package/dist/{chunk-JTNVQIRB.js → chunk-YWWOSXMY.js} +6 -6
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +5 -5
- package/dist/commands/DbPull.js +5 -5
- package/dist/commands/DbPush.js +6 -6
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +6 -6
- package/dist/commands/MigrateDev.js +6 -6
- package/dist/commands/MigrateDiff.js +5 -5
- package/dist/commands/MigrateReset.js +6 -6
- package/dist/commands/MigrateResolve.js +6 -6
- package/dist/commands/MigrateStatus.js +6 -6
- package/dist/index.js +54 -54
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +2 -1
- package/dist/internals/src/cli/getSchema.d.ts +20 -37
- package/dist/internals/src/cli/hashes.d.ts +2 -1
- package/dist/internals/src/cli/types.d.ts +2 -1
- package/dist/internals/src/index.d.ts +2 -1
- package/dist/internals/src/utils/loadEnvFile.d.ts +4 -2
- package/dist/internals/src/utils/toSchemasContainer.d.ts +1 -1
- package/dist/migrate/src/CLI.d.ts +2 -1
- package/dist/migrate/src/commands/DbCommand.d.ts +2 -1
- package/dist/migrate/src/commands/DbDrop.d.ts +2 -1
- package/dist/migrate/src/commands/DbExecute.d.ts +2 -1
- package/dist/migrate/src/commands/DbPull.d.ts +2 -1
- package/dist/migrate/src/commands/DbPush.d.ts +2 -1
- package/dist/migrate/src/commands/DbSeed.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateCommand.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDeploy.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDev.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateReset.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateResolve.d.ts +2 -1
- package/dist/migrate/src/commands/MigrateStatus.d.ts +2 -1
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +3 -3
- package/dist/migrate/src/utils/setupPostgres.d.ts +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +4 -4
- package/dist/utils/getSchemaPathAndPrint.js +4 -4
- package/dist/utils/introspectSql.js +3 -3
- package/dist/utils/setupPostgres.js +4 -8
- package/dist/utils/spinner.js +3 -3
- package/package.json +7 -6
|
@@ -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_CUDKD32S_exports = {};
|
|
20
|
+
__export(chunk_CUDKD32S_exports, {
|
|
21
21
|
createSpinner: () => createSpinner,
|
|
22
22
|
init_spinner: () => init_spinner
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(chunk_CUDKD32S_exports);
|
|
25
25
|
var import_chunk_YUCPBDWV = require("./chunk-YUCPBDWV.js");
|
|
26
26
|
var import_chunk_RM5LJIEV = require("./chunk-RM5LJIEV.js");
|
|
27
27
|
var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
|
|
@@ -452,7 +452,7 @@ var require_source = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
455
|
-
"../../node_modules/.pnpm/cli-spinners@2.
|
|
455
|
+
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports, module2) {
|
|
456
456
|
module2.exports = {
|
|
457
457
|
dots: {
|
|
458
458
|
interval: 80,
|
|
@@ -1240,6 +1240,21 @@ var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1240
1240
|
"\u25E5"
|
|
1241
1241
|
]
|
|
1242
1242
|
},
|
|
1243
|
+
binary: {
|
|
1244
|
+
interval: 80,
|
|
1245
|
+
frames: [
|
|
1246
|
+
"010010",
|
|
1247
|
+
"001100",
|
|
1248
|
+
"100101",
|
|
1249
|
+
"111010",
|
|
1250
|
+
"111101",
|
|
1251
|
+
"010111",
|
|
1252
|
+
"101011",
|
|
1253
|
+
"111000",
|
|
1254
|
+
"110011",
|
|
1255
|
+
"110101"
|
|
1256
|
+
]
|
|
1257
|
+
},
|
|
1243
1258
|
arc: {
|
|
1244
1259
|
interval: 100,
|
|
1245
1260
|
frames: [
|
|
@@ -1432,6 +1447,7 @@ var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1432
1447
|
"[= ]",
|
|
1433
1448
|
"[== ]",
|
|
1434
1449
|
"[=== ]",
|
|
1450
|
+
"[====]",
|
|
1435
1451
|
"[ ===]",
|
|
1436
1452
|
"[ ==]",
|
|
1437
1453
|
"[ =]",
|
|
@@ -1919,12 +1935,150 @@ var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1919
1935
|
"\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0",
|
|
1920
1936
|
"\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"
|
|
1921
1937
|
]
|
|
1938
|
+
},
|
|
1939
|
+
dwarfFortress: {
|
|
1940
|
+
interval: 80,
|
|
1941
|
+
frames: [
|
|
1942
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1943
|
+
"\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1944
|
+
"\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1945
|
+
"\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1946
|
+
"\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1947
|
+
"\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1948
|
+
"\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1949
|
+
"\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1950
|
+
"\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1951
|
+
"\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1952
|
+
" \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1953
|
+
" \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1954
|
+
" \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1955
|
+
" \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1956
|
+
" \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1957
|
+
" \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1958
|
+
" \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1959
|
+
" \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1960
|
+
" \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1961
|
+
" \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1962
|
+
" \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1963
|
+
" \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1964
|
+
" \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1965
|
+
" \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1966
|
+
" \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1967
|
+
" \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1968
|
+
" \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1969
|
+
" \u263A \u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1970
|
+
" \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1971
|
+
" \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
1972
|
+
" \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ",
|
|
1973
|
+
" \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ",
|
|
1974
|
+
" \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ",
|
|
1975
|
+
" \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ",
|
|
1976
|
+
" \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ",
|
|
1977
|
+
" \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ",
|
|
1978
|
+
" \u263A \u2588\u2588\xA3\xA3\xA3 ",
|
|
1979
|
+
" \u263A\u2588\u2588\xA3\xA3\xA3 ",
|
|
1980
|
+
" \u263A\u2588\u2588\xA3\xA3\xA3 ",
|
|
1981
|
+
" \u263A\u2593\u2588\xA3\xA3\xA3 ",
|
|
1982
|
+
" \u263A\u2593\u2588\xA3\xA3\xA3 ",
|
|
1983
|
+
" \u263A\u2592\u2588\xA3\xA3\xA3 ",
|
|
1984
|
+
" \u263A\u2592\u2588\xA3\xA3\xA3 ",
|
|
1985
|
+
" \u263A\u2591\u2588\xA3\xA3\xA3 ",
|
|
1986
|
+
" \u263A\u2591\u2588\xA3\xA3\xA3 ",
|
|
1987
|
+
" \u263A \u2588\xA3\xA3\xA3 ",
|
|
1988
|
+
" \u263A\u2588\xA3\xA3\xA3 ",
|
|
1989
|
+
" \u263A\u2588\xA3\xA3\xA3 ",
|
|
1990
|
+
" \u263A\u2593\xA3\xA3\xA3 ",
|
|
1991
|
+
" \u263A\u2593\xA3\xA3\xA3 ",
|
|
1992
|
+
" \u263A\u2592\xA3\xA3\xA3 ",
|
|
1993
|
+
" \u263A\u2592\xA3\xA3\xA3 ",
|
|
1994
|
+
" \u263A\u2591\xA3\xA3\xA3 ",
|
|
1995
|
+
" \u263A\u2591\xA3\xA3\xA3 ",
|
|
1996
|
+
" \u263A \xA3\xA3\xA3 ",
|
|
1997
|
+
" \u263A\xA3\xA3\xA3 ",
|
|
1998
|
+
" \u263A\xA3\xA3\xA3 ",
|
|
1999
|
+
" \u263A\u2593\xA3\xA3 ",
|
|
2000
|
+
" \u263A\u2593\xA3\xA3 ",
|
|
2001
|
+
" \u263A\u2592\xA3\xA3 ",
|
|
2002
|
+
" \u263A\u2592\xA3\xA3 ",
|
|
2003
|
+
" \u263A\u2591\xA3\xA3 ",
|
|
2004
|
+
" \u263A\u2591\xA3\xA3 ",
|
|
2005
|
+
" \u263A \xA3\xA3 ",
|
|
2006
|
+
" \u263A\xA3\xA3 ",
|
|
2007
|
+
" \u263A\xA3\xA3 ",
|
|
2008
|
+
" \u263A\u2593\xA3 ",
|
|
2009
|
+
" \u263A\u2593\xA3 ",
|
|
2010
|
+
" \u263A\u2592\xA3 ",
|
|
2011
|
+
" \u263A\u2592\xA3 ",
|
|
2012
|
+
" \u263A\u2591\xA3 ",
|
|
2013
|
+
" \u263A\u2591\xA3 ",
|
|
2014
|
+
" \u263A \xA3 ",
|
|
2015
|
+
" \u263A\xA3 ",
|
|
2016
|
+
" \u263A\xA3 ",
|
|
2017
|
+
" \u263A\u2593 ",
|
|
2018
|
+
" \u263A\u2593 ",
|
|
2019
|
+
" \u263A\u2592 ",
|
|
2020
|
+
" \u263A\u2592 ",
|
|
2021
|
+
" \u263A\u2591 ",
|
|
2022
|
+
" \u263A\u2591 ",
|
|
2023
|
+
" \u263A ",
|
|
2024
|
+
" \u263A &",
|
|
2025
|
+
" \u263A \u263C&",
|
|
2026
|
+
" \u263A \u263C &",
|
|
2027
|
+
" \u263A\u263C &",
|
|
2028
|
+
" \u263A\u263C & ",
|
|
2029
|
+
" \u203C & ",
|
|
2030
|
+
" \u263A & ",
|
|
2031
|
+
" \u203C & ",
|
|
2032
|
+
" \u263A & ",
|
|
2033
|
+
" \u203C & ",
|
|
2034
|
+
" \u263A & ",
|
|
2035
|
+
"\u203C & ",
|
|
2036
|
+
" & ",
|
|
2037
|
+
" & ",
|
|
2038
|
+
" & \u2591 ",
|
|
2039
|
+
" & \u2592 ",
|
|
2040
|
+
" & \u2593 ",
|
|
2041
|
+
" & \xA3 ",
|
|
2042
|
+
" & \u2591\xA3 ",
|
|
2043
|
+
" & \u2592\xA3 ",
|
|
2044
|
+
" & \u2593\xA3 ",
|
|
2045
|
+
" & \xA3\xA3 ",
|
|
2046
|
+
" & \u2591\xA3\xA3 ",
|
|
2047
|
+
" & \u2592\xA3\xA3 ",
|
|
2048
|
+
"& \u2593\xA3\xA3 ",
|
|
2049
|
+
"& \xA3\xA3\xA3 ",
|
|
2050
|
+
" \u2591\xA3\xA3\xA3 ",
|
|
2051
|
+
" \u2592\xA3\xA3\xA3 ",
|
|
2052
|
+
" \u2593\xA3\xA3\xA3 ",
|
|
2053
|
+
" \u2588\xA3\xA3\xA3 ",
|
|
2054
|
+
" \u2591\u2588\xA3\xA3\xA3 ",
|
|
2055
|
+
" \u2592\u2588\xA3\xA3\xA3 ",
|
|
2056
|
+
" \u2593\u2588\xA3\xA3\xA3 ",
|
|
2057
|
+
" \u2588\u2588\xA3\xA3\xA3 ",
|
|
2058
|
+
" \u2591\u2588\u2588\xA3\xA3\xA3 ",
|
|
2059
|
+
" \u2592\u2588\u2588\xA3\xA3\xA3 ",
|
|
2060
|
+
" \u2593\u2588\u2588\xA3\xA3\xA3 ",
|
|
2061
|
+
" \u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2062
|
+
" \u2591\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2063
|
+
" \u2592\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2064
|
+
" \u2593\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2065
|
+
" \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2066
|
+
" \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2067
|
+
" \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2068
|
+
" \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2069
|
+
" \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2070
|
+
" \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2071
|
+
" \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2072
|
+
" \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2073
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ",
|
|
2074
|
+
" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "
|
|
2075
|
+
]
|
|
1922
2076
|
}
|
|
1923
2077
|
};
|
|
1924
2078
|
}
|
|
1925
2079
|
});
|
|
1926
2080
|
var require_cli_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
1927
|
-
"../../node_modules/.pnpm/cli-spinners@2.
|
|
2081
|
+
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(exports, module2) {
|
|
1928
2082
|
"use strict";
|
|
1929
2083
|
var spinners = Object.assign({}, require_spinners());
|
|
1930
2084
|
var spinnersList = Object.keys(spinners);
|
|
@@ -26,16 +26,16 @@ 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_DUCG3NRP_exports = {};
|
|
30
|
+
__export(chunk_DUCG3NRP_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff,
|
|
32
32
|
init_MigrateDiff: () => init_MigrateDiff
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_DUCG3NRP_exports);
|
|
35
35
|
var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
|
|
36
36
|
var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
|
|
37
37
|
var import_chunk_TKAGMA5K = require("./chunk-TKAGMA5K.js");
|
|
38
|
-
var
|
|
38
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
39
39
|
var import_chunk_CQQQ436N = require("./chunk-CQQQ436N.js");
|
|
40
40
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
41
41
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
@@ -6164,6 +6164,7 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6164
6164
|
__export2(index_exports, {
|
|
6165
6165
|
CompositeFilesResolver: () => CompositeFilesResolver,
|
|
6166
6166
|
InMemoryFilesResolver: () => InMemoryFilesResolver,
|
|
6167
|
+
ensureType: () => ensureType2,
|
|
6167
6168
|
loadRelatedSchemaFiles: () => loadRelatedSchemaFiles,
|
|
6168
6169
|
loadSchemaFiles: () => loadSchemaFiles2,
|
|
6169
6170
|
realFsResolver: () => realFsResolver,
|
|
@@ -6394,6 +6395,24 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6394
6395
|
}
|
|
6395
6396
|
return void 0;
|
|
6396
6397
|
}
|
|
6398
|
+
var import_promises3 = __toESM22((0, import_chunk_WWAWV7DQ.__require)("node:fs/promises"));
|
|
6399
|
+
async function ensureType2(entryPath, expectedType) {
|
|
6400
|
+
try {
|
|
6401
|
+
const pathStat = await import_promises3.default.stat(entryPath);
|
|
6402
|
+
if (expectedType === "file" && pathStat.isFile()) {
|
|
6403
|
+
return void 0;
|
|
6404
|
+
}
|
|
6405
|
+
if (expectedType === "directory" && pathStat.isDirectory()) {
|
|
6406
|
+
return void 0;
|
|
6407
|
+
}
|
|
6408
|
+
return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
|
|
6409
|
+
} catch (e) {
|
|
6410
|
+
if (e.code === "ENOENT") {
|
|
6411
|
+
return { kind: "NotFound", path: entryPath, expectedType };
|
|
6412
|
+
}
|
|
6413
|
+
throw e;
|
|
6414
|
+
}
|
|
6415
|
+
}
|
|
6397
6416
|
}
|
|
6398
6417
|
});
|
|
6399
6418
|
async function findUp(name, {
|
|
@@ -11623,12 +11642,13 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
11623
11642
|
yarn: "1.22.22"
|
|
11624
11643
|
},
|
|
11625
11644
|
dependencies: {
|
|
11645
|
+
"@prisma/config": "workspace:*",
|
|
11626
11646
|
"@prisma/debug": "workspace:*",
|
|
11627
11647
|
"@prisma/engines": "workspace:*",
|
|
11628
11648
|
"@prisma/fetch-engine": "workspace:*",
|
|
11629
11649
|
"@prisma/generator-helper": "workspace:*",
|
|
11630
11650
|
"@prisma/get-platform": "workspace:*",
|
|
11631
|
-
"@prisma/prisma-schema-wasm": "6.4.0-
|
|
11651
|
+
"@prisma/prisma-schema-wasm": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d",
|
|
11632
11652
|
"@prisma/schema-files-loader": "workspace:*",
|
|
11633
11653
|
arg: "5.0.2",
|
|
11634
11654
|
prompts: "2.4.2"
|
|
@@ -11910,8 +11930,8 @@ var init_engine_commands = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
11910
11930
|
init_getConfig();
|
|
11911
11931
|
}
|
|
11912
11932
|
});
|
|
11913
|
-
async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
|
11914
|
-
const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
|
|
11933
|
+
async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
|
11934
|
+
const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
|
|
11915
11935
|
if (result.ok) {
|
|
11916
11936
|
return result.schema;
|
|
11917
11937
|
}
|
|
@@ -11919,7 +11939,7 @@ async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argu
|
|
|
11919
11939
|
}
|
|
11920
11940
|
async function readSchemaFromSingleFile(schemaPath) {
|
|
11921
11941
|
debug2("Reading schema from single file", schemaPath);
|
|
11922
|
-
const typeError = await ensureType(schemaPath, "file");
|
|
11942
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath, "file");
|
|
11923
11943
|
if (typeError) {
|
|
11924
11944
|
return { ok: false, error: typeError };
|
|
11925
11945
|
}
|
|
@@ -11932,7 +11952,7 @@ async function readSchemaFromSingleFile(schemaPath) {
|
|
|
11932
11952
|
}
|
|
11933
11953
|
async function readSchemaFromDirectory(schemaPath) {
|
|
11934
11954
|
debug2("Reading schema from multiple files", schemaPath);
|
|
11935
|
-
const typeError = await ensureType(schemaPath, "directory");
|
|
11955
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath, "directory");
|
|
11936
11956
|
if (typeError) {
|
|
11937
11957
|
return { ok: false, error: typeError };
|
|
11938
11958
|
}
|
|
@@ -11948,23 +11968,6 @@ async function readSchemaFromDirectory(schemaPath) {
|
|
|
11948
11968
|
}
|
|
11949
11969
|
return { ok: true, schema: { schemaPath, schemaRootDir: schemaPath, schemas: files } };
|
|
11950
11970
|
}
|
|
11951
|
-
async function ensureType(entryPath, expectedType) {
|
|
11952
|
-
try {
|
|
11953
|
-
const pathStat = await stat(entryPath);
|
|
11954
|
-
if (expectedType === "file" && pathStat.isFile()) {
|
|
11955
|
-
return void 0;
|
|
11956
|
-
}
|
|
11957
|
-
if (expectedType === "directory" && pathStat.isDirectory()) {
|
|
11958
|
-
return void 0;
|
|
11959
|
-
}
|
|
11960
|
-
return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
|
|
11961
|
-
} catch (e) {
|
|
11962
|
-
if (e.code === "ENOENT") {
|
|
11963
|
-
return { kind: "NotFound", path: entryPath, expectedType };
|
|
11964
|
-
}
|
|
11965
|
-
throw e;
|
|
11966
|
-
}
|
|
11967
|
-
}
|
|
11968
11971
|
async function readSchemaFromFileOrDirectory(schemaPath) {
|
|
11969
11972
|
let stats;
|
|
11970
11973
|
try {
|
|
@@ -11983,7 +11986,7 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
|
|
|
11983
11986
|
}
|
|
11984
11987
|
return { ok: false, error: { kind: "WrongType", path: schemaPath, expectedTypes: ["file", "directory"] } };
|
|
11985
11988
|
}
|
|
11986
|
-
async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName }) {
|
|
11989
|
+
async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
|
|
11987
11990
|
if (schemaPathFromArgs) {
|
|
11988
11991
|
const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
|
|
11989
11992
|
const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
|
|
@@ -11997,6 +12000,10 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
|
|
|
11997
12000
|
}
|
|
11998
12001
|
return customSchemaResult;
|
|
11999
12002
|
}
|
|
12003
|
+
const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
|
|
12004
|
+
if (prismaConfigResult.ok) {
|
|
12005
|
+
return prismaConfigResult;
|
|
12006
|
+
}
|
|
12000
12007
|
const pkgJsonResult = await getSchemaFromPackageJson(cwd);
|
|
12001
12008
|
if (pkgJsonResult.ok) {
|
|
12002
12009
|
return pkgJsonResult;
|
|
@@ -12052,6 +12059,31 @@ async function getPrismaConfigFromPackageJson(cwd) {
|
|
|
12052
12059
|
packagePath: pkgJson.path
|
|
12053
12060
|
};
|
|
12054
12061
|
}
|
|
12062
|
+
async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
12063
|
+
if (!schemaPathFromConfig) {
|
|
12064
|
+
return {
|
|
12065
|
+
ok: false,
|
|
12066
|
+
error: { kind: "PrismaConfigNotConfigured" }
|
|
12067
|
+
};
|
|
12068
|
+
}
|
|
12069
|
+
let schemaResult;
|
|
12070
|
+
if (schemaPathFromConfig.kind === "single") {
|
|
12071
|
+
schemaResult = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
|
|
12072
|
+
if (!schemaResult.ok) {
|
|
12073
|
+
throw new Error(
|
|
12074
|
+
`Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
|
12075
|
+
);
|
|
12076
|
+
}
|
|
12077
|
+
} else {
|
|
12078
|
+
schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
|
|
12079
|
+
if (!schemaResult.ok) {
|
|
12080
|
+
throw new Error(
|
|
12081
|
+
`Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
|
12082
|
+
);
|
|
12083
|
+
}
|
|
12084
|
+
}
|
|
12085
|
+
return schemaResult;
|
|
12086
|
+
}
|
|
12055
12087
|
async function getSchemaFromPackageJson(cwd) {
|
|
12056
12088
|
const prismaConfig = await getPrismaConfigFromPackageJson(cwd);
|
|
12057
12089
|
debug2("prismaConfig", prismaConfig);
|
|
@@ -12165,7 +12197,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
12165
12197
|
import_fs_jetpack = (0, import_chunk_WWAWV7DQ.__toESM)(require_main());
|
|
12166
12198
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
12167
12199
|
init_getSchema();
|
|
12168
|
-
(0,
|
|
12200
|
+
(0, import_chunk_UVNSK22K.init_Migrate)();
|
|
12169
12201
|
(0, import_chunk_TKAGMA5K.init_captureStdout)();
|
|
12170
12202
|
debug3 = (0, import_debug3.default)("prisma:migrate:diff");
|
|
12171
12203
|
helpOptions = (0, import_internals.format)(
|
|
@@ -12176,6 +12208,7 @@ var init_MigrateDiff = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
12176
12208
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
12177
12209
|
|
|
12178
12210
|
-h, --help Display this help message
|
|
12211
|
+
--config Custom path to your Prisma config file
|
|
12179
12212
|
-o, --output Writes to a file instead of stdout
|
|
12180
12213
|
|
|
12181
12214
|
${(0, import_chunk_6TE2RIPN.italic)("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
|
|
@@ -12209,7 +12242,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
12209
12242
|
static new() {
|
|
12210
12243
|
return new _MigrateDiff2();
|
|
12211
12244
|
}
|
|
12212
|
-
async parse(argv) {
|
|
12245
|
+
async parse(argv, config) {
|
|
12213
12246
|
const args = (0, import_internals.arg)(
|
|
12214
12247
|
argv,
|
|
12215
12248
|
{
|
|
@@ -12235,14 +12268,15 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
12235
12268
|
"--shadow-database-url": String,
|
|
12236
12269
|
"--script": Boolean,
|
|
12237
12270
|
"--exit-code": Boolean,
|
|
12238
|
-
"--telemetry-information": String
|
|
12271
|
+
"--telemetry-information": String,
|
|
12272
|
+
"--config": String
|
|
12239
12273
|
},
|
|
12240
12274
|
false
|
|
12241
12275
|
);
|
|
12242
12276
|
if ((0, import_internals.isError)(args)) {
|
|
12243
12277
|
return this.help(args.message);
|
|
12244
12278
|
}
|
|
12245
|
-
await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, false);
|
|
12279
|
+
await (0, import_internals.checkUnsupportedDataProxy)("migrate diff", args, config.schema, false);
|
|
12246
12280
|
if (args["--help"]) {
|
|
12247
12281
|
return this.help();
|
|
12248
12282
|
}
|
|
@@ -12269,17 +12303,17 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
12269
12303
|
tag: "empty"
|
|
12270
12304
|
};
|
|
12271
12305
|
} else if (args["--from-schema-datasource"]) {
|
|
12272
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false });
|
|
12273
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), {
|
|
12306
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--from-schema-datasource"], printMessage: false, config });
|
|
12307
|
+
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datasource"]), config.schema, {
|
|
12274
12308
|
argumentName: "--from-schema-datasource"
|
|
12275
12309
|
});
|
|
12276
|
-
const
|
|
12310
|
+
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12277
12311
|
from = {
|
|
12278
12312
|
tag: "schemaDatasource",
|
|
12279
|
-
...(0, import_internals.toSchemasWithConfigDir)(schema,
|
|
12313
|
+
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12280
12314
|
};
|
|
12281
12315
|
} else if (args["--from-schema-datamodel"]) {
|
|
12282
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), {
|
|
12316
|
+
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--from-schema-datamodel"]), config.schema, {
|
|
12283
12317
|
argumentName: "--from-schema-datamodel"
|
|
12284
12318
|
});
|
|
12285
12319
|
from = {
|
|
@@ -12309,17 +12343,17 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
12309
12343
|
tag: "empty"
|
|
12310
12344
|
};
|
|
12311
12345
|
} else if (args["--to-schema-datasource"]) {
|
|
12312
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false });
|
|
12313
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), {
|
|
12346
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--to-schema-datasource"], printMessage: false, config });
|
|
12347
|
+
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datasource"]), config.schema, {
|
|
12314
12348
|
argumentName: "--to-schema-datasource"
|
|
12315
12349
|
});
|
|
12316
|
-
const
|
|
12350
|
+
const engineConfig = await (0, import_internals.getConfig)({ datamodel: schema.schemas });
|
|
12317
12351
|
to = {
|
|
12318
12352
|
tag: "schemaDatasource",
|
|
12319
|
-
...(0, import_internals.toSchemasWithConfigDir)(schema,
|
|
12353
|
+
...(0, import_internals.toSchemasWithConfigDir)(schema, engineConfig)
|
|
12320
12354
|
};
|
|
12321
12355
|
} else if (args["--to-schema-datamodel"]) {
|
|
12322
|
-
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), {
|
|
12356
|
+
const schema = await getSchemaWithPath(import_path2.default.resolve(args["--to-schema-datamodel"]), config.schema, {
|
|
12323
12357
|
argumentName: "--to-schema-datamodel"
|
|
12324
12358
|
});
|
|
12325
12359
|
to = {
|
|
@@ -12343,7 +12377,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Flags")}
|
|
|
12343
12377
|
url: `file:${d1Database}`
|
|
12344
12378
|
};
|
|
12345
12379
|
}
|
|
12346
|
-
const migrate = new
|
|
12380
|
+
const migrate = new import_chunk_UVNSK22K.Migrate();
|
|
12347
12381
|
const captureStdout = new import_chunk_TKAGMA5K.CaptureStdout();
|
|
12348
12382
|
const outputPath = args["--output"];
|
|
12349
12383
|
const isOutputDefined = Boolean(outputPath);
|
|
@@ -26,15 +26,15 @@ 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_FF3526PX_exports = {};
|
|
30
|
+
__export(chunk_FF3526PX_exports, {
|
|
31
31
|
DbPush: () => DbPush,
|
|
32
32
|
init_DbPush: () => init_DbPush
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_FF3526PX_exports);
|
|
35
|
+
var import_chunk_UVNSK22K = require("./chunk-UVNSK22K.js");
|
|
36
36
|
var import_chunk_U374EXYQ = require("./chunk-U374EXYQ.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_M5YNQ2NP = require("./chunk-M5YNQ2NP.js");
|
|
38
38
|
var import_chunk_Q7ACZDDT = require("./chunk-Q7ACZDDT.js");
|
|
39
39
|
var import_chunk_XJQP3B4W = require("./chunk-XJQP3B4W.js");
|
|
40
40
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
@@ -45,16 +45,16 @@ var _DbPush, DbPush;
|
|
|
45
45
|
var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
46
46
|
"src/commands/DbPush.ts"() {
|
|
47
47
|
(0, import_chunk_6TE2RIPN.init_colors)();
|
|
48
|
-
(0,
|
|
48
|
+
(0, import_chunk_UVNSK22K.init_Migrate)();
|
|
49
49
|
(0, import_chunk_XJQP3B4W.init_ensureDatabaseExists)();
|
|
50
50
|
(0, import_chunk_U374EXYQ.init_errors)();
|
|
51
|
-
(0,
|
|
51
|
+
(0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
|
|
52
52
|
(0, import_chunk_Q7ACZDDT.init_printDatasource)();
|
|
53
53
|
_DbPush = class _DbPush2 {
|
|
54
54
|
static new() {
|
|
55
55
|
return new _DbPush2();
|
|
56
56
|
}
|
|
57
|
-
async parse(argv) {
|
|
57
|
+
async parse(argv, config) {
|
|
58
58
|
const args = (0, import_internals.arg)(
|
|
59
59
|
argv,
|
|
60
60
|
{
|
|
@@ -64,6 +64,7 @@ var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
64
64
|
"--force-reset": Boolean,
|
|
65
65
|
"--skip-generate": Boolean,
|
|
66
66
|
"--schema": String,
|
|
67
|
+
"--config": String,
|
|
67
68
|
"--telemetry-information": String
|
|
68
69
|
},
|
|
69
70
|
false
|
|
@@ -71,15 +72,15 @@ var init_DbPush = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
71
72
|
if ((0, import_internals.isError)(args)) {
|
|
72
73
|
return this.help(args.message);
|
|
73
74
|
}
|
|
74
|
-
await (0, import_internals.checkUnsupportedDataProxy)("db push", args, true);
|
|
75
|
+
await (0, import_internals.checkUnsupportedDataProxy)("db push", args, config.schema, true);
|
|
75
76
|
if (args["--help"]) {
|
|
76
77
|
return this.help();
|
|
77
78
|
}
|
|
78
|
-
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true });
|
|
79
|
-
const { schemaPath } = await (0,
|
|
79
|
+
await (0, import_internals.loadEnvFile)({ schemaPath: args["--schema"], printMessage: true, config });
|
|
80
|
+
const { schemaPath } = await (0, import_chunk_M5YNQ2NP.getSchemaPathAndPrint)(args["--schema"], config.schema);
|
|
80
81
|
const datasourceInfo = await (0, import_chunk_XJQP3B4W.getDatasourceInfo)({ schemaPath });
|
|
81
82
|
(0, import_chunk_Q7ACZDDT.printDatasource)({ datasourceInfo });
|
|
82
|
-
const migrate = new
|
|
83
|
+
const migrate = new import_chunk_UVNSK22K.Migrate(schemaPath);
|
|
83
84
|
try {
|
|
84
85
|
const wasDbCreated = await (0, import_chunk_XJQP3B4W.ensureDatabaseExists)("push", schemaPath);
|
|
85
86
|
if (wasDbCreated) {
|
|
@@ -256,6 +257,7 @@ ${(0, import_chunk_6TE2RIPN.bold)("Usage")}
|
|
|
256
257
|
${(0, import_chunk_6TE2RIPN.bold)("Options")}
|
|
257
258
|
|
|
258
259
|
-h, --help Display this help message
|
|
260
|
+
--config Custom path to your Prisma config file
|
|
259
261
|
--schema Custom path to your Prisma schema
|
|
260
262
|
--accept-data-loss Ignore data loss warnings
|
|
261
263
|
--force-reset Force a reset of the database before push
|
|
@@ -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_FUSFURVP_exports = {};
|
|
20
|
+
__export(chunk_FUSFURVP_exports, {
|
|
21
21
|
CLI: () => CLI,
|
|
22
22
|
init_CLI: () => init_CLI
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(chunk_FUSFURVP_exports);
|
|
25
25
|
var import_chunk_6TE2RIPN = require("./chunk-6TE2RIPN.js");
|
|
26
26
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
27
27
|
var import_internals = require("@prisma/internals");
|
|
@@ -36,11 +36,11 @@ var init_CLI = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
36
36
|
static new(cmds) {
|
|
37
37
|
return new _CLI2(cmds);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
async parse(argv) {
|
|
39
|
+
async parse(argv, config) {
|
|
41
40
|
const args = (0, import_internals.arg)(argv, {
|
|
42
41
|
"--help": Boolean,
|
|
43
42
|
"-h": "--help",
|
|
43
|
+
"--config": String,
|
|
44
44
|
"--json": Boolean,
|
|
45
45
|
// for -v
|
|
46
46
|
"--experimental": Boolean,
|
|
@@ -67,7 +67,7 @@ var init_CLI = (0, import_chunk_WWAWV7DQ.__esm)({
|
|
|
67
67
|
} else {
|
|
68
68
|
argsForCmd = args._.slice(1);
|
|
69
69
|
}
|
|
70
|
-
return cmd.parse(argsForCmd);
|
|
70
|
+
return cmd.parse(argsForCmd, config);
|
|
71
71
|
}
|
|
72
72
|
return (0, import_internals.unknownCommand)(this.help(), args._[0]);
|
|
73
73
|
}
|