Yes, the tag to use is <validCheckSum>.

Also, the MD5sum is computed on the final XML after any parameters are
put in, so if you originally executed a changeset as:

    <changeSet author="ejacobs" id="20090117T1730">
        <addColumn tableName="template">
            <column name="script_xml" type="longtext" />
            <column name="sequence_groups_xml" type="longtext" />
        </addColumn>
    </changeSet>

And changed it to:
    <changeSet author="ejacobs" id="20090117T1730" context="production">
        <addColumn tableName="template">
            <column name="script_xml" type="${clobtype}" />
            <column name="sequence_groups_xml" type="${clobtype}" />
        </addColumn>
    </changeSet>

But passed in "longtext" as your value for clobtype, your MD5 sum will
still match on production.

I don't see anything wrong off hand with how you are calling the API.
What if you just call liquibase.update("test") ? There may be something
wrong with the comma-separated context logic.  There is no need for an
"all" attribute since when you pass a context it will still call all
changesets that do not have a context set.  

Nathan

-----Original Message-----
From: Ben Wolfe [mailto:[email protected]] 
Sent: Monday, March 16, 2009 3:34 PM
To: [email protected]
Subject: Re: [Liquibase-user] Calling Liquibase API with contexts.


There is an attribute or element you can add to changeSets for putting 
in "other" valid checksums.  You put the old changeSet checksum in there

that the production system has already, then make your edit to the 
changeSet.  Now all future checks use a new checksum and the current 
production system validates against the element you just put in.

Ben

David C. Hicks wrote:
> It's me again!  :-)
>
> I've got my changelog.xml modified to handle my test vs. production 
> environment issues, but I have another associated problem, now.  My 
> testing class calls the Liquibase API to build an in-memory database, 
> but it is executing the wrong contexts.  I added the contexts, as a 
> comma-separated list, to the update() call on the Liquibase object,
like 
> this:
>
>     liquibase.update("all,test");
>
> Any other value resulted in no contexts being applied.  What appears
to 
> happen is that it's trying to execute "all,production".  Here are the 
> changesets in question:
>
>     <changeSet author="ejacobs" id="20090117T1730"
context="production">
>         <addColumn tableName="template">
>             <column name="script_xml" type="longtext" />
>             <column name="sequence_groups_xml" type="longtext" />
>         </addColumn>
>     </changeSet>
>     <changeSet author="dhicks" id="20090316T1500a" context="test">
>         <addColumn tableName="template">
>             <column name="script_xml" type="clob"/>
>             <column name="sequence_groups_xml" type="clob"/>
>         </addColumn>
>     </changeSet>
>
> I can't alter the first changeset because it's already living in a 
> production database with a known checksum.  So, I added the context, 
> then created the second changeset to be used in the test environment.

> When I run my test, I get an error telling me that "longtext" is not a

> valid type.  So, it's clearly trying to execute the first changeset.
>
> Can someone point me in the right direction, please?
> Thanks,
> Dave
>
>
>
------------------------------------------------------------------------
------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly
and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based
development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Liquibase-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/liquibase-user
>   

------------------------------------------------------------------------
------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based
development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to