From ec1e703f787b8c545a782acd6f6d75428b585a8a Mon Sep 17 00:00:00 2001 From: Brett Bender Date: Sat, 20 Jan 2024 01:41:56 -0600 Subject: [PATCH] ensure shelf name is unique --- internal/types/shelves.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/types/shelves.go b/internal/types/shelves.go index 1fabb4e..efef07f 100644 --- a/internal/types/shelves.go +++ b/internal/types/shelves.go @@ -12,7 +12,7 @@ import ( type ShelfLocation struct { ID uint64 `gorm:"primarykey" json:"id"` - Name string `json:"name"` + Name string `gorm:"index:unique" json:"name"` RoomNumber string `json:"room_number,omitempty"` Description string `json:"description,omitempty"` BuildingID uint64 `json:"-"`