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?

On 5/16/07, Joachim G. [email protected] 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.

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.

On 5/17/07, Joachim G. [email protected] 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs