Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class UserEntity implements UserDetails {
private String phoneNumber;

@ToString.Exclude
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "default_address_id")
@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "default_address_id", unique = true)
private AddressEntity defaultAddress;

@ElementCollection(fetch = FetchType.EAGER)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changelog/db.changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
<include file="db/changelog/migrations/241201215506-changelog.xml"/>
<include file="db/changelog/migrations/241223151914-changelog.xml"/>
<include file="db/changelog/migrations/241230175909-changelog.xml"/>
<include file="db/changelog/migrations/241230180613-changelog.xml"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.30.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
<changeSet id="1735578373817-1" author="gkhaavik">
<addUniqueConstraint columnNames="default_address_id" constraintName="uc_users_default_address"
tableName="users"/>
</changeSet>

</databaseChangeLog>
Loading