I want to put multiple unique constraints on a single column in Gorm

Asked 1 years ago, Updated 1 years ago, 79 views

I'd like to place multiple unique constraints on a single column in Gorm.

typeObject structure{
    Z string `gorm: "unique_index:unique_a;unique_index:unique_b"`
    A string `gorm: "unique_index:unique_a"`
    B string `gorm: "unique_index:unique_b"`
}

The constraint does not apply to z when described above.

How can I describe it?

mysql go gorm

2022-09-30 11:51

1 Answers

unique_index:unique_uid, unique_username resolved.

--This answer is a community wik that asks questions posted as CommentReposted by i.


2022-09-30 11:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.