Hi, I have quite complex db schema created by ActiveRecord and every constraints/relations are defined only in ActiveRecord objects. I am going to create db schema diagram like ERD etc. Do you have any idea how to do it? It is fine too if I could build constraints in db. Maybe one of you created an appropriate rake? Greets, Mirek --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you want to add constraints in the DB, you can always use execute within your migrations... execute "ALTER TABLE `projects` your SQL goes here, blah blah blah" Just execute the appropriate SQL statements in the self.up and self.down methods. -- 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 -~----------~----~----~----~------~----~------~--~---
You are right. But it is quite difficult(get a lot of time) to create these migrations by yourself. I have 30 tables, so I am looking for rake etc. to generate it. Do you have any idea? On 9 Wrz, 14:42, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> If you want to add constraints in the DB, you can always use execute > within your migrations... > > execute "ALTER TABLE `projects` your SQL goes here, blah blah blah" > > Just execute the appropriate SQL statements in the self.up and self.down > methods. > -- > 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 -~----------~----~----~----~------~----~------~--~---
On 10 Sep 2008, at 08:15, Zirael wrote:> > You are right. But it is quite difficult(get a lot of time) to create > these migrations by yourself. I have 30 tables, so I am looking for > rake etc. to generate it. >Why do you want migrations if you''ve already got the schema? Rails will dump your schema to schema.rb. With appropriate plugins (http://agilewebdevelopment.com/plugins/search?search=redhillonrails ) it should handle foreign keys as well. Fred> Do you have any idea? > > > On 9 Wrz, 14:42, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> If you want to add constraints in the DB, you can always use execute >> within your migrations... >> >> execute "ALTER TABLE `projects` your SQL goes here, blah blah blah" >> >> Just execute the appropriate SQL statements in the self.up and >> self.down >> methods. >> -- >> 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 -~----------~----~----~----~------~----~------~--~---
Thx, that plugin let me save lot of time. There is only problem with polymorphic relationship. On 10 Wrz, 09:22, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10 Sep 2008, at 08:15, Zirael wrote: > > > > > You are right. But it is quite difficult(get a lot of time) to create > > these migrations by yourself. I have 30 tables, so I am looking for > > rake etc. to generate it. > > Why do you want migrations if you''ve already got theschema? Rails > will dump yourschematoschema.rb. With appropriate plugins (http://agilewebdevelopment.com/plugins/search?search=redhillonrails > ) it should handle foreign keys as well. > > Fred > > > Do you have any idea? > > > On 9 Wrz, 14:42, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> If you want to add constraints in the DB, you can always use execute > >> within your migrations... > > >> execute "ALTER TABLE `projects` your SQL goes here, blah blah blah" > > >> Just execute the appropriate SQL statements in the self.up and > >> self.down > >> methods. > >> -- > >> 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---