Rename a foreign key constraint in ManyToMany
spring-boot-starter-parent 2.4.1
spring-boot-starter-data-jpa
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "clients__semantics_permissions",
joinColumns = {
@JoinColumn(name = "client_id", foreignKey = @ForeignKey(name = "client_fk"))
}
)
private Set<LevelTwoBase> semantics_level_two_base = new HashSet<LevelTwoBase>();
This results in:
# \d clients__semantics_permissions
Table "public.clients__semantics_permissions"
Column | Type | Collation | Nullable | Default
-----------------------------+---------+-----------+----------+---------
client_id | integer | | not null |
semantics_level_two_base_id | integer | | not null |
Indexes:
"clients__semantics_permissions_pkey" PRIMARY KEY,
btree (client_id, semantics_level_two_base_id)
Foreign-key constraints:
"fk5nepw5pnbbeewptg0a3tft563" FOREIGN KEY (semantics_level_two_base_id) REFERENCES semantics__level_two_base(id)
"semantics_fk" FOREIGN KEY (client_id) REFERENCES clients__branch(id)
I don't know how to rename the foreign key for semantics_level_two_base_id. In other words I just don't like that fk5nepw5pnbbeewptg0a3tft563.
from Recent Questions - Stack Overflow https://ift.tt/3nMQS1o
https://ift.tt/eA8V8J
Comments
Post a Comment