Liquibase defaultValue vs defaultValueNumeric

Can someone tell me the difference between specifying defaultValue = "0" and the default valueValueNumeric = "0" in the change set? This is for the bigint column.

http://www.liquibase.org/manual/add_default_value is not considered in detail here.

+6
source share
1 answer

The difference is that defaultValue quotes around the value in the resulting SQL. Many databases interpret the insertion of “42” in a number field as the number 42, but some of them fail. defaultValueNumeric tells Liquibase that it is a number, and therefore will not be specified and will work in all types of databases.

+6
source

Source: https://habr.com/ru/post/896387/


All Articles