gorm.io/gorm v1.25.4
type OrderItem struct {
UUID string json:"uuid" gorm:"type:char(32);uniqueIndex"
OrderNo string json:"order_no" gorm:"type:char(32);uniqueIndex:order_item_oiu;priority:12"
ItemCode string json:"item_code" gorm:"type:char(32);uniqueIndex:order_item_oiu;priority:13"
UserId string json:"user_id" gorm:"type:char(32);uniqueIndex:order_item_oiu;priority:11"
}
CREATE TABLE order_items (
order_no char(32) COLLATE utf8mb4_general_ci DEFAULT NULL,
item_code char(32) COLLATE utf8mb4_general_ci DEFAULT NULL,
user_id char(32) COLLATE utf8mb4_general_ci DEFAULT NULL,
UNIQUE KEY order_item_oiu (order_no,item_code,user_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨