Sunday, May 29, 2022

 

Liquibase 3.6.x data types mapping table

Designing a database, you have to choose data types for columns. It is not neutral which one is used. When you use Liquibase, you use an additional abstraction layer as it has its own data types. They are mapped to data types proper to a specific database engine later during scripts execution process. Choosing a data type, you should keep in mind the final data type on your database engine.

Data types mapping in Liquibase 3.6.x

Liquibase data typeSQL Server data typeOracle data typeMySQLPostgreSQL
bigintbigintnumber(38,0)bigintbigint/bigserial
blobvarbinary(max)blobbloboid
booleanbitnumber(1)bitbit
charcharcharcharcharacter
clobnvarchar(max)cloblongtexttext
currencymoneynumber(15,2)decimaldecimal
datetimedatetimetimestamptimestamptimestamp
datedatedatedatedate
decimaldecimaldecimaldecimaldecimal 
doublefloatfloat(24)doubledouble precision
floatfloatfloatfloatfloat
intintintegerintinteger/serial
mediumintintmediumintmediumintmediumint
ncharncharncharncharnchar
nvarcharnvarcharnvarchar2nvarcharvarchar
numbernumericnumbernumericnumeric
smallintsmallintnumber(5)smallintsmallint/smallserial
timetimedatetimetime
timestampdatetimetimestamptimestamptimestamp
tinyinttinyintnumber(3)tinyintsmallint
uuiduniqueidentifierraw(16)char(36)uuid
varcharvarcharvarchar2 varcharvarchar/character (varying)

For other Liquibase articles, please read:

Database versioning - theory [video]

Database versioning part 2 - Liquibase - how to use [video]

No comments:

Post a Comment

So sánh các GitFlow model và áp dụng với CICD

https://medium.com/oho-software/so-s%C3%A1nh-c%C3%A1c-gitflow-model-v%C3%A0-%C3%A1p-d%E1%BB%A5ng-v%E1%BB%9Bi-cicd-b6581cfc893a