hi everyone.. i''m a high school teacher who wrote a webapp in PHP and MySQL for my curriculum.. i use it to keep attendance, take notes per student or class and keep track of activities. i would like to soup it up and have read both the pickax and version 2 of agile web dev... now i''m starting to work and i''d like to rename columns and relationships in the database so that when i create rails functionality to work with the database i can use the same database. yep, i dont want to copy the data to a new database and have two apps and two databases but its live - im using it daily. i''d like to slowly move the functionality to the rails app and eventually just archive the PHP one. but before i do that i have to switch my primary keys to the rails defaults and the join tables and all that jazz to the rails defaults.. i''m not worried about the data because i back it up and if all else fails i''ll just do the ol'' INSERT INTO or UPDATE commands in terminal. all that being said (phew) are the different defaults for rails in terms of column types (id type, etc) and singular plural conventions kept in one place somewhere? has anyone made a list? ive searched the web quite a bit and was going to start going through v2 of agile web dev but i thought i''d try an email before i got too into it.. sorry for the long background but i thought it best to be thorough.. thanks..~ari --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
arigold wrote:> i''m a high school teacherDon''t you mean "i ARE a high school teacher"? ;-)> have read both the pickax and version 2 of agile web dev...Grab /Rails Recipes/, by Chad Fowler, and hie thee hence to page 73, "Integrating with Legacy Databases". The shortest answer is you must start using all the defaults that you currently leave out of the ActiveRecord calls. Google for ActiveRecord::Base.set_primary_key or .table_name_prefix for a preview. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thank you philip.. dont quite get the "i ARE a high school teacher" joke but maybe thats because i just got home and had back to back 10th and 9th graders. maybe, just maybe 14 - 16 year olds arent biologically able to be focused after 8 hours of school.. hmm.. ; ) i just might get that rails recipes book but from your short answer i dont think that it answers my question. it seems like you''re looking to bend rails to the legacy database. i want to - yes its true - bend the legacy database to rails'' defaults. i want to change the ID column from "student_id" to "id". actually, ive done that one already.. im wondering what other things i''ll need to change in the legacy database to make it comply with the rails defaults. any ideas? in any event, thanks for pointing that book out.. all the best..~ari On Feb 13, 12:06 am, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> arigold wrote: > > i''m a high school teacher > > Don''t you mean "i ARE a high school teacher"? ;-) > > > have read both the pickax and version 2 of agile web dev... > > Grab /Rails Recipes/, by Chad Fowler, and hie thee hence to page 73, > "Integrating with Legacy Databases". The shortest answer is you must start > using all the defaults that you currently leave out of the ActiveRecord > calls. Google for ActiveRecord::Base.set_primary_key or .table_name_prefix > for a preview. > > -- > Phlip > http://www.greencheese.us/ZeekLand<-- NOT a blog!!!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > kept in one place somewhere? has anyone made a list? ive searched >I don''t know if there is a list, but if someone else knows, that would be a good resource to share. I would recommend using api.rubyonrails.com and looking at the following relationships (listed in the lower left pane): belongs_to has_and_belongs_to_many has_many has_one I think all give notes on database structure. -andy -- Andrew Stone --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
arigold wrote:> dont quite get the "i ARE a high school teacher" jokeYou were permitting sloppy grammar...> ...comply with the rails defaults...Rails practices "Convention over Configuration". Those are not defaults they are conventions, and if you convene or configure Rails differently, it will obey. Your best bet would be a combination of that chapter in /Rails Recipes/ and database migrations. Pick whichever is easiest, for each detail of non-compliance. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Here''s a helpful blog post I found titled "making a web app rewrite work" http://blog.evanweaver.com/articles/2007/02/01/making-a-web-app-rewrite-work HTH, Andrew On Feb 12, 4:58 pm, "arigold" <arigo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi everyone.. > > i''m a high school teacher who wrote a webapp in PHP and MySQL for my > curriculum.. i use it to keep attendance, take notes per student or > class and keep track of activities. i would like to soup it up and > have read both the pickax and version 2 of agile web dev... > > now i''m starting to work and i''d like to rename columns and > relationships in the database so that when i create rails > functionality to work with the database i can use the same database. > yep, i dont want to copy the data to a new database and have two apps > and two databases but its live - im using it daily. i''d like to > slowly move the functionality to the rails app and eventually just > archive the PHP one. but before i do that i have to switch my primary > keys to the rails defaults and the join tables and all that jazz to > the rails defaults.. > > i''m not worried about the data because i back it up and if all else > fails i''ll just do the ol'' INSERT INTO or UPDATE commands in terminal. > > all that being said (phew) are the different defaults for rails in > terms of column types (id type, etc) and singular plural conventions > kept in one place somewhere? has anyone made a list? ive searched > the web quite a bit and was going to start going through v2 of agile > web dev but i thought i''d try an email before i got too into it.. > > sorry for the long background but i thought it best to be thorough.. > > thanks..~ari--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---