简体   繁体   中英

Liquibase changelog does not carry the column position or 'AFTER column_name'

To generate a database change log for a table alteration, I use Liquibase. But liquibase change logs doesn't carry specific positions of column name.

The following change set was generated through liquibase

<changeSet author="Nevil" id="234324324324">
    <addColumn tableName="request">
        <column name="revenue" type="DECIMAL(10,2)">
            <constraints nullable="false"/>
        </column>
    </addColumn>
</changeSet>

Suppose if I want column revenue to go after column id in request table, liquibase doesn't take a note of the AFTER clause in alter table commend. In effect I cannot do it with liquibase. Any solution friends ?

I was told that one cannot rely on column order when processing the following query:

SELECT * FROM my_table;

One should always specify the columns required:

SELECT col1, col2, col3 FROM my_table;

Following this advice makes the column order within the table a cosmetic concern.

I'm completely open to correction, but I don't think all databases support adding columns mid-table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM