Hi all, I''m wondering if it is possible to manage tables and tables columns in rails... Might be not very clear so here is an example : I have an application that has specific tables for the users of my app. Let say, I create a database with a ''users'' table template (first_name, last_name, email, country). When "joe" creates an account in my app , I want to creates a "joo_users" table which is a "copy" of my template "users" table. Now, joe doesn''t care of, let say, the country of his customers so he decides to "remove" the "country" column of his "joe_users" table ... The same thing if "joe" wants to creates a new column in a specific table ... What I would like to have is user be able to remove some table columns so his "screen" won''t be polluated with fields that he doesn''t care of. Is it possible ? If so I can I do this ? -> do some create table stuff using SQL command within rails and pass to "table_prefix" "joe" (or whatever is my client name) my "user" model -> do some ALTER table stuff using SQL command within rails to remove unwanted table column ? Thanks for all your answers ! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey Julien Did you find a way to do this? I have the exact same requirement. Thanks p3rlhax Julien Delgoulet wrote:> Hi all, > > I''m wondering if it is possible to manage tables and tables columns in > rails... > Might be not very clear so here is an example : > > I have an application that has specific tables for the users of my app. > Let say, I create a database with a ''users'' table template (first_name, > last_name, email, country). > When "joe" creates an account in my app , I want to creates a > "joo_users" table which is a "copy" of my template "users" table. > Now, joe doesn''t care of, let say, the country of his customers so he > decides to "remove" the "country" column of his "joe_users" table ... > > The same thing if "joe" wants to creates a new column in a specific > table ... > > What I would like to have is user be able to remove some table columns > so his "screen" won''t be polluated with fields that he doesn''t care of. > > Is it possible ? > If so I can I do this ? > > -> do some create table stuff using SQL command within rails and pass > to "table_prefix" "joe" (or whatever is my client name) my "user" model > -> do some ALTER table stuff using SQL command within rails to remove > unwanted table column ? > > > Thanks for all your answers !-- 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 -~----------~----~----~----~------~----~------~--~---
Isak Hansen
2007-May-22 11:07 UTC
Re: managing tables and tables columns within my rails app.
On 5/22/07, p3rlhax <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hey Julien > > Did you find a way to do this? I have the exact same requirement. >Hey buddy, you do not want to alter your db schema dynamically. It may be possible, even using RoR/AR, but it''s never a good idea. I suggest you pick up a good book or two on db modelling instead, and/or post your problem on a database oriented forum. Sincerely, Isak> Thanks > p3rlhax--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---