I have two instances of a database with these two tables:
foo_id <-- primary key
bar_id <-- primary key
foo_id <-- foreign key
bar_id and foo_id are automatically incremented, read only primary keys.
What I want to do is this:
- On database instance 1, I drop all the rows in foo and bar
- Import the rows from database 2 to database 1
How can I keep the relationship between tables Foo and Bar in this setup? That is, whatever the primary key in Foo is, the corresponding row in Bar has the right foreign key value to Foo no matter what value foo_id has?