Hello Friends, I just wanted to know the proper way of designing a database which should be worked with the activerocord design. My requirement is I have 100''s of question and answer to that question, and the scenario is that a user will select the answer which will be used for the future reference. As we have to keep in mind that the answer can be in any format like - a number, text, date, datetime, checkbox, radiobutton. So I have a YAML file to store the question and answer? Or it should in a database., So it will be very much helpful if you suggest me how should I design a Database on the above mentioned requirement. Thanks Abhis. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Pluralised table names and id autoincrementing integer as your primary key. Use underscores between words all lowercase and foreign keys have singularised versions of the table name. For example great_questions as a table name and great_question_id as a foreign key. Don''t use constraints if you can help it. Blog: http://random8.zenunit.com/ Twitter: http://twitter.com/random8r Learn: http://sensei.zenunit.com/ New video up now at http://sensei.zenunit.com/ real fastcgi rails deploy process! Check it out now! On 19/01/2010, at 5:45 PM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Friends, > I just wanted to know the proper way of designing a database which > should be worked with the activerocord design. > My requirement is > > I have 100''s of question and answer to that question, and the > scenario is that a user will select the answer which will be used > for the future reference. > As we have to keep in mind that the answer can be in any format like > - a number, text, date, datetime, checkbox, radiobutton. > > So I have a YAML file to store the question and answer? Or it should > in a database., > > So it will be very much helpful if you suggest me how should I > design a Database on the above mentioned requirement. > > Thanks > Abhis. > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 > .-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Julian Leviston wrote:> Pluralised table names and id autoincrementing integer as your primary > key. Use underscores between words all lowercase and foreign keys have > singularised versions of the table name. For example great_questions > as a table name and great_question_id as a foreign key.Right.> Don''t use > constraints if you can help it.Fatally wrong! Constraints are essential to a database that will not be corrupted by inconsistent data. Do not leave them out.> > Blog: http://random8.zenunit.com/ > Twitter: http://twitter.com/random8r > Learn: http://sensei.zenunit.com/ > New video up now at http://sensei.zenunit.com/ real fastcgi rails > deploy process! Check it out now!Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. --00151747b52a7b4eb1047d7fced9 Content-Type: text/plain; charset=ISO-8859-1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. --00151747b52a7b4eb1047d7fced9--