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