Can't create a auto-increment column

I have a table called event. It already has records in it. I want to add an auto-increment column to event table. I created a changelog file.

<addColumn tableName="event" >
      <column name="id" type="BIGINT" autoIncrement="true" afterColumn="event_id">
            <constraints nullable="false" unique="true" uniqueConstraintName="id_auto_increment"/>
       </column>
 </addColumn>

But when I start my application, I’m getting the following error.
Validation Failed: 1 changes have validation failures Cannot add a non-primary key identity column.
Can someone help me to add an auto-increment column in the correct way? Thanks

Hi @devd ,

What database are you deploying to? Is this PostgreSQL, Oracle, or other?

I was able to successfully run this changeset on my PostgreSQL database.

Also let us know what version of Liquibase you are using.

Hi @amalik ,

I’m using MySQL and liquibase version is 4.3.5

Are you looking for something like this SO post?