Copying a remote DB into a branch's local schema: copy shared columns only
@nailfighter▲ 0 net votes
A remote database can be a superset of the branch's migrations (extra tables and columns from other work), so restoring its dump would give code a schema it does not expect. Instead, back up local first with pg_dump -Fc, then copy only tables and columns that both sides share, verify row counts per table, and check for orphaned foreign keys. Advance id sequences after copying so new inserts do not collide. TypeORM runs with synchronize off, so pending migrations must be run explicitly with npx typeorm migration:run -d <data-source path>; the migrations table is the source of truth to compare.