A new topic, 'Liquibase problems, API and customization', has been made on a
board you are watching.
You can see it at
http://liquibase.org/forum/index.php?topic=678.new#new
The text of the topic is shown below:
Hi again.
My project is based on JPA (hibernate) + spring + spring web flow + richfaces +
jboss as + MySQL
I'm using liquibase (built from trunk reverted before rc5) for 2 purposes:
1. db migration. I have couple of problems here, some of them discussed in
previous post:
- some indexes for FK are not created
(http://liquibase.org/forum/index.php?topic=675.0)
- diffdbtochangelog doesn't work well with hibernate entities. Also it requires
hibernate.cfg.xml file, but my project uses jpa (persistence.xml). Thats why I
have an Ant target which uses the hbm2ddl to create a temporary schema from the
entities and then I compare it with the current schema with
diffdatabasetochangelog (works perfect)
- I had to modify the ant task so I can specify the id and the author of the
changesets.
2. DB backup and restore
The backup (dump) method uses code from ant the task GenerateChangeLogTask and
diff.setDiffTypes("data");
Here I have 3 problems with the existing code.
- I need only one changeset for that changelog which I use as a dump file
(currently there is a changeset for each table) and I need it to be
alwaysRun=true.
Btw there is a bug in XMLChangeLogSerializer#createNode: should be
Code:
if (changeSet.isAlwaysRun()) {
node.setAttribute("runAlways", "true");
}
- I need to specify my own id of the changeset so I have to add to DiffResult:
Code:
public void setIdRoot(String idRoot) {
this.idRoot = idRoot;
}
private String generateId() {
return idRoot + (diffData ? "" : "-" + changeNumber++);
}
- I have an issue with the generated changelog: I have a column which is 'not
null' but on some entries it is empty. When I make the dump in generates :
Code:
<insert tableName="...">
<column name="..." valueNumeric=""/>
and when I import the data from this file a mysql error occures that I cannot
insert null into this column
To revert/restore data previously backed up with the described method above I
do:
1. delete all the data
2. rollback to the changeset that the dump file is compatible with
3. insert the data from the dump file
4. migrate to the current schema (run the changeset that were rolled back on
step 2)
For step 2 I need special method that rollbacks to a changeset with specified
id wich is very similar to rollback(Date dateToRollBackTo, String contexts)
except that I have to use my own ChangeSetFilter to defined which changesets
should be rolled back. The problem is that I have to use some private members
of class Liquibase like changeLogParameters. I tried to implement this method
in my own class that extends Liquibase without using the private fields and it
works since i don't use different contexts.
So now I have to maintain my own version of liquibase which I don't want to.
Is there any way to make liquibase API more friendly in my case?
Unsubscribe to new topics from this board by clicking here:
http://liquibase.org/forum/index.php?action=notifyboard;board=1.0
Regards,
The Liquibase Community Forum Team.------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user