I’ve noticed that ids are in the high range for the test database of my Rails app. I’m wondering why this is the case. In development my ids start at 1.
I’ve noticed that ids are in the high range for the test database of
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason for this is that each test is wrapped in a transaction, which gets rolled back. Even though the records are deleted, the IDs are reserved and therefore the next one is auto-incremented.
If this bothers you, you can truncate the tables like this:
truncate table_name;.