Fernando Perez
2008-Sep-10 22:04 UTC
schema.rb gotcha and how to load default entries in DB
Hi list, I just wanted to let you know: 1) Yes you must check in the schema.rb into your SCM. 2) Yes you must use db:schema:load 3) Be careful schema.rb won''t allow you to load "default" entries into the DB My question is, if I want to have for instance a default user inserted into DB such as an admin user, how do you handle that? Mixing migrations and schema.rb is dangerous. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Barnette
2008-Sep-10 22:09 UTC
Re: schema.rb gotcha and how to load default entries in DB
Hi, On Wed, Sep 10, 2008 at 3:04 PM, Fernando Perez <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> My question is, if I want to have for instance a default user inserted > into DB such as an admin user, how do you handle that? Mixing migrations > and schema.rb is dangerous.Have you looked at seed-fu? http://www.intridea.com/2008/4/20/seed-fu-simple-seed-data-for-rails ~ j. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2008-Sep-10 22:16 UTC
Re: schema.rb gotcha and how to load default entries in DB
Thank you that''s the kind of plugin I was looking for! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2008-Sep-18 11:53 UTC
Re: schema.rb gotcha and how to load default entries in DB
Just to let you know: be extremely CAREFUL with rake db:schema:load. If you run it by mistake on production server, it cleans up the DB. I tried that whem my rake db:migrate didn''t want to make the new changes go live, and I discovered I had reset the whole DB. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---