I’m developing a rails application with MYSQL and I’ve created a migration for adding indexes to tables.
Also I have a rake task that truncates some of the tables and writes data.
ActiveRecord::Base.connection.execute("TRUNCATE #{Model.table_name}")
Do I need to add indexes again after truncate ?
Thank you in advance 🙂
No. The table is dropped and then re-created again (including any indexes and constraints)