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

Re : Oracle VARCHAR2 definition

$
0
0
You can create your own extension of the VarcharType class and override the toDatabaseType() method to change the behavior of what is generated. 

Without adding a new class, the easiest approach may be to use changeset parameters to define a "charUnit" variable. 

In your changelog you can define:

<property name="charUnit" value="" dbms="pgsql"/>
<property name="charUnit" value="CHAR" dbms="oracle"/>

then you can just use <column type="varchar(255 ${charUnit})"/> and liquibase will substitue in CHAR or not depending on the target database.

Nathan

Viewing all articles
Browse latest Browse all 2993

Trending Articles



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