@vibeorm/migrate 2.3.0 → 2.4.0

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Partial-index predicate equivalence (postgres).
3
+ *
4
+ * PostgreSQL stores an index predicate as a parsed expression and reports it
5
+ * back deparsed — `status = 'ACTIVE'` becomes `(status = 'ACTIVE'::text)`.
6
+ * The pure differ compares predicate TEXT (casts and literal bytes are
7
+ * semantic, so it cannot guess), which made every partial index with a
8
+ * literal re-plan as drop + create on every push, forever — the canonical
9
+ * soft-delete shape, and a unique invariant that silently disappears in the
10
+ * window between the drop and the create.
11
+ *
12
+ * Under the rollback probe the authored predicate is deparsed by the server
13
+ * itself, through the same `NOT VALID` CHECK probe CHECK constraints use (the
14
+ * predicate never builds an index, so the probe costs no table scan). When the
15
+ * server's spelling of the authored predicate equals the catalog's spelling of
16
+ * the live one, the live index is rewritten to the authored text so the
17
+ * differ sees no change. A predicate the server cannot compile in the current
18
+ * table context (a column that does not exist yet) falls back to the textual
19
+ * comparison, exactly as before.
20
+ */
21
+ import type { SchemaIR } from "@vibeorm/schema";
22
+ import type { SqlExecutor } from "./types.ts";
23
+ /**
24
+ * Rewrite the live schema's partial-index predicates to the authored text
25
+ * wherever the server deparses both to the same expression. Postgres and the
26
+ * rollback probe only; any other configuration returns `from` untouched.
27
+ */
28
+ export declare function prepareIndexPredicateDiff(params: {
29
+ executor: SqlExecutor;
30
+ from: SchemaIR;
31
+ to: SchemaIR;
32
+ namespace: string;
33
+ probe?: "none" | "rollback" | "temporary";
34
+ }): Promise<SchemaIR>;
35
+ //# sourceMappingURL=index-predicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-predicates.d.ts","sourceRoot":"","sources":["../src/index-predicates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE;IACtD,QAAQ,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;CAC3C,GAAG,OAAO,CAAC,QAAQ,CAAC,CA4BpB"}