Liquibase handling Default data and then adding data from hibernate in same table gives error

I am using liquibase to insert default user in database in admin table. I am using my web application (Spring boot, Hibernate ) to register new users. After populating database with default admin user, when i first try to add new user from web application in same admin table i get duplicate key value violates unique constraint Key already exists error

In my entity i have used GenerationType AUTO I have also tried with using SEQ and Table strategy but no fix.
How do i fix this issue so when a new user is added after default user added from liquibase it does not give you error

Thanks in advance

Hello, if i understand,

1 - you added a new user in admin table by a changeset that ran.
2 - After this, you tried to add a new user via your web application in the same table.

At my first read, it seems to be an error in your code.
The error is explicit : You tried to insert a user with a unique id already existing in your table.

  • Verify that the PRIMARY_KEY (admin.ID or admin.ADMIN_ID or the column name you chose) has AUTO_INCREMENT setted.

  • Verify that you didn’t set an ID explicitly in your DAO query which inserts a new user and your changeset that creates the default user. Normally it is automatically generated by mysql.
    With AUTO_INCREMENT you don’t need to specify explicitly this column and value in your insert query.

  • Verify the annotation or strategy generation of your id attribute in your entity Admin :

@Id @GeneratedValue(strategy=GenerationType.AUTO)
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)

Hoping that it helped you.