Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

liquibase defaultValue vs defaultValueNumeric

Tags:

liquibase

Can anyone tell me the difference between specifying a defaultValue="0" vs a defaultValueNumeric="0" in a changeset? It's for a bigint column.

http://www.liquibase.org/manual/add_default_value doesn't really go into detail here.

like image 794
PapaFreud Avatar asked Sep 01 '11 08:09

PapaFreud


1 Answers

The difference is that defaultValue puts quotes around the value in the resulting SQL. Many database will interpret inserting '42' into a numeric field as the number 42, but some fail. defaultValueNumeric tells liquibase it is a number and therefore will not be quoted and will work on all database types.

like image 179
Nathan Voxland Avatar answered Oct 19 '22 03:10

Nathan Voxland