Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

addColumn problem

$
0
0

I am having a strange problem when trying to add a new column to a database.


If have changeset that has the following property details

  1.     <property name="boolean.type" value="boolean" dbms="postgresql, hypersql, hsqldb"/>
        <property name="boolean.type" value="bit" dbms="mysql"/>
        <property name="boolean.type" value="smallint" dbms="derby"/>
        <property name="boolean.type" value="numeric(1)" dbms="oracle"/>


Now if I use the following

  1. <changeSet author="UnicentaOpos - John L" id="Create Categories Table">
     <preConditions onFail="MARK_RAN">
        <not>
          <tableExists tableName="CATEGORIES"/>
        </not>
     </preConditions>
  2.     <createTable tableName="CATEGORIES">
         <column name="ID" type="varchar(255)">
             <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="NAME" type="varchar(255)">
             <constraints nullable="false"/>
            </column>
            <column name="PARENTID" type="varchar(255)"/>
            <column name="TEXTTIP" type="varchar(255)" defaultValue="NULL"/>
            <column name="CATSHOWNAME" type="${boolean.type}" defaultValueBoolean="true">
             <constraints nullable="false"/>
            </column>
            <column name="IMAGE" type="${blob.type}"/>
       </createTable>
  3. </changeSet>


The table is created ok, but

If a do the following to add the CATSHOWNAME column when it does not exist.

  1.  <addColumn tableName="CATEGORIES">
            <column name="CATSHOWNAME" type="${boolean.type}" defaultValueBoolean="true">
             <constraints nullable="false"/>
            </column>
     </addColumn>


I get the error that that smallint can hold the value of type Boolean.

Does any one have any Ideas why this is happening.

Thanks



Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>