Search code examples
voltdbvolt

How to drop existing constrain on colum in Voltdb with LiquideBase


I'm working with Vold DB and Liquid base. I have one existing table with all column having nullable=false constrain

LiquidBase Code

<changeSet>

        <changeSet author="abc.xyz" id="123 >
        <createTable   tableName="TBLM_MY_TABLE_NAME">

    <column name="SOME_OTHER_COLUMS" type="VARCHAR(100)">
            <constraints nullable="false"/>
        </column>
        <column name="MOBILE_NUMBER" type="VARCHAR(100)">
                <constraints nullable="false"/>
        </column>

        </createTable>     

 </changeSet>

Now this table is already created in Volt DB.

Now i want to remove this existing constrain nullable from particular column "MOBILE_NUMBER"

I referred Voltdb site and liquid base site both. tried some given example also but not able to remove it.

i.e From Volt Site :

ALTER TABLE Airport DROP CONSTRAINT uniquecode;

Liquid Base site :

<dropNotNullConstraint

need guidance to solve this issue either via Liquid base or any Voltdb query


Solution

  • Finally I found the solution.

    Query is : ALTER TABLE TBLM_TABLE_NAME ALTER COLUMN MOBILE_NUMBER SET NULL

    Reference : https://docs.voltdb.com/UsingVoltDB/ddlref_altertable.php