I’m using liquibase via ANT to dump changelogs like so:
<generateChangeLog
outputFile=“diffs/dump.xml”
driver="${database.driver}"
url="${dealer.database.url}"
username="${database.username}"
password="${database.password}"
classpathref=“classpath”
/>
I have 2 errors that come up:
-
[generateChangeLog] Unknown Data Type: -9 (nvarchar). Assuming it does not take parameters
This looks to be a problem, if it’s not going to bring over the parameters, all my nvarchar columns will be the default length. This error doesn’t stop the dump from happening. -
On another legacy database, we have some really ugly column names with spaces and other characters. This is legal in SQL server, as long as you escape the column names with []'s. I see in the liquibase source this should happen, but when I run the diff, it complains with:
build.xml:39: liquibase.exception.JDBCException: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: Incorrect syntax near ‘SEG’.
I traced this via SQL Profiler, and found the statement it gets stuck on is:
SELECT PROD GRP SEG DESC: FROM [Test Table] WHERE 1 = 0
[PROD GRP SEG DESC:] is the name of a column…
I searched for “1 = 0” in the source code, and found it in AbstractDatabase.java, and appears to be calling the escapeColumnName method of AbstractDatabase instead of the MSSQLDatabase method (which WOULD escape the column name properly)
Any chance there’s an easy fix for these issues?