@prisma/orm-toolchain 8.0.0-rc.1-dev.37 → 8.0.0-rc.1-dev.38
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/bin__prisma-next.mjs +23 -23
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs → caught-errors-DLPzfzIW-CQ9BoXD-.mjs} +3 -3
- package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs.map → caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map} +1 -1
- package/dist/{cli-errors-C6_pH59O-CzD4SYcJ.mjs → cli-errors-BG6bItjG-DwdKIeGz.mjs} +4 -4
- package/dist/cli-errors-BG6bItjG-DwdKIeGz.mjs.map +1 -0
- package/dist/{cli-errors-WMw54cyq-DC2OYnd7.d.mts → cli-errors-BiKBrOXc-JPxQqO58.d.mts} +45 -5
- package/dist/cli-errors-BiKBrOXc-JPxQqO58.d.mts.map +1 -0
- package/dist/cli.mjs +305 -21
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__commands__contract-emit.mjs +1 -1
- package/dist/cli__commands__contract-infer.mjs +1 -1
- package/dist/cli__commands__db-init.mjs +1 -1
- package/dist/cli__commands__db-schema.mjs +1 -1
- package/dist/cli__commands__db-sign.mjs +1 -1
- package/dist/cli__commands__db-update.mjs +1 -1
- package/dist/cli__commands__db-verify.mjs +1 -1
- package/dist/cli__commands__migrate.d.mts +2 -2
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.mjs +1 -1
- package/dist/cli__commands__migration-graph.d.mts +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +1 -1
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.d.mts +1 -1
- package/dist/cli__commands__migration-log.mjs +1 -1
- package/dist/cli__commands__migration-new.mjs +1 -1
- package/dist/cli__commands__migration-plan.d.mts +1 -1
- package/dist/cli__commands__migration-plan.mjs +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.d.mts +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +11 -3
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +15 -15
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/{client-BqhVohc5-DFRVWFps.mjs → client-DU9qtBxW-BjVHiKzE.mjs} +57 -11
- package/dist/client-DU9qtBxW-BjVHiKzE.mjs.map +1 -0
- package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs → command-helpers-CwLvFwMB-BWwUQhlT.mjs} +3 -3
- package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs.map → command-helpers-CwLvFwMB-BWwUQhlT.mjs.map} +1 -1
- package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs} +3 -3
- package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs.map → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map} +1 -1
- package/dist/{contract-emit-Cpj5Qz7z-BXt3HGPC.mjs → contract-emit-BQFpcb2A-BwT9iVdb.mjs} +5 -5
- package/dist/{contract-emit-Cpj5Qz7z-BXt3HGPC.mjs.map → contract-emit-BQFpcb2A-BwT9iVdb.mjs.map} +1 -1
- package/dist/contract-emit-Bzt11N4v-BQ2Pr8KG.mjs +2 -0
- package/dist/{contract-emit-Dp1pe06_-Cdpvh5DH.mjs → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs} +5 -5
- package/dist/{contract-emit-Dp1pe06_-Cdpvh5DH.mjs.map → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs.map} +1 -1
- package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs → contract-infer-C6cYOihE-CIUCgmw0.mjs} +4 -4
- package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs.map → contract-infer-C6cYOihE-CIUCgmw0.mjs.map} +1 -1
- package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs} +4 -4
- package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs.map → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs} +4 -4
- package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs.map → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs.map} +1 -1
- package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs → db-init-DypCy1e3-CBrYfhHF.mjs} +6 -6
- package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs.map → db-init-DypCy1e3-CBrYfhHF.mjs.map} +1 -1
- package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs → db-init-failure-BmCcHUfc-BqDxyrJE.mjs} +3 -3
- package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs.map → db-init-failure-BmCcHUfc-BqDxyrJE.mjs.map} +1 -1
- package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs → db-schema-DHfPM-5V-JeCjrQ55.mjs} +4 -4
- package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs.map → db-schema-DHfPM-5V-JeCjrQ55.mjs.map} +1 -1
- package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs → db-sign-DbAxRcZh-C-nT9kcG.mjs} +6 -6
- package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs.map → db-sign-DbAxRcZh-C-nT9kcG.mjs.map} +1 -1
- package/dist/{db-update-BX1sOuQk-CpeLgPeN.mjs → db-update-J59yROwL-DCP-_z2W.mjs} +16 -7
- package/dist/db-update-J59yROwL-DCP-_z2W.mjs.map +1 -0
- package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs → db-verify-0TpDMziA-CJDKutMN.mjs} +5 -5
- package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs.map → db-verify-0TpDMziA-CJDKutMN.mjs.map} +1 -1
- package/dist/{format-DceifGAK-BJhTdkcO.mjs → format-cbJY7l6v-CjMUDTAs.mjs} +5 -5
- package/dist/{format-DceifGAK-BJhTdkcO.mjs.map → format-cbJY7l6v-CjMUDTAs.mjs.map} +1 -1
- package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs → framework-components-C3K7SBeC-Bj5gx85-.mjs} +3 -3
- package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs.map → framework-components-C3K7SBeC-Bj5gx85-.mjs.map} +1 -1
- package/dist/{init-DMiJjbrC-C7-PvDyK.mjs → init-Bco4QkKJ-DqUZVrBU.mjs} +4 -4
- package/dist/{init-DMiJjbrC-C7-PvDyK.mjs.map → init-Bco4QkKJ-DqUZVrBU.mjs.map} +1 -1
- package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs} +5 -5
- package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs.map → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map} +1 -1
- package/dist/{invariants-1L2zfc6--BpedlAbF.mjs → invariants-1zL5-9Mc-BCeOLxd_.mjs} +4 -4
- package/dist/{invariants-1L2zfc6--BpedlAbF.mjs.map → invariants-1zL5-9Mc-BCeOLxd_.mjs.map} +1 -1
- package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs → legend-BQcPKTLe-bn9e4_ZU.mjs} +3 -3
- package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs.map → legend-BQcPKTLe-bn9e4_ZU.mjs.map} +1 -1
- package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs → migrate-CgSnzAUm-aGstaO5N.mjs} +12 -12
- package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs.map → migrate-CgSnzAUm-aGstaO5N.mjs.map} +1 -1
- package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs → migrate-failure-CnoUcDms-taa9pfd7.mjs} +4 -4
- package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs.map → migrate-failure-CnoUcDms-taa9pfd7.mjs.map} +1 -1
- package/dist/{migrate-show-DRfCIamX-BK6CN3RI.d.mts → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts} +3 -3
- package/dist/{migrate-show-DRfCIamX-BK6CN3RI.d.mts.map → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map} +1 -1
- package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs → migrate-show-kVUG1xdo-bVTW8tu4.mjs} +6 -6
- package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs.map → migrate-show-kVUG1xdo-bVTW8tu4.mjs.map} +1 -1
- package/dist/{migration-check-BHiINj74-CVazN1LV.mjs → migration-check-BVK9vfan-Dfg8lbeB.mjs} +6 -6
- package/dist/{migration-check-BHiINj74-CVazN1LV.mjs.map → migration-check-BVK9vfan-Dfg8lbeB.mjs.map} +1 -1
- package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs → migration-check-CBMoMDX2-DhSEOGNg.mjs} +6 -6
- package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs.map → migration-check-CBMoMDX2-DhSEOGNg.mjs.map} +1 -1
- package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs} +5 -5
- package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs.map → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs.map} +1 -1
- package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs → migration-graph-B30X5398-BH3zB9Mn.mjs} +3 -3
- package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs.map → migration-graph-B30X5398-BH3zB9Mn.mjs.map} +1 -1
- package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs → migration-graph-D2dbLCkl-CCHL0aDA.mjs} +8 -8
- package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs.map → migration-graph-D2dbLCkl-CCHL0aDA.mjs.map} +1 -1
- package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs} +3 -3
- package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs.map → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs.map} +1 -1
- package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs → migration-list-BQTfSGbT-DoNqbNsu.mjs} +3 -3
- package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs.map → migration-list-BQTfSGbT-DoNqbNsu.mjs.map} +1 -1
- package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs → migration-list-DCx0KOFp-B3MiGnpa.mjs} +6 -6
- package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs.map → migration-list-DCx0KOFp-B3MiGnpa.mjs.map} +1 -1
- package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs → migration-log-CJ6_9_uj-uWyc3vlC.mjs} +6 -6
- package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs.map → migration-log-CJ6_9_uj-uWyc3vlC.mjs.map} +1 -1
- package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs → migration-new-Bp5dPKnF-D-Fb6vEp.mjs} +7 -7
- package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs.map → migration-new-Bp5dPKnF-D-Fb6vEp.mjs.map} +1 -1
- package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs → migration-new-CXLgOLXz-2C5s_q7n.mjs} +4 -4
- package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs.map → migration-new-CXLgOLXz-2C5s_q7n.mjs.map} +1 -1
- package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs} +3 -3
- package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs.map → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs.map} +1 -1
- package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs → migration-plan-BxfF1Hdo-BKn0xMlY.mjs} +4 -4
- package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs.map → migration-plan-BxfF1Hdo-BKn0xMlY.mjs.map} +1 -1
- package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs → migration-plan-C6KrFHJT-CRkTsE7L.mjs} +8 -8
- package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs.map → migration-plan-C6KrFHJT-CRkTsE7L.mjs.map} +1 -1
- package/dist/{migration-plan-DPp3Orhx-6edvA2e2.d.mts → migration-plan-CharRhoN-BIB3WL65.d.mts} +3 -3
- package/dist/{migration-plan-DPp3Orhx-6edvA2e2.d.mts.map → migration-plan-CharRhoN-BIB3WL65.d.mts.map} +1 -1
- package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs → migration-show-Dhnlx_GU-DhWLLt3Z.mjs} +8 -8
- package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs.map → migration-show-Dhnlx_GU-DhWLLt3Z.mjs.map} +1 -1
- package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs → migration-status-S88DjM8c-DLHnCKfW.mjs} +10 -10
- package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs.map → migration-status-S88DjM8c-DLHnCKfW.mjs.map} +1 -1
- package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs → project-import-root-nwdoPWap--5vXe4zp.mjs} +3 -3
- package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs.map → project-import-root-nwdoPWap--5vXe4zp.mjs.map} +1 -1
- package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs → ref-C8oaaeky-ColNkWpr.mjs} +5 -5
- package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs.map → ref-C8oaaeky-ColNkWpr.mjs.map} +1 -1
- package/dist/{ref-CaqNqeRF-cjWFAueu.mjs → ref-gZQjdz8I-CW6n9Fc0.mjs} +4 -4
- package/dist/{ref-CaqNqeRF-cjWFAueu.mjs.map → ref-gZQjdz8I-CW6n9Fc0.mjs.map} +1 -1
- package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs} +3 -3
- package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs.map → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs.map} +1 -1
- package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs → telemetry-DPXFYAsz-CPW2USxs.mjs} +3 -3
- package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs.map → telemetry-DPXFYAsz-CPW2USxs.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/cli-errors-C6_pH59O-CzD4SYcJ.mjs.map +0 -1
- package/dist/cli-errors-WMw54cyq-DC2OYnd7.d.mts.map +0 -1
- package/dist/client-BqhVohc5-DFRVWFps.mjs.map +0 -1
- package/dist/contract-emit-BHZYuA91-wlnU7OrE.mjs +0 -2
- package/dist/db-update-BX1sOuQk-CpeLgPeN.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { i as loadConfig } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { I as requireLiveDatabase, L as runCommandAction, M as errorTargetMigrationNotSupported, O as errorRunnerFailed, P as errorUnexpected, a as errorConfigValidation$1, b as errorMigrationPlanningFailed, c as errorContractValidationFailed, d as errorDriverRequired, f as errorFileNotFound, g as errorLegendHumanOnly, k as errorRuntime$1, l as errorDatabaseConnectionRequired, o as errorConsentPlanMismatch, t as CliStructuredError$1$1, u as errorDestructiveChanges, x as errorNoMigrations, y as errorMigrationPackageNotFound } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
3
3
|
import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
|
|
4
|
-
import { n as executeContractEmit } from "./contract-emit-
|
|
4
|
+
import { n as executeContractEmit } from "./contract-emit-CZQZ1i4z-p9LSGmmQ.mjs";
|
|
5
5
|
import { h as renderPreviewStatement, m as previewBlockHeader } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
|
|
6
6
|
import { c as spaceMigrationDirectory } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
|
|
7
|
-
import { S as targetSupportsMigrations, f as maskConnectionUrl, n as closeQuietly, v as sanitizeErrorMessage } from "./command-helpers-
|
|
8
|
-
import { t as createContractEmitCommand } from "./contract-emit-
|
|
9
|
-
import { n as executeFormat, t as createFormatCommand } from "./format-
|
|
10
|
-
import { a as loadContractSpaceAggregateForCli, r as buildReadAggregate, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-
|
|
11
|
-
import { t as createControlClient } from "./client-
|
|
7
|
+
import { S as targetSupportsMigrations, f as maskConnectionUrl, n as closeQuietly, v as sanitizeErrorMessage } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
8
|
+
import { t as createContractEmitCommand } from "./contract-emit-BQFpcb2A-BwT9iVdb.mjs";
|
|
9
|
+
import { n as executeFormat, t as createFormatCommand } from "./format-cbJY7l6v-CjMUDTAs.mjs";
|
|
10
|
+
import { a as loadContractSpaceAggregateForCli, r as buildReadAggregate, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs";
|
|
11
|
+
import { t as createControlClient } from "./client-DU9qtBxW-BjVHiKzE.mjs";
|
|
12
12
|
import { a as readContractIR, o as resolveRefAdvancementFields, t as advanceRefSafely } from "./ref-advancement-DaZBzm7m-WoqnFAyr.mjs";
|
|
13
|
-
import { t as mapDbInitFailure } from "./db-init-failure-
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { n as
|
|
13
|
+
import { t as mapDbInitFailure } from "./db-init-failure-BmCcHUfc-BqDxyrJE.mjs";
|
|
14
|
+
import { t as resolveContractRefToSnapshot } from "./contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs";
|
|
15
|
+
import { t as mapCaughtMigrationError } from "./caught-errors-DLPzfzIW-CQ9BoXD-.mjs";
|
|
16
|
+
import { t as mapContractAtError } from "./contract-at-errors-Dptf8RE_-B5gr04Sc.mjs";
|
|
17
|
+
import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-1zL5-9Mc-BCeOLxd_.mjs";
|
|
18
|
+
import { t as executeMigrateShowPlan } from "./migrate-show-kVUG1xdo-bVTW8tu4.mjs";
|
|
19
|
+
import { n as resolveMigrationRef, t as resolveContractRef } from "./ref-resolution-DAK4OK3x-B-8ZZc0f.mjs";
|
|
20
|
+
import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-BQTfSGbT-DoNqbNsu.mjs";
|
|
20
21
|
import { S as toneSpans, b as renderMigrationListWithStyle, d as createToneMigrationListStyler, n as TONE_MIGRATION_GRAPH_PALETTE, v as renderMigrationGraphLegend, x as toneDrawing } from "./migration-graph-command-render-BeuEyf2B-BNH9oUB_.mjs";
|
|
21
|
-
import { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from "./migrate-failure-
|
|
22
|
-
import { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from "./migration-path-target-
|
|
23
|
-
import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-
|
|
24
|
-
import { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from "./migration-graph-sections-
|
|
22
|
+
import { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from "./migrate-failure-CnoUcDms-taa9pfd7.mjs";
|
|
23
|
+
import { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from "./migration-path-target-BNTSTPAc-D7dQ4K7x.mjs";
|
|
24
|
+
import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-B30X5398-BH3zB9Mn.mjs";
|
|
25
|
+
import { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from "./migration-graph-sections-0lKA5l1b-CTHQquu7.mjs";
|
|
25
26
|
import { a as sortLedgerEntries, i as serializeLedgerEntriesForJson, n as formatLedgerAppliedAt, o as styleHashTransition, t as MIGRATION_LOG_EMPTY_MESSAGE } from "./migration-log-table-DRiOnvzf-zTQBThqe.mjs";
|
|
26
|
-
import { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from "./ref-
|
|
27
|
+
import { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from "./ref-C8oaaeky-ColNkWpr.mjs";
|
|
27
28
|
import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
28
29
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
29
30
|
import { basename, dirname, join, normalize, relative, resolve } from "pathe";
|
|
30
31
|
import { existsSync, unlinkSync, writeFileSync } from "node:fs";
|
|
31
32
|
import { DOCS_BASE, isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
32
33
|
import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
|
|
33
|
-
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
34
|
+
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
34
35
|
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
35
36
|
import { APP_SPACE_ID, createControlStack } from "@prisma/orm-framework/components/control";
|
|
36
37
|
import { collectConfigIssues } from "@prisma/orm-framework/config/config-validation";
|
|
@@ -40,7 +41,7 @@ import { defineCommand, defineCommandFamily, defineConfigSection, flag, position
|
|
|
40
41
|
import { CliStructuredError as CliStructuredError$1, notOk, ok } from "@prisma/cli-engine/protocol";
|
|
41
42
|
import { pathToFileURL } from "node:url";
|
|
42
43
|
import { build } from "esbuild";
|
|
43
|
-
//#region ../../../1-framework/3-tooling/cli/dist/load-config-
|
|
44
|
+
//#region ../../../1-framework/3-tooling/cli/dist/load-config-pL46nF5F.mjs
|
|
44
45
|
const MISSING_CONFIG_ACTION = {
|
|
45
46
|
kind: "run-command",
|
|
46
47
|
label: "Create a config file",
|
|
@@ -637,6 +638,22 @@ function previewBlocks$1(preview) {
|
|
|
637
638
|
lines: statements
|
|
638
639
|
}];
|
|
639
640
|
}
|
|
641
|
+
/**
|
|
642
|
+
* What the planner flagged without refusing to plan it. Only `db update`
|
|
643
|
+
* produces these — the additive-only policies cannot reach the branch.
|
|
644
|
+
*/
|
|
645
|
+
function plannerWarningBlocks(result) {
|
|
646
|
+
const warnings = result.warnings ?? [];
|
|
647
|
+
if (warnings.length === 0) return [];
|
|
648
|
+
return [{
|
|
649
|
+
kind: "summary",
|
|
650
|
+
status: "warn",
|
|
651
|
+
text: "Planner warnings"
|
|
652
|
+
}, {
|
|
653
|
+
kind: "list",
|
|
654
|
+
items: warnings.map((warning) => warning.summary)
|
|
655
|
+
}];
|
|
656
|
+
}
|
|
640
657
|
function planSummaryText(result) {
|
|
641
658
|
const operations = result.plan.operations.length;
|
|
642
659
|
const spaces = result.perSpace?.length ?? 0;
|
|
@@ -657,6 +674,7 @@ function planBlocks(result) {
|
|
|
657
674
|
status: "ok",
|
|
658
675
|
text: planSummaryText(result)
|
|
659
676
|
},
|
|
677
|
+
...plannerWarningBlocks(result),
|
|
660
678
|
...operationBlocks$1(result),
|
|
661
679
|
{
|
|
662
680
|
kind: "fields",
|
|
@@ -717,6 +735,7 @@ function applyBlocks(result) {
|
|
|
717
735
|
status: "ok",
|
|
718
736
|
text: applySummaryText(result)
|
|
719
737
|
},
|
|
738
|
+
...plannerWarningBlocks(result),
|
|
720
739
|
...operationBlocks$1(result),
|
|
721
740
|
...fallbackMarkerBlocks(result),
|
|
722
741
|
...advanced === null || advanced === void 0 ? [] : [{
|
|
@@ -1157,6 +1176,270 @@ function createDbSchemaCommand(createClient) {
|
|
|
1157
1176
|
});
|
|
1158
1177
|
}
|
|
1159
1178
|
const dbSchemaCommand = createDbSchemaCommand(createControlClient);
|
|
1179
|
+
/**
|
|
1180
|
+
* A `db update` failure as the CLI's structured error.
|
|
1181
|
+
*
|
|
1182
|
+
* `DESTRUCTIVE_CHANGES` is handled by the command, which asks for consent and
|
|
1183
|
+
* calls again; it is mapped here for the case the control API returns it from a
|
|
1184
|
+
* call that already carried consent, which would otherwise degrade silently.
|
|
1185
|
+
*
|
|
1186
|
+
* The `assertNever` is deliberate: a control-API failure code this does not
|
|
1187
|
+
* handle must stop the command rather than degrade into a generic message.
|
|
1188
|
+
*/
|
|
1189
|
+
function mapDbUpdateFailure(failure) {
|
|
1190
|
+
if (failure.code === "PLANNING_FAILED") return errorMigrationPlanningFailed({ conflicts: failure.conflicts ?? [] });
|
|
1191
|
+
if (failure.code === "RUNNER_FAILED") {
|
|
1192
|
+
const fix = (typeof failure.meta?.["runnerErrorCode"] === "string" ? failure.meta["runnerErrorCode"] : void 0) === "MIGRATION.LEGACY_MARKER_SHAPE" ? "Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-next db init` to recreate it with the current per-space schema." : "Inspect the reported conflict, reconcile schema drift if needed, then re-run `prisma-next db update`";
|
|
1193
|
+
return errorRunnerFailed(failure.summary, {
|
|
1194
|
+
why: failure.why ?? "Migration runner failed",
|
|
1195
|
+
fix,
|
|
1196
|
+
meta: {
|
|
1197
|
+
...failure.meta,
|
|
1198
|
+
...failure.warnings && failure.warnings.length > 0 ? { plannerWarnings: failure.warnings } : {}
|
|
1199
|
+
},
|
|
1200
|
+
...ifDefined("cause", failure.cause)
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
if (failure.code === "DESTRUCTIVE_CHANGES") return errorDestructiveChanges(failure.summary, {
|
|
1204
|
+
...ifDefined("why", failure.why),
|
|
1205
|
+
fix: "Re-run `prisma-next db update` and type the database name when asked, or pass `--no-interactive --confirm <database>` where there is nobody to ask. Use `--dry-run` to preview the operations first.",
|
|
1206
|
+
...failure.destructiveChanges ? { meta: {
|
|
1207
|
+
destructiveOperations: failure.destructiveChanges.destructiveOperations,
|
|
1208
|
+
databaseName: failure.destructiveChanges.databaseName,
|
|
1209
|
+
planHash: failure.destructiveChanges.planHash
|
|
1210
|
+
} } : {}
|
|
1211
|
+
});
|
|
1212
|
+
if (failure.code === "CONSENT_PLAN_MISMATCH") return errorConsentPlanMismatch({
|
|
1213
|
+
consentedPlanHash: failure.consentPlanMismatch?.consentedPlanHash ?? "",
|
|
1214
|
+
planHash: failure.consentPlanMismatch?.planHash ?? "",
|
|
1215
|
+
...ifDefined("why", failure.why)
|
|
1216
|
+
});
|
|
1217
|
+
const exhaustive = failure.code;
|
|
1218
|
+
return assertNever(exhaustive, `Unhandled DbUpdateFailure code: ${String(exhaustive)}`);
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* A token nobody can type is not consent: an empty one makes the engine's
|
|
1222
|
+
* type-to-confirm accept a bare Enter, and `--confirm ""` grant outright.
|
|
1223
|
+
*/
|
|
1224
|
+
function errorConsentTokenUnresolved(targetId) {
|
|
1225
|
+
return new CliStructuredError$1("CLI.CONSENT_TOKEN_UNRESOLVED", "The database this run would change has no name to confirm.", {
|
|
1226
|
+
why: `The connected database reports no name, and the target id "${targetId}" yields none either, so the consent prompt has nothing to ask you to type and the destructive operations cannot be authorised.`,
|
|
1227
|
+
nextActions: [{
|
|
1228
|
+
kind: "user-choice",
|
|
1229
|
+
label: "Name the database in `db.connection` (or pass `--db <url>`) and run `prisma-next db update` again."
|
|
1230
|
+
}]
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
/** A prompt that names nothing cannot be consented to knowingly. */
|
|
1234
|
+
function errorConsentOperationsMissing() {
|
|
1235
|
+
return new CliStructuredError$1("CLI.CONSENT_OPERATIONS_MISSING", "The plan was refused as destructive but named no operations to confirm.", {
|
|
1236
|
+
why: "The consent prompt has to list what is about to be destroyed, and the refusal carried no operations to list.",
|
|
1237
|
+
nextActions: [{
|
|
1238
|
+
kind: "run-command",
|
|
1239
|
+
label: "Preview the plan",
|
|
1240
|
+
command: "prisma-next db update --dry-run"
|
|
1241
|
+
}]
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
/** The question the user answers before anything is dropped. */
|
|
1245
|
+
function destructiveConsentQuestion(operations, token) {
|
|
1246
|
+
const listed = operations.map((operation) => ` - ${operation.label}`).join("\n");
|
|
1247
|
+
return [`Apply ${operations.length} destructive operation(s) to ${token}? Data they remove cannot be recovered:`, listed].join("\n");
|
|
1248
|
+
}
|
|
1249
|
+
function updatePresentations(inputs) {
|
|
1250
|
+
const { document, database, dryRun } = inputs;
|
|
1251
|
+
return {
|
|
1252
|
+
human: () => [{
|
|
1253
|
+
kind: "fields",
|
|
1254
|
+
rail: true,
|
|
1255
|
+
rows: [
|
|
1256
|
+
{
|
|
1257
|
+
label: "contract",
|
|
1258
|
+
value: inputs.contractPath
|
|
1259
|
+
},
|
|
1260
|
+
...database === void 0 ? [] : [{
|
|
1261
|
+
label: "database",
|
|
1262
|
+
value: database
|
|
1263
|
+
}],
|
|
1264
|
+
...inputs.to === void 0 ? [] : [{
|
|
1265
|
+
label: "to",
|
|
1266
|
+
value: inputs.to
|
|
1267
|
+
}],
|
|
1268
|
+
...dryRun ? [{
|
|
1269
|
+
label: "mode",
|
|
1270
|
+
value: "dry run"
|
|
1271
|
+
}] : []
|
|
1272
|
+
]
|
|
1273
|
+
}, ...migrationResultBlocks(document)],
|
|
1274
|
+
json: () => document,
|
|
1275
|
+
next: () => migrationResultNextActions(document, "prisma-next db update")
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
function updateDocument(inputs) {
|
|
1279
|
+
const { value } = inputs;
|
|
1280
|
+
return {
|
|
1281
|
+
ok: true,
|
|
1282
|
+
mode: value.mode,
|
|
1283
|
+
plan: {
|
|
1284
|
+
targetId: inputs.targetId,
|
|
1285
|
+
destination: {
|
|
1286
|
+
storageHash: value.destination.storageHash,
|
|
1287
|
+
...ifDefined("profileHash", value.destination.profileHash)
|
|
1288
|
+
},
|
|
1289
|
+
operations: value.plan.operations.map((operation) => ({
|
|
1290
|
+
id: operation.id,
|
|
1291
|
+
label: operation.label,
|
|
1292
|
+
operationClass: operation.operationClass
|
|
1293
|
+
})),
|
|
1294
|
+
...ifDefined("preview", value.plan.preview)
|
|
1295
|
+
},
|
|
1296
|
+
...value.execution === void 0 ? {} : { execution: {
|
|
1297
|
+
operationsPlanned: value.execution.operationsPlanned,
|
|
1298
|
+
operationsExecuted: value.execution.operationsExecuted
|
|
1299
|
+
} },
|
|
1300
|
+
...value.marker === void 0 ? {} : { marker: {
|
|
1301
|
+
storageHash: value.marker.storageHash,
|
|
1302
|
+
...ifDefined("profileHash", value.marker.profileHash)
|
|
1303
|
+
} },
|
|
1304
|
+
...ifDefined("perSpace", value.perSpace),
|
|
1305
|
+
...ifDefined("warnings", value.warnings),
|
|
1306
|
+
advancedRef: inputs.advancedRef,
|
|
1307
|
+
plannedAdvanceRef: inputs.plannedAdvanceRef,
|
|
1308
|
+
summary: value.summary,
|
|
1309
|
+
timings: { total: Date.now() - inputs.startedAt }
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
function createDbUpdateCommand(createClient) {
|
|
1313
|
+
return defineOrmCommand({
|
|
1314
|
+
help: {
|
|
1315
|
+
summary: "Update your database schema to match your contract",
|
|
1316
|
+
description: "Compares the database to the emitted contract and applies the changes that\nclose the gap, whether or not the database was bootstrapped with `db init`.\nAn operation that would destroy data is applied only with your consent: the\ncommand asks you to type the database name. A run with nobody to ask — a CI\njob, or `--no-interactive` — takes it from `--confirm <database>` instead.\nUse --dry-run to see the operations without applying them.",
|
|
1317
|
+
examples: [
|
|
1318
|
+
"db update",
|
|
1319
|
+
"db update --dry-run",
|
|
1320
|
+
"db update --no-interactive --confirm appdb",
|
|
1321
|
+
"db update --to production"
|
|
1322
|
+
]
|
|
1323
|
+
},
|
|
1324
|
+
args: { flags: {
|
|
1325
|
+
db: dbFlag,
|
|
1326
|
+
dryRun: flag.boolean({ brief: "Preview the planned operations without applying them" }),
|
|
1327
|
+
to: flag.string({
|
|
1328
|
+
brief: "Contract to update to (hash, prefix, ref name, migration dir name, or ./path)",
|
|
1329
|
+
placeholder: "contract"
|
|
1330
|
+
}),
|
|
1331
|
+
advanceRef: flag.string({
|
|
1332
|
+
brief: "Advance the named ref to the post-command contract hash",
|
|
1333
|
+
placeholder: "name"
|
|
1334
|
+
})
|
|
1335
|
+
} },
|
|
1336
|
+
needs: { config: ormConfigSection },
|
|
1337
|
+
handler: async (args, ctx) => {
|
|
1338
|
+
const startedAt = Date.now();
|
|
1339
|
+
const prepared = await prepareMigrationRun({
|
|
1340
|
+
config: ctx.config,
|
|
1341
|
+
cwd: ctx.cwd,
|
|
1342
|
+
db: args.flags.db,
|
|
1343
|
+
commandName: "db update",
|
|
1344
|
+
createClient
|
|
1345
|
+
});
|
|
1346
|
+
if (!prepared.ok) return notOk(prepared.failure);
|
|
1347
|
+
const { client, contractPath, dbConnection, migrationsDir, refsDir } = prepared.value;
|
|
1348
|
+
let contractJson = prepared.value.contractJson;
|
|
1349
|
+
let snapshotContractPath = contractPath;
|
|
1350
|
+
if (args.flags.to !== void 0) {
|
|
1351
|
+
const resolved = await resolveContractRefToSnapshot({
|
|
1352
|
+
config: ctx.config,
|
|
1353
|
+
migrationsDir,
|
|
1354
|
+
refInput: args.flags.to,
|
|
1355
|
+
contractPathAbsolute: contractPath,
|
|
1356
|
+
fallbackToEmitted: false,
|
|
1357
|
+
missingBundleFlag: "--to"
|
|
1358
|
+
});
|
|
1359
|
+
if (!resolved.ok) return notOk(normalizeError(resolved.failure));
|
|
1360
|
+
contractJson = resolved.value.contractJson;
|
|
1361
|
+
snapshotContractPath = resolved.value.contractJsonPath;
|
|
1362
|
+
}
|
|
1363
|
+
const mode = args.flags.dryRun ? "plan" : "apply";
|
|
1364
|
+
let document;
|
|
1365
|
+
try {
|
|
1366
|
+
await client.connect(dbConnection);
|
|
1367
|
+
const update = (consent) => client.dbUpdate({
|
|
1368
|
+
contract: contractJson,
|
|
1369
|
+
mode,
|
|
1370
|
+
migrationsDir,
|
|
1371
|
+
...consent === void 0 ? {} : { consent },
|
|
1372
|
+
onProgress: controlProgressReporter(ctx.report)
|
|
1373
|
+
});
|
|
1374
|
+
const reported = /* @__PURE__ */ new Set();
|
|
1375
|
+
const reportPlannerWarnings = (warnings) => {
|
|
1376
|
+
for (const warning of warnings) if (!reported.has(warning.summary)) {
|
|
1377
|
+
reported.add(warning.summary);
|
|
1378
|
+
ctx.report({
|
|
1379
|
+
kind: "message",
|
|
1380
|
+
severity: "warn",
|
|
1381
|
+
text: warning.summary
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
let result = await update();
|
|
1386
|
+
if (mode === "apply" && !result.ok && result.failure.code === "DESTRUCTIVE_CHANGES") {
|
|
1387
|
+
reportPlannerWarnings(result.failure.warnings ?? []);
|
|
1388
|
+
const refusal = result.failure.destructiveChanges;
|
|
1389
|
+
if (refusal === void 0 || refusal.destructiveOperations.length === 0) return notOk(normalizeError(errorConsentOperationsMissing()));
|
|
1390
|
+
const token = refusal.databaseName ?? "";
|
|
1391
|
+
if (token.trim().length === 0) return notOk(normalizeError(errorConsentTokenUnresolved(ctx.config.target.targetId)));
|
|
1392
|
+
if (!await ctx.prompt.consent(destructiveConsentQuestion(refusal.destructiveOperations, token), { token })) return notOk(normalizeError(mapDbUpdateFailure(result.failure)));
|
|
1393
|
+
result = await update({ planHash: refusal.planHash });
|
|
1394
|
+
}
|
|
1395
|
+
if (!result.ok) {
|
|
1396
|
+
reportPlannerWarnings(result.failure.warnings ?? []);
|
|
1397
|
+
return notOk(normalizeError(mapDbUpdateFailure(result.failure)));
|
|
1398
|
+
}
|
|
1399
|
+
const advancementHash = result.value.mode === "apply" ? result.value.marker?.storageHash ?? result.value.destination.storageHash : result.value.destination.storageHash;
|
|
1400
|
+
const advancement = await resolveRefAdvancementFields({
|
|
1401
|
+
...ifDefined("advanceRef", args.flags.advanceRef),
|
|
1402
|
+
...ifDefined("db", args.flags.db),
|
|
1403
|
+
refsDir,
|
|
1404
|
+
migrationsDir,
|
|
1405
|
+
contractJson,
|
|
1406
|
+
contractJsonPath: snapshotContractPath,
|
|
1407
|
+
mode: result.value.mode,
|
|
1408
|
+
hash: advancementHash
|
|
1409
|
+
});
|
|
1410
|
+
if (!advancement.ok) return notOk(normalizeError(advancement.failure));
|
|
1411
|
+
document = updateDocument({
|
|
1412
|
+
value: result.value,
|
|
1413
|
+
targetId: ctx.config.target.targetId,
|
|
1414
|
+
advancedRef: advancement.value.advancedRef,
|
|
1415
|
+
plannedAdvanceRef: advancement.value.plannedAdvanceRef,
|
|
1416
|
+
startedAt
|
|
1417
|
+
});
|
|
1418
|
+
} catch (error) {
|
|
1419
|
+
if (error instanceof CliStructuredError$1) throw error;
|
|
1420
|
+
if (CliStructuredError$1$1.is(error)) return notOk(normalizeError(error));
|
|
1421
|
+
if (isStructuredError(error) && error.code === "CONTRACT.VALIDATION_FAILED") return notOk(normalizeError(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPath } })));
|
|
1422
|
+
const safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === "string" ? dbConnection : void 0);
|
|
1423
|
+
return notOk(normalizeError(errorUnexpected(safeMessage, { why: `Unexpected error during db update: ${safeMessage}` })));
|
|
1424
|
+
} finally {
|
|
1425
|
+
await closeQuietly(client);
|
|
1426
|
+
}
|
|
1427
|
+
ctx.report({
|
|
1428
|
+
kind: "message",
|
|
1429
|
+
severity: "verbose",
|
|
1430
|
+
text: `Total time: ${document.timings.total}ms`
|
|
1431
|
+
});
|
|
1432
|
+
return ok(ctx.present({ data: document }, updatePresentations({
|
|
1433
|
+
document,
|
|
1434
|
+
contractPath: prepared.value.contractDisplayPath,
|
|
1435
|
+
database: prepared.value.database,
|
|
1436
|
+
to: args.flags.to,
|
|
1437
|
+
dryRun: args.flags.dryRun
|
|
1438
|
+
})));
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
const dbUpdateCommand = createDbUpdateCommand(createControlClient);
|
|
1160
1443
|
const NOTHING_TO_FORMAT = "Nothing to format (contract source is not PSL).";
|
|
1161
1444
|
function formatPresentations(document, cwd) {
|
|
1162
1445
|
const path = document.path;
|
|
@@ -2224,6 +2507,7 @@ const ormCommandFamily = defineCommandFamily({
|
|
|
2224
2507
|
"contract infer": contractInferCommand,
|
|
2225
2508
|
"db init": dbInitCommand,
|
|
2226
2509
|
"db schema": dbSchemaCommand,
|
|
2510
|
+
"db update": dbUpdateCommand,
|
|
2227
2511
|
format: formatCommand,
|
|
2228
2512
|
migrate: migrateCommand,
|
|
2229
2513
|
"migration graph": migrationGraphCommand,
|