xml(打补丁)设置timestamp类型指定的默认值以及varchar2类型的默认值

<addColumn tableName="bdwcssz">
            <column name="bdwxz" type="varchar2(20)" defaultValue="zqrxz01">
                <constraints nullable="false"/>
            </column>
            <column name="init_time" type="timestamp"
                    defaultValueComputed="to_timestamp('2020-07-01 00:00:00','yyyy-mm-dd hh24:mi:ss')">
                <constraints nullable="false"/>
            </column>
        </addColumn>

因为需求的变动,有些表已经被用户用上了,但是需要增加字段,而且字段是不可为空的,那么就需要设置默认值了,

varchar2类型设置默认值直接使用defaultValue就可以了,

timestamp类型需要使用defaultValueComputed

原文地址:https://www.cnblogs.com/pzw23/p/13476193.html