Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Mapping for INTEGER on Oracle changed between Liquibase 2 and 3

$
0
0
It looks like the mapping for Integer columns on Oracle changed in different versions of Liquibase. What was previously generated as NUMBER(38,0) is now coming out as NUMBER(10,0). 

Here's an example create table: 
<changeSet author="Michael Dick" id="create_a_table">
  <createTable schemaName="${defaultSchema}" tableName="MY_TABLE" >
    <column name="ID" type="INTEGER">
      <constraints nullable="false" primaryKey="true" />
  </column>
  </createTable>
</changeSet>

I would expect the type to map to java.sql.Types.INTEGER, which would create an INTEGER or NUMBER(38,0) column. 

Relevant excerpt: 

8.3.6 INTEGER

The JDBC type INTEGER represents a 32-bit signed integer value ranging between -2147483648 and 2147483647.

The corresponding SQL type, INTEGER, is defined in SQL-92 and is widely supported by all the major databases. The SQL-92 standard leaves the precision of INTEGER up to the implementation, but in practice all the major databases support at least 32 bits.

The recommended Java mapping for the INTEGER type is as a Java int.

It looks like the mapping changed due to a different post (approx 4 years ago). The link cited in that post helps migrate from MySQL to Oracle, and doesn't match the JDBC spec (or at least doesn't match the links I provided above).

Is there a way use the more portable INTEGER type, or at least move back to NUMERIC(38,0) ? 

Thanks,
-Michael Dick




Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>