Forum: Ruby on Rails Easy and reliable way to keep database views updated?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joachim G. (Guest)
on 2007-05-16 17:58
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?
Bob S. (Guest)
on 2007-05-16 19:53
(Received via mailing list)
On 5/16/07, Joachim G. <removed_email_address@domain.invalid> wrote:
>
> 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.
Joachim G. (Guest)
on 2007-05-17 17:31
Bob S. 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.
Bob S. (Guest)
on 2007-05-17 22:53
(Received via mailing list)
On 5/17/07, Joachim G. <removed_email_address@domain.invalid> wrote:
>
> Bob S. 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...
This topic is locked and can not be replied to.