Hi,
we use Liquibase on Oracle database. Our problem is that Liquibase uses SYSDATE function as standard function for getting the timestamp of executed change set. The smallest precision of SYSDATE function is second and we have problems when multiple changes are done within one second and we issue tag database command. Then multiple changes are marked with the tag. It even happend that user applyed more changes with more than one tag database command and the later tag overwritten the previous tag because all was done in the same second. The result was that one tag wasn’t present in DATABASECHANGELOG table at all! The user could not rollback to that tag.
Therefore I wanted to find out how to use CURRENT_TIMESTAMP function instead of SYSDATE function. CURRENT_TIMESTAMP function gives time with fractions of seconds. I found the parameter -currentDateTimeFunction which should override the current date/time function, but it doesn’t. The method getCurrentDateTimeFunction() in liquibase-1.9.5-src/src/java/liquibase/database/OracleDatabase.java class simply returns “SYSDATE” and doesn’t take the parameter -currentDateTimeFunction into account.
So I suggest the following implementation of getCurrentDateTimeFunction() method (useful for all supported databases):
public String getCurrentDateTimeFunction() {
if (currentDateTimeFunction == null) {
return “SYSDATE”;
} else {
return currentDateTimeFunction;
}
}
This modification allows really to override the current date/time function by means of parameter -currentDateTimeFunction.
And when the issue http://liquibase.jira.com/browse/CORE-588 is resolved, overriding will work in command line mode either
Jirka