You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The data/test/schema_a.sql → data/test/schema_b.sql fixtures already cover the heavy machinery very well (partitions, persistence chains, virtual generated columns, CASCADE dependents, and every regression case from #180, #181, #186, #188, #191, #200, #202). However, a coverage audit against app/src/dump/ and app/src/comparer/core.rs surfaced a long tail of attribute-level diffs on otherwise-covered object kinds that are never exercised by CI.
CI runs the fixtures end-to-end against a real Postgres (.github/workflows/rust.yml), so each addition exercises the full dump→compare→apply pipeline.
High-priority gaps (verified absent via grep)
GRANT privilege bits DELETE, TRUNCATE, REFERENCES, TRIGGER are never tested. Only SELECT, INSERT, UPDATE, EXECUTE, USAGE, CREATE appear in either schema. Add one table where schema_a has GRANT DELETE, TRUNCATE, REFERENCES, TRIGGER and schema_b drops one + adds another, so the diff exercises all four privilege-bit paths.
No BRIN or HASH indexes. Only BTREE, GIN, and GIST are present. Add one BRIN index on an integer column (unchanged between A and B, to test dump round-trip) and one HASH index added in B (to test the create path).
No functional / expression indexes. All indexes are simple column indexes. Add a functional index like (lower(name)) in schema_a that either changes expression or is dropped in schema_b, plus a new functional index added in schema_b.
FK DEFERRABLE flag flip on a non-cycle FK is not tested.DEFERRABLE INITIALLY DEFERRED appears only in the cycle_a ↔ cycle_b pair (where it stays unchanged). Add a single non-cycle FK in schema_a withoutDEFERRABLE that becomes DEFERRABLE in schema_b — narrow but regression-prone area (recent Persistence-ordering silently emits arbitrary order on FK cycles #191).
DEFAULT drop direction is not tested.customers.name gains a DEFAULT 'unknown', but no column has a DEFAULT in A that is removed in B. Add a column that has DEFAULT in schema_a and NO DEFAULT in schema_b.
Lower-priority gaps
Index type change (e.g. BTREE → GIN) on the same column to exercise the drop-and-recreate path with a kind transition.
UNLOGGED sequence flip independent of table ownership — tables flip LOGGED↔UNLOGGED but sequences do not in isolation.
Function SUPPORT and TRANSFORM FOR TYPE clauses — Routine carries support_function and transform_types fields (app/src/dump/routine.rs) but no fixture exercises them. Narrow; rare in real schemas.
Out of scope (rejected as too narrow)
Owner changes on indexes (PostgreSQL doesn't really support distinct index ownership)
Overloaded function COST/ROWS where only one overload changes
FK MATCH FULL / MATCH SIMPLE modifier flips
View WITH CHECK OPTION / WITH LOCAL CHECK OPTION
Operator operand-order asymmetry
Acceptance
When this is closed, every checked item above should have a matching A→B diff in the fixtures, the data/test/README.md matrix should mention it, and cargo run -- --config ../data/test.conf against the loaded databases should produce a clean migration script that, when applied to the A database, makes it schema-equal to B.
Total additions estimated at ~30–80 lines across both schema files.
The
data/test/schema_a.sql→data/test/schema_b.sqlfixtures already cover the heavy machinery very well (partitions, persistence chains, virtual generated columns, CASCADE dependents, and every regression case from #180, #181, #186, #188, #191, #200, #202). However, a coverage audit against app/src/dump/ and app/src/comparer/core.rs surfaced a long tail of attribute-level diffs on otherwise-covered object kinds that are never exercised by CI.CI runs the fixtures end-to-end against a real Postgres (.github/workflows/rust.yml), so each addition exercises the full dump→compare→apply pipeline.
High-priority gaps (verified absent via grep)
DELETE,TRUNCATE,REFERENCES,TRIGGERare never tested. OnlySELECT,INSERT,UPDATE,EXECUTE,USAGE,CREATEappear in either schema. Add one table where schema_a hasGRANT DELETE, TRUNCATE, REFERENCES, TRIGGERand schema_b drops one + adds another, so the diff exercises all four privilege-bit paths.(lower(name))in schema_a that either changes expression or is dropped in schema_b, plus a new functional index added in schema_b.DEFERRABLEflag flip on a non-cycle FK is not tested.DEFERRABLE INITIALLY DEFERREDappears only in thecycle_a ↔ cycle_bpair (where it stays unchanged). Add a single non-cycle FK in schema_a withoutDEFERRABLEthat becomesDEFERRABLEin schema_b — narrow but regression-prone area (recent Persistence-ordering silently emits arbitrary order on FK cycles #191).customers.namegains aDEFAULT 'unknown', but no column has aDEFAULTin A that is removed in B. Add a column that hasDEFAULTin schema_a andNO DEFAULTin schema_b.Lower-priority gaps
SUPPORTandTRANSFORM FOR TYPEclauses —Routinecarriessupport_functionandtransform_typesfields (app/src/dump/routine.rs) but no fixture exercises them. Narrow; rare in real schemas.Out of scope (rejected as too narrow)
MATCH FULL/MATCH SIMPLEmodifier flipsWITH CHECK OPTION/WITH LOCAL CHECK OPTIONAcceptance
When this is closed, every checked item above should have a matching A→B diff in the fixtures, the
data/test/README.mdmatrix should mention it, andcargo run -- --config ../data/test.confagainst the loaded databases should produce a clean migration script that, when applied to the A database, makes it schema-equal to B.Total additions estimated at ~30–80 lines across both schema files.