I'm new to Liquibase + Hibernate.
I have a table named Users, with columns {Id, FirstName, LastName, YearOfBirth, .....}. I set with Hibernate annotation a unique constraint for the couple {Id, LastName}.
Now, I decided that I want to update the constraint, to include the FirstName column, meaning I want my unique constraint to be {Id, FirstName, LastName}. Can this be done through Liquibase, on my existing db, through a changeset?
I thought about dropping the old constraint through a changeset, and creating the new constraint with another. The problem is, I don't know the name of the old constraint, neither the names of the indexes following it. And since Liquibase/Hibernate auto-generate names for the constraints/indexes, I don't want to search through a query to fetch the specific constraint name.
I'm searching for a solution that is more generic, so I can tackle same future issues.
Any suggestions?
I'm using Java 8, Hibernate 5.2.10, Liquibase 3.5.2