Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I generate a changelog unique constraint is mentioned (changing nothing in db) #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fleboulch
Copy link
Owner

@fleboulch fleboulch commented Jan 20, 2023

Configuration

  • liquibase 4.19.0
  • database: postgresql 14.5
  • database is created at the startup of the app with liquibase (check this file for more details)

Steps to reproduce

  1. Clone this repository
  2. Check you are using JDK 11 or 17
  3. Start the postgresql database with docker: docker-compose -f src/main/docker/postgresql.yml up
  4. Run the app with the command ./mvnw
  5. Once started you should get the following log Application 'mavenPostgre' is running!
  6. You can check the content of the database (connexion information). If you want to see the unique constraints you can type the following query
SELECT *
FROM pg_constraint
WHERE conrelid =
      (SELECT oid
       FROM pg_class
       WHERE relname LIKE 'jhi_user'
       AND contype = 'u');
  1. Then you can generate a changelog with liquibase with ./mvnw compile liquibase:diff (I'm using the maven liquibase plugin with this configuration)

Actual behaviour

The generated changelog looks like the file in this PR (containing 2 changesets)

Expected behaviour

The generated changelog should be empty.

  • the 2 changesets should not be here as the constraint is already created here (even if I change the unique constraint name from ux_user_login to UC_JHI_USERLOGIN_COL on this file the generated changelog is the same)

Note

  1. Another unique constraint is registered and it never appears in the generated changelog here
  2. The JPA entities are defined here

@fleboulch fleboulch changed the title Generated changelog When I generate a changelog unique constraint is mentioned (changing nothing in db) Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant