我创建了一个名为person的表,并使用liquibase变更集添加了一列“phone_number”。但现在我想为它添加一个默认值。但它没有工作,到目前为止,我已经尝试了:
<addDefaultValue columnName="phone_number"
defaultValue="+923331234567"
tableName="person"/>
和
<changeSet author="haseeb" id="20160413123500">
<update tableName="person">
<column name="phone_number" type="varchar(255)" defaultValue="+923331234567"/>
</update>
</changeSet>
和
<changeSet author="haseeb" id="20160413123501">
<update tableName="person">
<column name="phone_number" type="varchar(255)" value="+923331234567"/>
</update>
有人能指出我哪里做错了吗?添加默认值是否会为以前添加的行添加值?
4条答案
按热度按时间kx1ctssn1#
试试这个
0lvr5msh2#
试试这个:
zf2sa74q3#
expression是这样的:
对于boolean:
biswetbf4#
YAML脚本在liquibase中创建表,默认值为string/varchar,integer和timestamp -