Skip to content

Commit cca2168

Browse files
committed
reference to previous ID
1 parent 2bdd798 commit cca2168

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

share/model.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type ProtoShare struct {
4242
Permissions uint8
4343
Orphan bool
4444
Expiration datatypes.NullTime
45+
PreviousID uint `gorm:"uniqueIndex"`
4546
}
4647

4748
type Share struct {
@@ -65,10 +66,10 @@ type PublicLink struct {
6566

6667
type ShareState struct {
6768
gorm.Model
68-
ShareID uint `gorm:"foreignKey:ShareID;references:ID"` // Define the foreign key field
69+
ShareID uint `gorm:"foreignKey:ShareID;references:ID;uniqueIndex:compositeindex"` // Define the foreign key field
6970
Share Share // Define the association
7071
// Can not be uid because of lw accs
71-
User string
72+
User string `gorm:"uniqueIndex:compositeindex"`
7273
Synced bool
7374
Hidden bool
7475
Alias string

0 commit comments

Comments
 (0)