Hi,
Base on LB-b3 revision 1157 I have the following problem when I generate an SQL file for Oracle when the table includes BIGINT types. The SQL is written to a file because of this problem so I can’t check how it works when ran on the database.
Here is the changelog I use
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet author="chris" id="2">
The program used to print the SQL statements:
- public class App {
public static void main(String[] args) throws Exception {
App a = new App();
a.run();
}
public void run() throws Exception {
Connection con = getOracleConnection(“jdbc:oracle:thin:@localhost:1521:DEMO”, “demo”, “local”);
Liquibase liquibase = new Liquibase(“C:\temp\changelog3.xml”, new FileSystemResourceAccessor(), new JdbcConnection(con));
StringWriter sw = new StringWriter();
try {
liquibase.update(null, sw);
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}
System.out.println(sw.toString());
}
private Connection getOracleConnection(String url, String username, String password) {
try {
Class.forName(“oracle.jdbc.OracleDriver”);
Connection con = DriverManager.getConnection(url, username, password);
return con;
} catch (SQLException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return null;
}
}
This is the exception throw:
- liquibase.exception.MigrationFailedException: Migration failed for change set C:/temp/changelog3.xml::2::chris:
Reason: java.lang.NumberFormatException: For input string: "19,0":
Caused By: For input string: "19,0"
liquibase.exception.MigrationFailedException: Migration failed for change set C:/temp/changelog3.xml::2::chris:
Reason: java.lang.NumberFormatException: For input string: "19,0":
Caused By: For input string: "19,0"
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:235)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:25)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:39)
at liquibase.Liquibase.update(Liquibase.java:112)
at liquibase.Liquibase.update(Liquibase.java:134)
at nl.chriswesdorp.dbrevisionautomator.App.run(App.java:36)
at nl.chriswesdorp.dbrevisionautomator.App.main(App.java:21)
Caused by: java.lang.NumberFormatException: For input string: "19,0"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:458)
at java.lang.Integer.parseInt(Integer.java:499)
at liquibase.database.typeconversion.core.AbstractTypeConverter.getDataType(AbstractTypeConverter.java:218)
at liquibase.database.typeconversion.core.AbstractTypeConverter.getDataType(AbstractTypeConverter.java:156)
at liquibase.sqlgenerator.core.CreateTableGenerator.generateSql(CreateTableGenerator.java:45)
at liquibase.sqlgenerator.core.CreateTableGenerator.generateSql(CreateTableGenerator.java:19)
at liquibase.sqlgenerator.SqlGeneratorChain.generateSql(SqlGeneratorChain.java:29)
at liquibase.sqlgenerator.SqlGeneratorFactory.generateSql(SqlGeneratorFactory.java:119)
at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:21)
at liquibase.executor.LoggingExecutor.outputStatement(LoggingExecutor.java:77)
at liquibase.executor.LoggingExecutor.execute(LoggingExecutor.java:43)
at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:893)
at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:880)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:211)
... 6 more
Regards,
Chris