30 lines
1.4 KiB
Markdown
30 lines
1.4 KiB
Markdown
# Plan: pkg/diff (65.5%) and pkg/merge (75.1%)
|
|
|
|
## Existing
|
|
- diff: `diff_test.go`, `formatters_test.go`
|
|
- merge: `merge_test.go`
|
|
|
|
## pkg/diff
|
|
|
|
| Func | Now | Cases |
|
|
|------|-----|-------|
|
|
| `compareSchemaDetails` | 0% | Description/owner/options changed |
|
|
| `compareConstraintDetails`, `normalizeConstraintAction` | 0% | Columns, referenced table, on-update/on-delete variants and case/default normalisation |
|
|
| `compareRelationshipDetails` | 0% | Changed endpoints/type |
|
|
| `compareViews`, `compareViewDetails` | 0% | Added/removed/changed definition |
|
|
| `compareSequences`, `compareSequenceDetails` | 0% | Added/removed/changed increment/min/max/start |
|
|
|
|
Data: pair `examples/test_schema.dbml` and `test_schema_modified.dbml`; add view/sequence changes in code-built fixtures.
|
|
|
|
## pkg/merge
|
|
|
|
| Func | Now | Cases |
|
|
|------|-----|-------|
|
|
| `mergeSequences`, `cloneSequence` | 33% / 0% | New, existing, conflicting; clone is deep |
|
|
| `cloneSchema` | 48% | Views, sequences, scripts, indexes cloned independently |
|
|
| `extractTypeParts` | 48% | Precision/scale, arrays, schema-qualified, no modifiers |
|
|
| `GetColumnTypeConflictSummary`, `min` | 0% | Limit truncation, zero conflicts |
|
|
|
|
## Live DB cases (dbtest)
|
|
- pgsql live diff/merge against a real DB: `dbtest.sh test postgres`; reuse `tests/postgres/init.sql` as the live side and `examples/test_schema*.dbml` as the desired side.
|