That is one issue I run into and don't have a great work-around
currently. We have an integration server that does a fresh database
build from our change sets each day so we are notified right away if we
introduce an update-breaking change. When that occurs then we create a
new change set with the new view definition which is kind of ugly but
works.
If you run into the issue a lot, or if you have a lot of views, you may
have better luck moving all your view definitions to the end of your
change log so the rest of the database is always updated completely
before the new view definitions are applied.
Nathan
-----Original Message-----
From: liquibase-user-***@lists.sourceforge.net
[mailto:liquibase-user-***@lists.sourceforge.net] On Behalf Of
DATACOM - Diego
Sent: Tuesday, January 22, 2008 11:23 AM
To: liquibase-***@lists.sourceforge.net
Subject: Re: [Liquibase-user] is there any way in liquibase to alter a
view
Just for the sake of curiosity, how do you deal with the issue of
changeSet ordering when using the "runOnChange" attribute? Imagine that
some modification on the view is dependent on some other changeSet which
is run after the changeSet which is creating/updating the view.
Diego
Post by Nathan VoxlandSorry for the slow reply. I'm just catching up on the mailing list
today.
You may want to use mysql's "create or replace view" syntax inside the
<sql> tag. That way you don't need to worry about the update failing if
you try to drop the view before it has been created.
Generally for views, I use the create or replace syntax and use the
"runOnChange" attribute on the <changeSet> tag so I can simply make the
necessary changes directly in the view definition and liquibase will run
the update only when I make changes. I can then more easily see what
has changed over time with my source control system's diff tools.
For rollback, however, you don't have automatic rollback support within
LiquiBase using the create or replace synax, but you don't get
automatic
Post by Nathan Voxlandrollback support because of the dropView tag anyway. If I need to roll
back view definitions, I think the best way would be to use your source
controls rollback functionality on the definition then re-run the new
changelog file.
Does this help?
Nathan
-----Original Message-----
avinashC
Sent: Friday, January 18, 2008 2:46 AM
Subject: [Liquibase-user] is there any way in liquibase to alter a view
Hello all,
i am a newbie to liquibase, i am using views(MySql) in my application. if i
want to modify any view is there any other way other than <dropView/> and
then <createView/>. coz how can i get my previous view, if at any
point
Post by Nathan Voxlandof
time i need any roll back for my view....?
and if i do like dropView and createView, my ant-db is failing...!
Any solution would be thankful and fruitful...
Thanks,
Avinash..
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/