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:
+1
-1
@@ -844,7 +844,7 @@ func writeJobOutput(rj *resolvedJob, db *models.Database, lg *jobLogger) error {
|
||||
}
|
||||
lg.logf("writing output to database env:%s", rj.outputConnEnv)
|
||||
writerOpts := newWriterOptions("", o.Package, o.FlattenSchema, o.Types, o.ArrayNullable, o.ContinueOnError)
|
||||
writerOpts.Metadata = map[string]interface{}{"connection_string": rj.outputConn}
|
||||
writerOpts.Metadata = map[string]interface{}{"connection_string": rj.outputConn, "full_ddl": o.FullDDL}
|
||||
return wpgsql.NewWriter(writerOpts).WriteDatabase(db)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user