After inadvertently overwriting my development database of ~100 rows/table with my fixtures test data (just 2 rows/table), the next new object created in each model started at id = 897600.
What could have caused this? Does this mean I created 897500 test objects that are somehow not visible in my database? Not sure if this is something I should be concerned with, but any feedback would be appreciated.
I’m using PostgreSQL 9.1 with Rails 3.2
Please let me know what additional information would be useful in clarifying my question. Thanks!
Rails fixtures use hashes of fixture keys in order to determine record
ids. This allows all the good stuff (some old article from around the time this feature was introduced). In order for your tests to run, records which get created in test examples need not to clash with these hash ids, soActiveRecordresets PK sequences tomax(id)+1for each table which it touches with fixtures. Here’s how your PKs can get up to numbers like897600.