开发者

liquibase defaultValue vs defaultValueNumeric

开发者 https://www.devze.com 2023-04-01 14:37 出处:网络
Can anyone tell me the difference between specifying a defaultValue=\"0\" vs a defaultValueNumeric=\"0\" in a changeset开发者_开发问答? It\'s for a bigint column.

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消