Add Primary Key - extension tag


I have been creating some extension for Oracle DB, most of all new specialised tags (not defined in LiquideBase, for example CREATE TRIGGER and DROP TRIGGER for Oracle). Everything work fine until I added tag ADD PRIMARY KEY which is defined in LiquideBase (I wanted to extend this tag by adding attributes: DEFERRABLE and INITIALLYDEFERRED).

What’s my problem?"        xmlns:ora=""        xmlns:xsi=""        xsi:schemaLocation=" ../../../../../java/liquibase/ext/ora/xml/dbchangelog-2.0.xsd ../../../../../java/liquibase/ext/ora/xml/dbchangelog-ext.xsd">



In this case  ADD PRIMARY KEY should be created by rules from LiquiBase, but classes from extension are used (package liquibase.ext.ora.addprimarykey;)

I suppose that it doesn’t work because classes names in LiquiBase and my extension are same (but package is different!). Because of that, classes from extensin override classes from LiquiBase and tag  is maintained by extension classes.

Is there any way I should follow? Do I have to rename my tag and classes names?


There is a “priority” parameter that gets passed to the AbstractChange superclass if you are extending that class.  If there are multiple classes that use the same tag name, liquibase picks the one with the highest priority.  The built-in liquibase priorities should all be 1, so if you pass in a higher value it should use your class for all addPrimaryKey tags.


Thanks, it doesn’t solve my problem, but it changes my point of view.


I’ll take a look at the code and try to figure out why your extension isn’t running. 

It did get me thinking about how the extension framework should work in general, and posted a question on how to best handle overlapping change tag implementations: