@prisma/orm-toolchain 8.0.0-rc.11-dev.39 → 8.0.0-rc.11-dev.40
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.mjs +72 -23
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +49 -0
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +1 -1
- package/dist/{ref-DlKsxbtg-B55l0TCq.mjs → ref-CGE8q4jD-DNPh6Yqe.mjs} +129 -20
- package/dist/ref-CGE8q4jD-DNPh6Yqe.mjs.map +1 -0
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/ref-DlKsxbtg-B55l0TCq.mjs.map +0 -1
|
@@ -704,6 +704,25 @@ interface MigrationPlanOptions {
|
|
|
704
704
|
readonly to?: string;
|
|
705
705
|
/** Renders the declarations of the destination snapshot from its `contract.json`. */
|
|
706
706
|
readonly client: Pick<ControlClient, 'renderContractDts'>;
|
|
707
|
+
/**
|
|
708
|
+
* Consent to the auto-baseline plan a prior `MIGRATION.DESTRUCTIVE_CHANGES`
|
|
709
|
+
* refusal named by its `planHash`. The consented run recomputes the baseline
|
|
710
|
+
* plan and refuses with `MIGRATION.CONSENT_PLAN_MISMATCH` when it differs.
|
|
711
|
+
*/
|
|
712
|
+
readonly consent?: {
|
|
713
|
+
readonly planHash: string;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Extension-space migration packages a refused first run of this same
|
|
717
|
+
* invocation already materialised. The consented re-run finds them on disk
|
|
718
|
+
* (its seed phase reports `unchanged`), so the caller threads them back in
|
|
719
|
+
* to keep `emittedExtensionDirs` and the summary describing the whole
|
|
720
|
+
* invocation, not just the second run.
|
|
721
|
+
*/
|
|
722
|
+
readonly carryEmittedExtensionDirs?: readonly {
|
|
723
|
+
readonly spaceId: string;
|
|
724
|
+
readonly dirName: string;
|
|
725
|
+
}[];
|
|
707
726
|
}
|
|
708
727
|
interface MigrationPlanResult {
|
|
709
728
|
readonly ok: boolean;
|
|
@@ -733,6 +752,18 @@ interface MigrationPlanResult {
|
|
|
733
752
|
readonly label: string;
|
|
734
753
|
readonly operationClass: string;
|
|
735
754
|
}[];
|
|
755
|
+
/**
|
|
756
|
+
* Operations of the auto-baseline package when this run wrote two packages
|
|
757
|
+
* (`baselineDir` + `dir`). Kept separate from `operations` (the app-space
|
|
758
|
+
* delta) so consumers keep reading `operations` as "the change", while
|
|
759
|
+
* renderers and the destructive warn-summary still cover everything the
|
|
760
|
+
* run wrote.
|
|
761
|
+
*/
|
|
762
|
+
readonly baselineOperations?: readonly {
|
|
763
|
+
readonly id: string;
|
|
764
|
+
readonly label: string;
|
|
765
|
+
readonly operationClass: string;
|
|
766
|
+
}[];
|
|
736
767
|
/**
|
|
737
768
|
* Family-agnostic textual preview of the migration plan operations.
|
|
738
769
|
* Replaces the previous `sql?: readonly string[]` field; consumers should
|
|
@@ -740,6 +771,12 @@ interface MigrationPlanResult {
|
|
|
740
771
|
*/
|
|
741
772
|
readonly preview?: OperationPreview;
|
|
742
773
|
readonly summary: string;
|
|
774
|
+
/**
|
|
775
|
+
* Origin-resolution caveats the user must see, e.g. the default `db` ref
|
|
776
|
+
* sitting behind the graph tip. Rendered as warn summaries by the human
|
|
777
|
+
* presentation and carried verbatim for JSON consumers.
|
|
778
|
+
*/
|
|
779
|
+
readonly warnings?: readonly string[];
|
|
743
780
|
/**
|
|
744
781
|
* When true, `migration.ts` was written but contains unfilled
|
|
745
782
|
* `placeholder(...)` calls. The user must edit the file and then run
|
|
@@ -794,6 +831,16 @@ declare function appliedHashesFromLedger(ledgerEntries: ReadonlyArray<{
|
|
|
794
831
|
declare function statusForMigrationHash(migrationHash: string, annotations: ReadonlyMap<string, MigrationEdgeAnnotation>): 'applied' | 'pending' | null;
|
|
795
832
|
//#endregion
|
|
796
833
|
//#region src/control-api/operations/plan-resolution.d.ts
|
|
834
|
+
/**
|
|
835
|
+
* Set when the origin was derived from the `db` ref by default (no `--from`)
|
|
836
|
+
* and that ref sits on an in-graph node that is not the graph tip. Planning
|
|
837
|
+
* from it forks the graph, so the caller must surface it to the user.
|
|
838
|
+
*/
|
|
839
|
+
interface DefaultOriginBehindTip {
|
|
840
|
+
readonly refName: string;
|
|
841
|
+
readonly refHash: string;
|
|
842
|
+
readonly tipHash: string;
|
|
843
|
+
}
|
|
797
844
|
type FromResolution = {
|
|
798
845
|
kind: 'greenfield';
|
|
799
846
|
fromHash: null;
|
|
@@ -803,10 +850,12 @@ type FromResolution = {
|
|
|
803
850
|
kind: 'graph-node';
|
|
804
851
|
fromHash: string;
|
|
805
852
|
fromContract: Contract;
|
|
853
|
+
defaultOriginBehindTip?: DefaultOriginBehindTip;
|
|
806
854
|
} | {
|
|
807
855
|
kind: 'ref';
|
|
808
856
|
fromHash: string;
|
|
809
857
|
fromContract: Contract;
|
|
858
|
+
defaultOriginBehindTip?: DefaultOriginBehindTip;
|
|
810
859
|
} | {
|
|
811
860
|
kind: 'auto-baseline';
|
|
812
861
|
fromHash: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli__control-api.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB,oBAAoB,SAAS,uBAAuB;;;;;;iBAMpD,eAAe,IAAI,UAAU,YAAY,cAAc,kDAAkD;;;;iBAIzG,wBAAwB,iBAAiB;;;iBAGzC,mBAAmB,gBAAgB;WACzC;IACP,cAAc;;;KAGb;WACM,aAAa;;;;;;;;;;;;;;;;;;;;;;iBAsBP,oBAAoB,SAAS,qBAAqB,eAAe,2BAA2B,QAAQ;;;UAG3G;WACC,QAAQ;WACR;;WAEA;;WAEA;;;;;;;;;;KAUN,sCAAsC;WAChC;WACA;;WAEA;WACA;;UAED;WACC;WACA,cAAc;;WAEd;WACA;;iBAEM,6BAA6B,SAAS,sCAAsC,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kCAAkC,+BAA+B;cACxD,0EAA0E;EACtF;EACA;IACE;IACA;IACA;IACA;IACA;MACE;MACA;MACA;MACA;MACA;;;EAGJ;;KAEG,8BAA8B,2BAA2B;;;;;;;;;;UAUpD;WACC;WACA,mBAAmB;WACnB,MAAM;WACN,OAAO;WACP;WACA;;WAEA;;WAEA;;;;;;;;;;iBAUM,qBAAqB,WAAW,wBAAwB,8BAA8B,cAAc,iBAAiB;;;;;;;UAO5H;WACC,iBAAiB;WACjB;;;;;;;;;;;;;;iBAcM,kBAAkB,QAAQ,0BAA0B,QAAQ,OAAO,sBAAsB;iBACzF,iCAAiC,QAAQ,oBAAkB,wBAAwB,iBAAiB;UAC3G;WACC,SAAS;WACT,QAAQ;WACR;WACA;;UAED;WACC,iBAAiB;WACjB;WACA;WACA;;WAEA;;;;;;;;;;;;;;;;;iBAiBM,kBAAkB,gBAAgB,QAAQ,qBAAqB,QAAQ;;;;;;;;iBAQvE,gCAAgC;WACtC,WAAW;WACX,uBAAuB;aACrB;;;;;;;;;;;iBAWI,uBAAuB,OAAO,yBAAyB;;;;;;;;;iBASvD,uCAAuC,WAAW,wBAAwB,+BAA+B,iBAAiB;;;;;;;;;UASjI;WACC,iBAAiB;WACjB;;;;;;;;;;;iBAWM,iBAAiB,QAAQ,yBAAyB,OAAO,qBAAqB;;;UAGrF;WACC,QAAQ;;WAER;;WAEA;WACA;WACA;;WAEA,QAAQ,KAAK;;UAEd;WACC;WACA;WACA;WACA;WACA;;iBAEM,2BAA2B,SAAS,sBAAsB,QAAQ,OAAO,oBAAoB;;;UAGpG;WACC,QAAQ;;WAER;;WAEA;WACA;WACA;WACA;;WAEA,QAAQ,KAAK
|
|
1
|
+
{"version":3,"file":"cli__control-api.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB,oBAAoB,SAAS,uBAAuB;;;;;;iBAMpD,eAAe,IAAI,UAAU,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wB,cAAc,SAAS,sBAAsB,QAAQ,OAAO,iBAAiB;iBACrG,sBAAsB,SAAS,sBAAsB,QAAQ,OAAO,eAAe;;;;UAI1F;WACC;WACA;;UAED;WACC;aACE;aACA;;WAEF;aACE;aACA;;;cAGC,oBAAoB;iBACjB,0BAA0B;WAChC;WACA;;;;;;;;;;iBAUM,wBAAwB;WAC9B;WACA,cAAc;WACd;WACA;WACA,QAAQ,KAAK;IACpB,QAAQ,OAAO,YAAY;iBACd,sBAAsB,iBAAiB,uBAAuB,cAAc,cAAc,YAAY,aAAa;EAClI;EACA;;;;;;;iBAOe,0BAA0B;WAChC;WACA;WACA;WACA,YAAY;WACZ;WACA;IACP,QAAQ,OAAO,sBAAsB;;;;;iBAKxB,iBAAiB;WACvB;WACA;WACA;WACA;WACA,YAAY;IACnB,QAAQ;WACD;WACA;GACR;;;UAGO;WACC,OAAO;WACP,MAAM;WACN;;iBAEM,mBAAmB,eAAe,SAAS,uBAAuB,OAAO,aAAa;iBACtF,oBAAoB,eAAe;WACzC,OAAO;WACP,MAAM;IACb,OAAO,cAAc;;;;iBAIR,kBAAkB,kBAAkB,QAAQ,OAAO,MAAM;;;iBAGzD,iBAAiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as hasMigrationPath, At as runMigrationList, Ct as resolveContractRefToSnapshot, Et as resolveToForPlan, G as executeMigrateShowPlan, H as executeDbInit, J as executeRefAdvancement, K as executeMigrationNewCommand, Mt as statusForMigrationHash, Ot as runContractSpaceSeedPhase, St as resolveContractRef$1, Tt as resolveMigrationRef, U as executeDbUpdate, V as executeContractEmit, W as executeDbVerify, X as executeRefListCommand, Y as executeRefDeleteCommand, Z as executeRefSetCommand, _ as disposeEmitQueue, _t as refuseMissingInvariantPath, a as appContractStandInFromIdentity, at as mapCaughtMigrationError, c as buildMigrationSpaceGraphEntries, d as checkSingleTarget, dt as preflightRefAdvancement, et as listRefsByContractHash, g as deriveStatusEdgeAnnotations, gt as refuseMarkerOutsideGraph, h as createControlClient, ht as refuseDeclaredExtensionTargetMismatch, i as advanceRefSafely, kt as runMigrationCheck, l as buildReadAggregate, lt as migrationSpaceListEntriesFromAggregate, m as computeRefAdvancementName, mt as refuseContractSpaceIntegrity, nt as loadContractRawSafely, o as appliedHashesFromLedger, ot as mapContractAtError, pt as readMigrationRefs, q as executeMigrationPlanCommand, r as NO_REF_ADVANCEMENT, rt as loadContractSpaceAggregateForCli, s as buildContractSpaceAggregate, st as mapIntegrityViolations, tt as loadAggregateIntegrityViolations, u as buildRefAdvancementFields, ut as originHashForStatus, v as enrichContract, vt as refusePackageCorruptionOnAggregate, wt as resolveFromForPlan, y as enumerateCheckSpaces, yt as refuseUnknownInvariants } from "./ref-CGE8q4jD-DNPh6Yqe.mjs";
|
|
2
2
|
export { NO_REF_ADVANCEMENT, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus, preflightRefAdvancement, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef$1 as resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
|
|
@@ -25,7 +25,7 @@ import { CliStructuredError, CliStructuredError as CliStructuredError$1, errorCo
|
|
|
25
25
|
import { APP_SPACE_ID, createControlStack, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView } from "@prisma/orm-framework/components/control";
|
|
26
26
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
27
27
|
import { mergeCapabilityMatrices } from "@prisma/orm-framework/components/components";
|
|
28
|
-
import { errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
|
|
28
|
+
import { ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorRunnerFailed, errorRuntime, errorTargetMismatch } from "@prisma/orm-framework/errors/execution";
|
|
29
29
|
import "@prisma/orm-framework/errors/migration";
|
|
30
30
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "pathe";
|
|
31
31
|
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
@@ -33,7 +33,7 @@ import { createHash } from "node:crypto";
|
|
|
33
33
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
34
34
|
import { abortable } from "@prisma/orm-framework/utils/abortable";
|
|
35
35
|
import { resolve as resolve$1 } from "node:path";
|
|
36
|
-
//#region ../../../1-framework/3-tooling/cli/dist/ref-
|
|
36
|
+
//#region ../../../1-framework/3-tooling/cli/dist/ref-CGE8q4jD.mjs
|
|
37
37
|
/**
|
|
38
38
|
* The typed remediation the CLI attaches to its own errors and findings.
|
|
39
39
|
* Constructors live here rather than in any library the CLI calls: naming a
|
|
@@ -4078,14 +4078,26 @@ async function executeMigrationNewCommand(options) {
|
|
|
4078
4078
|
const packages = aggregate.app.packages;
|
|
4079
4079
|
const graph = aggregate.app.graph();
|
|
4080
4080
|
let fromHash = null;
|
|
4081
|
-
if (
|
|
4082
|
-
|
|
4083
|
-
|
|
4081
|
+
if (options.from !== void 0) {
|
|
4082
|
+
if (packages.length === 0) return notOk(errorRuntime("MIGRATION.HASH_NOT_IN_GRAPH", "--from has no meaning on an empty graph", {
|
|
4083
|
+
why: `--from "${options.from}" was passed, but ${appMigrationsRelative} contains no migrations, so there is no migration target hash it could name.`,
|
|
4084
|
+
fix: "Omit --from to scaffold the first migration (it records a baseline origin). `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one."
|
|
4085
|
+
}));
|
|
4086
|
+
const matchedHashes = [...new Set(packages.filter((p) => p.metadata.to.startsWith(options.from ?? "")).map((p) => p.metadata.to))].sort();
|
|
4087
|
+
if (matchedHashes.length === 0) return notOk(errorRuntime("MIGRATION.HASH_NOT_IN_GRAPH", "Starting contract not found", {
|
|
4084
4088
|
why: `No migration with to hash matching "${options.from}" exists in ${appMigrationsRelative}`,
|
|
4085
|
-
fix: "Check that the --from hash matches a known migration target hash."
|
|
4089
|
+
fix: "Check that the --from hash matches a known migration target hash. `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one."
|
|
4086
4090
|
}));
|
|
4087
|
-
|
|
4088
|
-
|
|
4091
|
+
if (matchedHashes.length > 1) return notOk(errorRuntime("MIGRATION.REF_AMBIGUOUS", `Ambiguous --from prefix: "${options.from}"`, {
|
|
4092
|
+
why: `"${options.from}" is a prefix of ${matchedHashes.length} migration target hashes in ${appMigrationsRelative}: ${matchedHashes.join(", ")}`,
|
|
4093
|
+
fix: "Provide a longer prefix or the full 64-hex target hash to disambiguate.",
|
|
4094
|
+
meta: {
|
|
4095
|
+
input: options.from,
|
|
4096
|
+
candidates: matchedHashes
|
|
4097
|
+
}
|
|
4098
|
+
}));
|
|
4099
|
+
fromHash = matchedHashes[0] ?? null;
|
|
4100
|
+
} else if (packages.length > 0) {
|
|
4089
4101
|
const latestMigration = findLatestMigration(graph);
|
|
4090
4102
|
if (latestMigration) fromHash = latestMigration.to;
|
|
4091
4103
|
}
|
|
@@ -4242,6 +4254,18 @@ function looksLikeFullHash(input) {
|
|
|
4242
4254
|
function graphIsEmpty(space) {
|
|
4243
4255
|
return space.packages.length === 0;
|
|
4244
4256
|
}
|
|
4257
|
+
/**
|
|
4258
|
+
* The graph tip, or `null` when the graph is empty or already forked —
|
|
4259
|
+
* a forked graph has no single tip to compare the default ref against.
|
|
4260
|
+
*/
|
|
4261
|
+
function findUnambiguousTip(graph) {
|
|
4262
|
+
try {
|
|
4263
|
+
return findLatestMigration(graph)?.to ?? null;
|
|
4264
|
+
} catch (error) {
|
|
4265
|
+
if (MigrationToolsError.is(error)) return null;
|
|
4266
|
+
throw error;
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4245
4269
|
function getReachableRefs(refs, graph) {
|
|
4246
4270
|
return Object.entries(refs).flatMap(([name, entry]) => entry && isGraphNode(entry.hash, graph) ? [{
|
|
4247
4271
|
name,
|
|
@@ -4321,13 +4345,27 @@ async function resolveFromForPlan(input) {
|
|
|
4321
4345
|
});
|
|
4322
4346
|
return notOk(errorPlanOriginUnknown(getReachableRefs(refs, graph), findLatestMigration(graph)?.to ?? null));
|
|
4323
4347
|
}
|
|
4324
|
-
|
|
4348
|
+
const resolved = await resolveFromPolicy({
|
|
4325
4349
|
hash: dbRef.hash,
|
|
4326
4350
|
provenance: {
|
|
4327
4351
|
kind: "ref",
|
|
4328
4352
|
refName: "db"
|
|
4329
4353
|
}
|
|
4330
4354
|
}, input, refs);
|
|
4355
|
+
if (!resolved.ok) return resolved;
|
|
4356
|
+
const value = resolved.value;
|
|
4357
|
+
if (value.kind === "ref" || value.kind === "graph-node") {
|
|
4358
|
+
const tipHash = findUnambiguousTip(graph);
|
|
4359
|
+
if (tipHash !== null && tipHash !== value.fromHash) return ok({
|
|
4360
|
+
...value,
|
|
4361
|
+
defaultOriginBehindTip: {
|
|
4362
|
+
refName: "db",
|
|
4363
|
+
refHash: value.fromHash,
|
|
4364
|
+
tipHash
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
}
|
|
4368
|
+
return resolved;
|
|
4331
4369
|
}
|
|
4332
4370
|
const refResult = parseContractRef(optionsFrom, {
|
|
4333
4371
|
graph,
|
|
@@ -4410,8 +4448,14 @@ async function runPlannerLeg(planner, migrations, frameworkComponents, contract,
|
|
|
4410
4448
|
summary: "Contract changed but planner produced no operations. This indicates unsupported or ignored changes."
|
|
4411
4449
|
}] }));
|
|
4412
4450
|
} catch (e) {
|
|
4413
|
-
if (CliStructuredError$1.is(e) && e.code === "MIGRATION.UNFILLED_PLACEHOLDER")
|
|
4414
|
-
|
|
4451
|
+
if (CliStructuredError$1.is(e) && e.code === "MIGRATION.UNFILLED_PLACEHOLDER") {
|
|
4452
|
+
hasPlaceholders = true;
|
|
4453
|
+
try {
|
|
4454
|
+
plannedOps = (await Promise.allSettled(plannerResult.plan.operations)).flatMap((entry) => entry.status === "fulfilled" ? [entry.value] : []);
|
|
4455
|
+
} catch {
|
|
4456
|
+
plannedOps = [];
|
|
4457
|
+
}
|
|
4458
|
+
} else throw e;
|
|
4415
4459
|
}
|
|
4416
4460
|
return ok({
|
|
4417
4461
|
plannedOps,
|
|
@@ -4433,6 +4477,48 @@ async function writePlannedMigrationPackage(packageDir, fromHash, toHash, create
|
|
|
4433
4477
|
}, opsForWrite);
|
|
4434
4478
|
await writeMigrationTs(packageDir, leg.migrationTsContent);
|
|
4435
4479
|
}
|
|
4480
|
+
/**
|
|
4481
|
+
* The consent check for an auto-baseline write, mirroring `db update`'s
|
|
4482
|
+
* destructive-changes refusal: a baseline leg carrying destructive operations
|
|
4483
|
+
* is only written when the caller consents to that exact plan by its hash.
|
|
4484
|
+
* Runs before the baseline and delta packages are written, so a refusal
|
|
4485
|
+
* leaves the app-space migrations directory untouched (the extension seed
|
|
4486
|
+
* phase runs earlier and unconditionally, as it does for no-op runs).
|
|
4487
|
+
* A leg with unfilled placeholders is still checked over the operations
|
|
4488
|
+
* that did resolve. Returns `null` when the write may proceed.
|
|
4489
|
+
*/
|
|
4490
|
+
function refuseUnconsentedDestructiveBaseline(leg, baselineToHash, consent) {
|
|
4491
|
+
const ops = leg.plannedOps;
|
|
4492
|
+
const destructiveOps = ops.filter((op) => op.operationClass === "destructive");
|
|
4493
|
+
if (destructiveOps.length === 0) return null;
|
|
4494
|
+
const planHash = computePlanHash({
|
|
4495
|
+
operations: ops.map((op) => ({
|
|
4496
|
+
id: op.id,
|
|
4497
|
+
label: op.label,
|
|
4498
|
+
operationClass: op.operationClass
|
|
4499
|
+
})),
|
|
4500
|
+
destination: { storageHash: baselineToHash }
|
|
4501
|
+
});
|
|
4502
|
+
if (consent === void 0) {
|
|
4503
|
+
const verdict = {
|
|
4504
|
+
destructiveOperations: destructiveOps.map((op) => ({
|
|
4505
|
+
id: op.id,
|
|
4506
|
+
label: op.label
|
|
4507
|
+
})),
|
|
4508
|
+
planHash
|
|
4509
|
+
};
|
|
4510
|
+
return errorDestructiveChanges(`The baseline migration contains ${destructiveOps.length} destructive operation(s) that require confirmation`, {
|
|
4511
|
+
why: "The migrations directory is empty, so planning writes a baseline derived from the `db` ref — and that baseline contains operations that would remove data when the migration is applied.",
|
|
4512
|
+
fix: "Re-run `prisma migration plan` and type the project directory name when asked, or pass `--no-interactive --confirm <directory>` where there is nobody to ask.",
|
|
4513
|
+
meta: { ...verdict }
|
|
4514
|
+
});
|
|
4515
|
+
}
|
|
4516
|
+
if (consent.planHash !== planHash) return errorConsentPlanMismatch({
|
|
4517
|
+
consentedPlanHash: consent.planHash,
|
|
4518
|
+
planHash
|
|
4519
|
+
});
|
|
4520
|
+
return null;
|
|
4521
|
+
}
|
|
4436
4522
|
async function executeMigrationPlanCommand(options, startTime, callbacks) {
|
|
4437
4523
|
try {
|
|
4438
4524
|
return await executeMigrationPlanCommandInner(options, startTime, callbacks);
|
|
@@ -4497,6 +4583,10 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4497
4583
|
space: resolutionSpace
|
|
4498
4584
|
});
|
|
4499
4585
|
if (!resolutionResult.ok) return notOk(resolutionResult.failure);
|
|
4586
|
+
const warnings = [];
|
|
4587
|
+
const warnBehindTip = (behind) => {
|
|
4588
|
+
warnings.push(`The default origin ref '${behind.refName}' points at ${behind.refHash}, which is not the latest migration (${behind.tipHash}). Planning from it forks the migration graph; pass --from to choose the origin explicitly.`);
|
|
4589
|
+
};
|
|
4500
4590
|
switch (resolutionResult.value.kind) {
|
|
4501
4591
|
case "greenfield":
|
|
4502
4592
|
fromDefaulted = resolutionResult.value.defaulted;
|
|
@@ -4504,11 +4594,13 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4504
4594
|
case "graph-node":
|
|
4505
4595
|
fromHash = resolutionResult.value.fromHash;
|
|
4506
4596
|
fromContract = resolutionResult.value.fromContract;
|
|
4597
|
+
if (resolutionResult.value.defaultOriginBehindTip !== void 0) warnBehindTip(resolutionResult.value.defaultOriginBehindTip);
|
|
4507
4598
|
break;
|
|
4508
4599
|
case "ref":
|
|
4509
4600
|
fromHash = resolutionResult.value.fromHash;
|
|
4510
4601
|
fromContract = resolutionResult.value.fromContract;
|
|
4511
4602
|
fromContractInStore = true;
|
|
4603
|
+
if (resolutionResult.value.defaultOriginBehindTip !== void 0) warnBehindTip(resolutionResult.value.defaultOriginBehindTip);
|
|
4512
4604
|
break;
|
|
4513
4605
|
case "auto-baseline":
|
|
4514
4606
|
fromHash = resolutionResult.value.fromHash;
|
|
@@ -4541,10 +4633,12 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4541
4633
|
extensions: toExtensionInputs(config.extensions ?? [])
|
|
4542
4634
|
});
|
|
4543
4635
|
for (const record of seedResult.seeded) callbacks?.onSeeded?.(record);
|
|
4544
|
-
const
|
|
4636
|
+
const seededThisRun = seedResult.seeded.flatMap((r) => r.newMigrationDirs.map((dirName) => ({
|
|
4545
4637
|
spaceId: r.spaceId,
|
|
4546
4638
|
dirName
|
|
4547
4639
|
})));
|
|
4640
|
+
const carried = options.carryEmittedExtensionDirs ?? [];
|
|
4641
|
+
const emittedExtensionDirs = [...carried, ...seededThisRun.filter((entry) => !carried.some((prior) => prior.spaceId === entry.spaceId && prior.dirName === entry.dirName))];
|
|
4548
4642
|
if (fromHash === toStorageHash && !isAutoBaseline) return ok({
|
|
4549
4643
|
ok: true,
|
|
4550
4644
|
noOp: true,
|
|
@@ -4552,6 +4646,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4552
4646
|
to: toStorageHash,
|
|
4553
4647
|
operations: [],
|
|
4554
4648
|
emittedExtensionDirs,
|
|
4649
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4555
4650
|
summary: "No changes detected between contracts",
|
|
4556
4651
|
timings: { total: Date.now() - startTime }
|
|
4557
4652
|
});
|
|
@@ -4589,6 +4684,8 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4589
4684
|
const deltaPackageDir = join(appMigrationsDir, deltaDirName);
|
|
4590
4685
|
const baselineLeg = await runPlannerLeg(planner, migrations, frameworkComponents, fromContract, null, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(baselinePackageDir, migrationsDir), resolveImportSpecifier);
|
|
4591
4686
|
if (!baselineLeg.ok) return notOk(baselineLeg.failure);
|
|
4687
|
+
const consentFailure = refuseUnconsentedDestructiveBaseline(baselineLeg.value, fromHash, options.consent);
|
|
4688
|
+
if (consentFailure !== null) return notOk(consentFailure);
|
|
4592
4689
|
await writePlannedMigrationPackage(baselinePackageDir, null, fromHash, baselineTimestamp, baselineLeg.value);
|
|
4593
4690
|
if (fromHash === toStorageHash) {
|
|
4594
4691
|
const baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;
|
|
@@ -4603,6 +4700,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4603
4700
|
baselineDir,
|
|
4604
4701
|
operations: [],
|
|
4605
4702
|
emittedExtensionDirs,
|
|
4703
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4606
4704
|
pendingPlaceholders: true,
|
|
4607
4705
|
summary: "Planned baseline with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
4608
4706
|
timings: { total: Date.now() - startTime }
|
|
@@ -4622,7 +4720,8 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4622
4720
|
})),
|
|
4623
4721
|
emittedExtensionDirs,
|
|
4624
4722
|
...preview !== void 0 ? { preview } : {},
|
|
4625
|
-
|
|
4723
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4724
|
+
summary: buildAutoBaselinePlanSummary(baselineOps.length, 0, emittedExtensionDirs.length),
|
|
4626
4725
|
timings: { total: Date.now() - startTime }
|
|
4627
4726
|
});
|
|
4628
4727
|
}
|
|
@@ -4630,8 +4729,9 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4630
4729
|
if (!deltaLeg.ok) return notOk(deltaLeg.failure);
|
|
4631
4730
|
await writePlannedMigrationPackage(deltaPackageDir, fromHash, toStorageHash, deltaTimestamp, deltaLeg.value);
|
|
4632
4731
|
await writeDestinationSnapshot(toStorageHash);
|
|
4732
|
+
const baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;
|
|
4633
4733
|
const deltaOps = deltaLeg.value.hasPlaceholders ? [] : deltaLeg.value.plannedOps;
|
|
4634
|
-
if (deltaLeg.value.hasPlaceholders) return ok({
|
|
4734
|
+
if (baselineLeg.value.hasPlaceholders || deltaLeg.value.hasPlaceholders) return ok({
|
|
4635
4735
|
ok: true,
|
|
4636
4736
|
noOp: false,
|
|
4637
4737
|
from: fromHash,
|
|
@@ -4640,11 +4740,12 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4640
4740
|
baselineDir: relative(cwd, baselinePackageDir),
|
|
4641
4741
|
operations: [],
|
|
4642
4742
|
emittedExtensionDirs,
|
|
4743
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4643
4744
|
pendingPlaceholders: true,
|
|
4644
4745
|
summary: "Planned baseline + migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
4645
4746
|
timings: { total: Date.now() - startTime }
|
|
4646
4747
|
});
|
|
4647
|
-
const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(deltaOps) : void 0;
|
|
4748
|
+
const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview([...baselineOps, ...deltaOps]) : void 0;
|
|
4648
4749
|
return ok({
|
|
4649
4750
|
ok: true,
|
|
4650
4751
|
noOp: false,
|
|
@@ -4657,9 +4758,15 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4657
4758
|
label: op.label,
|
|
4658
4759
|
operationClass: op.operationClass
|
|
4659
4760
|
})),
|
|
4761
|
+
baselineOperations: baselineOps.map((op) => ({
|
|
4762
|
+
id: op.id,
|
|
4763
|
+
label: op.label,
|
|
4764
|
+
operationClass: op.operationClass
|
|
4765
|
+
})),
|
|
4660
4766
|
emittedExtensionDirs,
|
|
4661
4767
|
...preview !== void 0 ? { preview } : {},
|
|
4662
|
-
|
|
4768
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4769
|
+
summary: buildAutoBaselinePlanSummary(baselineOps.length, deltaOps.length, emittedExtensionDirs.length),
|
|
4663
4770
|
timings: { total: Date.now() - startTime }
|
|
4664
4771
|
});
|
|
4665
4772
|
}
|
|
@@ -4677,6 +4784,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4677
4784
|
dir: relative(cwd, packageDir),
|
|
4678
4785
|
operations: [],
|
|
4679
4786
|
emittedExtensionDirs,
|
|
4787
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4680
4788
|
pendingPlaceholders: true,
|
|
4681
4789
|
...fromDefaulted ? { fromDefaulted } : {},
|
|
4682
4790
|
summary: "Planned migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
@@ -4698,6 +4806,7 @@ async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
|
4698
4806
|
emittedExtensionDirs,
|
|
4699
4807
|
...preview !== void 0 ? { preview } : {},
|
|
4700
4808
|
...fromDefaulted ? { fromDefaulted } : {},
|
|
4809
|
+
...warnings.length > 0 ? { warnings } : {},
|
|
4701
4810
|
summary: buildPlanSummary(plannedOps.length, emittedExtensionDirs.length),
|
|
4702
4811
|
timings: { total: Date.now() - startTime }
|
|
4703
4812
|
});
|
|
@@ -4727,8 +4836,8 @@ function buildPlanSummary(plannedOpsCount, emittedExtensionDirsCount) {
|
|
|
4727
4836
|
if (emittedExtensionDirsCount === 0) return base;
|
|
4728
4837
|
return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
|
|
4729
4838
|
}
|
|
4730
|
-
function buildAutoBaselinePlanSummary(deltaOpsCount, emittedExtensionDirsCount) {
|
|
4731
|
-
const base = `Planned baseline + ${deltaOpsCount} operation(s)`;
|
|
4839
|
+
function buildAutoBaselinePlanSummary(baselineOpsCount, deltaOpsCount, emittedExtensionDirsCount) {
|
|
4840
|
+
const base = `Planned baseline (${baselineOpsCount} operation(s)) + ${deltaOpsCount} operation(s)`;
|
|
4732
4841
|
if (emittedExtensionDirsCount === 0) return base;
|
|
4733
4842
|
return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
|
|
4734
4843
|
}
|
|
@@ -4857,6 +4966,6 @@ async function executeRefListCommand(options) {
|
|
|
4857
4966
|
}
|
|
4858
4967
|
}
|
|
4859
4968
|
//#endregion
|
|
4860
|
-
export {
|
|
4969
|
+
export { hasMigrationPath as $, errorLegendHumanOnly as A, runMigrationList as At, errorUnexpected as B, errorContractArgConflict as C, resolveContractRefToSnapshot as Ct, errorDriverRequired as D, runCommandAction as Dt, errorDestructiveChanges as E, resolveToForPlan as Et, errorPathUnreachable as F, executeMigrateShowPlan as G, executeDbInit as H, errorRunnerFailed as I, executeRefAdvancement as J, executeMigrationNewCommand as K, errorRuntime as L, errorMigrationPackageNotFound as M, statusForMigrationHash as Mt, errorMigrationPlanningFailed as N, targetSupportsMigrations as Nt, errorFileNotFound as O, runContractSpaceSeedPhase as Ot, errorNoMigrations as P, toDeclaredExtensionsFromRaw as Pt, findPackageByDirPath as Q, errorTargetMigrationNotSupported as R, errorConsentPlanMismatch as S, resolveContractRef$1 as St, errorDatabaseConnectionRequired as T, resolveMigrationRef as Tt, executeDbUpdate as U, executeContractEmit as V, executeDbVerify as W, executeRefListCommand as X, executeRefDeleteCommand as Y, executeRefSetCommand as Z, disposeEmitQueue as _, refuseMissingInvariantPath as _t, appContractStandInFromIdentity as a, mapCaughtMigrationError as at, errorAdvanceRefArgConflict as b, requireLiveDatabase as bt, buildMigrationSpaceGraphEntries as c, maskConnectionUrl as ct, checkSingleTarget as d, preflightRefAdvancement as dt, listRefsByContractHash as et, chooseAction as f, readContractEnvelope as ft, deriveStatusEdgeAnnotations as g, refuseMarkerOutsideGraph as gt, createControlClient as h, refuseDeclaredExtensionTargetMismatch as ht, advanceRefSafely as i, looksLikePath as it, errorMarkerMissing as j, sanitizeErrorMessage as jt, errorHashMismatch as k, runMigrationCheck as kt, buildReadAggregate as l, migrationSpaceListEntriesFromAggregate as lt, computeRefAdvancementName as m, refuseContractSpaceIntegrity as mt, ERROR_CODE_DESTRUCTIVE_CHANGES as n, loadContractRawSafely as nt, appliedHashesFromLedger as o, mapContractAtError as ot, closeQuietly as p, readMigrationRefs as pt, executeMigrationPlanCommand as q, NO_REF_ADVANCEMENT as r, loadContractSpaceAggregateForCli as rt, buildContractSpaceAggregate as s, mapIntegrityViolations as st, CliStructuredError$1 as t, loadAggregateIntegrityViolations as tt, buildRefAdvancementFields as u, originHashForStatus as ut, enrichContract as v, refusePackageCorruptionOnAggregate as vt, errorContractValidationFailed as w, resolveFromForPlan as wt, errorConfigValidation$1 as x, resolveAppTargetPath as xt, enumerateCheckSpaces as y, refuseUnknownInvariants as yt, errorTargetMismatch as z };
|
|
4861
4970
|
|
|
4862
|
-
//# sourceMappingURL=ref-
|
|
4971
|
+
//# sourceMappingURL=ref-CGE8q4jD-DNPh6Yqe.mjs.map
|