Best practice for migrate data to production database Rails?

I have an rails 4 app running, with large migrations done, and i need a better way to do some push and update for data in production.

my team use sql in migrations files for update data, but it's no the better aproach to do this, because when i go up this app in other time, i will give a lot of erros, from updates.

i can do rake tasks to do this ponctual updates, but i dont know if this is the better way..

in my research i find this awesome gem:

https://github.com/harrystech/seed_migration

to do migrates for data like rails do migration for table structure, but i crashed in other problem:

i have an app with large ammount of migrations files, if a use a seed migration gem for generate data for imput i will have an problem when i need to up my app, because migrations alter table structure, and migration seed try to imput data in old structure.

i think i need a solution with run synchronous with rails migrations to up data to database.

any solution, opinion??

Upvotes: 3

Views: 1092

Answers (1)

Piotr Galas
Piotr Galas

Reputation: 4776

It is other gem https://github.com/ilyakatz/data-migrate. It works similar to migrations. So one data migration is run only once.

Upvotes: 1

Related Questions