Hussein Patwa
2007-May-26 15:35 UTC
Creating tables within the app rather than manual configure
Hello, Was wondering if anyone working with Ruby on Rails could advise? I am developing a blog for my site, but was thinking of also having it as an application which I could distribute. To this end I would want the application to generate the tables for the database itself, instead of requiring that they be manually set up using either the command line or PHPMyAdmin or whatever. Is this possible? Then if the tables are already there it does nothing. It would mean that anyone could take the app, it would run the first time and do all the setup needed, with the only modifications to the code necessary being the adaption of the database.yml file to tell it the name, username, etc of the databases. I''m new to Rails so if you could please take this into account when explaining, thanks for your time. thanks. H. -- 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan
2007-May-26 19:21 UTC
Re: Creating tables within the app rather than manual config
Hussein Patwa wrote:> Hello, > > Was wondering if anyone working with Ruby on Rails could advise? > > I am developing a blog for my site, but was thinking of also having it > as an application which I could distribute. To this end I would want > the application to generate the tables for the database itself, instead > of requiring that they be manually set up using either the command line > or PHPMyAdmin or whatever. Is this possible? Then if the tables are > already there it does nothing. It would mean that anyone could take the > app, it would run the first time and do all the setup needed, with the > only modifications to the code necessary being the adaption of the > database.yml file to tell it the name, username, etc of the databases. > > I''m new to Rails so if you could please take this into account when > explaining, thanks for your time. > > thanks. > > H.You can do install.rb file similar to some PHP web application! and setup all the requirements you need :) -- 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 -~----------~----~----~----~------~----~------~--~---
jacqui
2007-May-27 18:19 UTC
Re: Creating tables within the app rather than manual configure
I know you said that you didn''t want to require setup using the command line, but I believe what you want to do is taken care of by the bootstrap rake task. I typically set up a bootstrap task that will create all the tables necessary for the application to run on a new server. You can either setup capistrano to run this after updating the code on the remote server, or you can run it yourself on the command line with a simple "rake db:bootstrap:load" On May 26, 8:35 am, Hussein Patwa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello, > > Was wondering if anyone working with Ruby on Rails could advise? > > I am developing a blog for my site, but was thinking of also having it > as an application which I could distribute. To this end I would want > the application to generate the tables for the database itself, instead > of requiring that they be manually set up using either the command line > or PHPMyAdmin or whatever. Is this possible? Then if the tables are > already there it does nothing. It would mean that anyone could take the > app, it would run the first time and do all the setup needed, with the > only modifications to the code necessary being the adaption of the > database.yml file to tell it the name, username, etc of the databases. > > I''m new to Rails so if you could please take this into account when > explaining, thanks for your time. > > thanks. > > H. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Hussein Patwa
2007-May-27 18:50 UTC
Re: Creating tables within the app rather than manual config
Hi, thanks for the tip. I''d never heard of either the bootstrap or capistrano but I''ll do some research into it. I''m using the rake migrate function at the moment, which is fine for my own deployment but not something I''d want to have for distributed software (as in software made available to other people, not remote distribution). H. jacqui wrote:> I know you said that you didn''t want to require setup using the > command line, but I believe what you want to do is taken care of by > the bootstrap rake task. > > I typically set up a bootstrap task that will create all the tables > necessary for the application to run on a new server. You can either > setup capistrano to run this after updating the code on the remote > server, or you can run it yourself on the command line with a simple > "rake db:bootstrap:load" > > > > On May 26, 8:35 am, Hussein Patwa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan
2007-May-27 20:39 UTC
Re: Creating tables within the app rather than manual config
You can maybe inject rake migrate into the bootsetup for your application :) -- 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 -~----------~----~----~----~------~----~------~--~---
Hussein Patwa
2007-May-28 18:08 UTC
Re: Creating tables within the app rather than manual config
Thanks again. I found what looks to be a nice reference of bootstrap commands so I''ll look at it once I have finished developing the app. The app is mainly a development to suit my own needs, but it would be nice to join the club of people who''ve made their own software available to the public. H. Jamal Soueidan wrote:> You can maybe inject rake migrate into the bootsetup for your > application :)-- 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 -~----------~----~----~----~------~----~------~--~---