How I can update one database schema to another database?
I have 2 databases in the same postgresql server:
mybd: used for development
test_mydb: used for testing is is preseeded with some test data that are significantly smaller than
mydbis updated via migration scripts. What I want is to sync the changes after the migrations are run into the
test_mydbafterwards, I want to
pg_dumpthe contents of
test_mydbin order to generate a test dump.
Is there a way to look for diferences between 2 schemas of the database
test_mydband apply them to
I want schema-only differences and not full data replication.
jeanid last edited by
You can use
pg_dumpto generate the DB object scripts, then compare the text files. Not sure whether
pg_dumpgenerate the objects in specific order. If yes, you can use a program like
diffto do the comparison. Otherwise, you may need to compare manually.
pg_dumpoptions will be useful
-n, --schema=PATTERN dump the specified schema(s) only -s, --schema-only dump only the schema, no data