I have this testingdatabase which, by now, is stuffed with junk. Now I’ve done a few Table.destroy_all commands in the rails console which deletes all records and dependencies which is awesome. However; I’d like to truncate everything so the ID’s etc. start at 1 again. Is there any way in Rails 3?
Share
The accepted answer only works if you need to recreate the whole database.
To drop a single table (with the callbacks) and to get the IDs to start from 1:
If you are using Sqlite, it does not support truncate so do the following: