I have a database with a table that consists of 65k+ entries, which is used in my production Rails app, and I want to add some 40k+ more rows from a CSV file I have, ensuring that the data gets into:
1) db on my development machine,
2) db on the production server,
3) db on my team members’ machines.
What approach should I choose? A rake task for populating the table? A migration?
Am I doing something wrong?
The best practice is going to depend entirely on the data you’re importing. If you’re only ever going to import it once, and never touch it again, a migration is the right way to go. If you intend to update the CSV and replace / append the data in the database, you probably will want to consider a rake task.