Reset the id field in a table in a sqlite db in Rails
问题 Im using sqlite db in a sample rails application. From my users table, i have cleared all records using User.delete_all . But now whenever i insert a new record in the table using User.create , the id is starting at a value which is one more than the id of the last record which was there in the table. For example, if my table had 5 records and i cleared all, then when i do User.create, its starting at id 6. Is there any way i can make the id start from 1 again ? Thank You 回答1: Similar