feat(pgsql): diff against the live database by default for direct output

Direct pgsql output (job output.conn_env, merge --output-conn) now reads the live
schema and executes only the differences. full_ddl: true (job option) or --full-ddl
(merge) restores the full idempotent DDL; file output is unchanged.

- compare PKs by columns, skip constraint-backed indexes, normalize index method,
  FK actions, serial/numeric types, default literals/casts and truncated names
- diff table and column comments instead of re-emitting them
- remove leftover ZZDUMP debug code
This commit is contained in:
2026-10-02 22:52:59 +02:00
parent b6c0cd3d1b
commit 275424c605
7 changed files with 93 additions and 10 deletions
-3
View File
@@ -2191,9 +2191,6 @@ func (w *Writer) diffStatements(model, current *models.Database) ([]string, erro
}
statements = append(statements, setvalStatements...)
if dump := os.Getenv("ZZDUMP"); dump != "" {
_ = os.WriteFile(dump, []byte(strings.Join(statements, "\n=====\n")), 0o644)
}
return statements, nil
}