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

Diff on OneToOne optional false #219

Closed
louis-neologix opened this issue Jan 14, 2020 · 0 comments · Fixed by #679
Closed

Diff on OneToOne optional false #219

louis-neologix opened this issue Jan 14, 2020 · 0 comments · Fixed by #679

Comments

@louis-neologix
Copy link

louis-neologix commented Jan 14, 2020

When I add the attribute optional to false on a OneToOne link :

@OneToOne(optional = false)
private Address address;

The diff changelog contains the following changesets :

databaseChangeLog:
- changeSet:
    id: 1579006019496-2
    author: louis (generated)
    changes:
    - addUniqueConstraint:
        columnNames: address_id
        constraintName: UK_hdhcc7238a2lwr4yjw78qvlof
        tableName: contact
- changeSet:
    id: 1579006019496-1
    author: louis (generated)
    changes:
    - addNotNullConstraint:
        columnDataType: bigint
        columnName: address_id
        tableName: contact

Then, each time I generate the diff change log, it recreates the unique constraint :

databaseChangeLog:
- changeSet:
    id: 1579006765086-1
    author: louis (generated)
    changes:
    - dropUniqueConstraint:
        constraintName: UK_hdhcc7238a2lwr4yjw78qvlof
        tableName: contact
    - addUniqueConstraint:
        columnNames: address_id
        constraintName: UK_hdhcc7238a2lwr4yjw78qvlof
        tableName: contact

If I use the liquidbase diff command, it display the following infos :

Changed Unique Constraint(s): 
     UK_hdhcc7238a2lwr4yjw78qvlof on contact(address_id)
          clustered changed from 'null' to 'false'

Any idea of what cause this behavior ?

Thanks

┆Issue is synchronized with this Jira Bug by Unito

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants