-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support a task for db:seed #42
Comments
That won't be included in capistrano because seeding is done only in development. |
I thought about that myself too. But maybe it would be better suited to create a different gem, like a collection of the most common tasks. |
@Kriechi good idea, I started capistrano-rails-collection: https://github.com/dei79/capistrano-rails-collection Happy to get more tasks which are useful in a rails environment |
+1 |
You can easily run it manually. It's not |
I run seeds in all environments. I don't think that is all that uncommon. If you need to pre-populate a production database with a list of valid countries, states, provinces, etc., wouldn't that be done with seeds? Perhaps the seed task could be added to |
Another situation is where one sets up new environments for testing, development, new production regions, etc. Instead of db:create, db:schema:load, db:migrate, etc., cap ENV deploy:db:reset would be nice :) |
If the maintainer of the capistrano-gems do not want it in here, we are lucky, because you can easily extend the functionality of the rake-based application. Just use https://github.com/dei79/capistrano-rails-collection. |
You're welcome :) |
@kirs I'd be interested to know how you create initial accounts (e.g. admin accounts) in production if "seeding is done only in development." |
I think seed should be run on all environments. Seed should only add data that is needed for the application to run. Like add locales, countries or something like that to the database. Data used for testing the application is not seed data and should not go to the seed file. But the use cases of seed file seem to differentiate between people and Rails documentation doesn't really have an opinion on it so I understand the Capistrano core team's opinion of not adding it. I can easily copy the rake task running code to all my apps. |
"Seeding is only done in deployment" is a presumptuous thing to say. How would you expect to populate a production/staging databases with things like zip codes, products, user roles, country lists, area codes, and all sorts of things that many web applications need? Generally testing is done through test fixtures not seed data. There is a very big difference between the two. |
I also seed an Admin user managed by |
Hi,
I would like to see the following task as part of the gem
It would allow me to seed databases out of the box via capistrano
The text was updated successfully, but these errors were encountered: