Joachim Glauche
2007-May-16 13:58 UTC
Easy and reliable way to keep database views updated?
I''m using a lot of database views to create various lists in my RoR applications and I''ve problems keeping them updated. The problem is, that some of my views are depending on some other views. So I have for example: View A View B, depends on View A View C, depends on View A If I need to update View A for any reason, I''ve to cascade drop it and re-create View B & C, because Postgresql (8.2 btw.) doesn''t support changes to a view very well. When using rake for database migration, I always have to manually check for dependencies first. Then, I''ve to re-create the other views. That isn''t working well. Is there any good attempt to have something like database-view migrations with dependencies? -- 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 -~----------~----~----~----~------~----~------~--~---
Bob Showalter
2007-May-16 15:45 UTC
Re: Easy and reliable way to keep database views updated?
On 5/16/07, Joachim Glauche <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''m using a lot of database views to create various lists in my RoR > applications and I''ve problems keeping them updated. > > The problem is, that some of my views are depending on some other views. > So I have for example: > > View A > View B, depends on View A > View C, depends on View A > > If I need to update View A for any reason, I''ve to cascade drop it and > re-create View B & C, because Postgresql (8.2 btw.) doesn''t support > changes to a view very well. > > When using rake for database migration, I always have to manually check > for dependencies first. Then, I''ve to re-create the other views. That > isn''t working well.My thought would be to create a custom rake task that drops and rebuilds your views. You could then just run that after every migration. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joachim Glauche
2007-May-17 13:31 UTC
Re: Easy and reliable way to keep database views updated?
Bob Showalter wrote:> My thought would be to create a custom rake task that drops and > rebuilds your views. You could then just run that after every > migration.I don''t like the idea to burn down my house and rebuild it just to replace a window. -- 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 -~----------~----~----~----~------~----~------~--~---
Bob Showalter
2007-May-17 18:52 UTC
Re: Easy and reliable way to keep database views updated?
On 5/17/07, Joachim Glauche <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Bob Showalter wrote: > > > My thought would be to create a custom rake task that drops and > > rebuilds your views. You could then just run that after every > > migration. > > I don''t like the idea to burn down my house and rebuild it just to > replace a window.Well alrighty then... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---