Skip to content

Commit 66af487

Browse files
committed
Added two more fields to OcmReceivedShare + extra renames
1 parent 82b3d7b commit 66af487

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog/unreleased/ocm-model-refactor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ some fields for better consistency:
1717
* The `(FileIdPrefix, ItemSource)` tuple is now
1818
`(StorageId, FileId)` in `OcmShare`, and it was
1919
removed from `OcmReceivedShare` as unused
20+
* `Alias` and `Hidden` were added in `OcmReceivedShare`
2021

2122
https://github.com/cs3org/reva/pull/5402

pkg/share/manager/sql/model/model.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ type PublicLink struct {
153153
// ShareState represents the state of a share for a specific recipient.
154154
type ShareState struct {
155155
gorm.Model
156-
ShareID uint `gorm:"uniqueIndex:i_shareid_user"` // Define the foreign key field
156+
ShareID uint `gorm:"uniqueIndex:u_shareid_user"` // Define the foreign key field
157157
Share Share `gorm:"foreignKey:ShareID;references:Id"` // Define the association
158-
User string `gorm:"uniqueIndex:i_shareid_user;size:255"` // Can not be uid because of lw accounts
158+
User string `gorm:"uniqueIndex:u_shareid_user;size:255"` // Can not be uid because of lw accounts
159159
Synced bool
160160
Hidden bool
161161
Alias string `gorm:"size:64"`
@@ -203,6 +203,8 @@ type OcmReceivedShare struct {
203203
Expiration sql.NullInt64 `gorm:"default:null"`
204204
Type OcmShareType `gorm:"index:i_ocmrecshare_type;not null"`
205205
State OcmShareState `gorm:"index:i_ocmrecshare_state;not null"`
206+
Alias string `gorm:"size:64"`
207+
Hidden bool
206208
}
207209

208210
// OcmReceivedShareProtocol represents the protocol used to access an OCM share received from a remote user.

0 commit comments

Comments
 (0)