create table foo (id auto increment primary key, name varchar(255))
I wrote a simple rails migration script which creates a new record on self.up
and drops it on self.drop
with delete(:id => 1)
. If I perform db:migrate it creates a new entry with id=1 and if I rollback it gets removed. The problem occurs if I migrate / drop again as the record gets created with primary key id=2 and my drop script fails on a rollback.
It is very important that the primary key is the same every time as I have other dependencies based on that. What should be the right way to handle this.