Sorry, this question seems stupid, but I tried 1 hour searching and didn't find anything. So I'm using liquibase for multiple databases(e.g. MSSQL, Oracle and MySQL), when I say:
addColumn(tableName: "ABC_TEST") {
column(name: "IS_ACTIVE", type: "boolean")
}
How do I know if the type "boolean" will be converted to proper types for each database? And is there any documentation I can find for the data type mapping? If I want to add one more column which is foreign key, which type should I use?
Checkout this question (and answers) to see the available types that liquibase offers.
In my answer to that question there is a link to the relevant liquibase classes that do the translation to the db specific types.
When you created the table that has the primary key with a "liquibase type" then liquibase will have translated this to the db specific type. Then your foreign key should just use the same type and liquibase will translate this likewise.
E.g. check out the class BigIntType
.
With liquibase you would just use the "liquibase type": BIGINT
.
On Oracle DBs it will translate to ("NUMBER", 38,0)
.
On MSSQL it will translate to ("BIGINT")
.