mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Docs: Improve code comments in internal/entity/file*.go
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -13,7 +13,7 @@ const (
|
||||
FileSyncUploaded = "uploaded"
|
||||
)
|
||||
|
||||
// FileSync represents a one-to-many relation between File and Account for syncing with remote services.
|
||||
// FileSync tracks the synchronization status for a file on an external service.
|
||||
type FileSync struct {
|
||||
RemoteName string `gorm:"primary_key;auto_increment:false;type:VARBINARY(255)"`
|
||||
ServiceID uint `gorm:"primary_key;auto_increment:false"`
|
||||
@@ -34,7 +34,7 @@ func (FileSync) TableName() string {
|
||||
return "files_sync"
|
||||
}
|
||||
|
||||
// NewFileSync creates a new entity.
|
||||
// NewFileSync creates a new sync record with status preset to "new".
|
||||
func NewFileSync(accountID uint, remoteName string) *FileSync {
|
||||
result := &FileSync{
|
||||
ServiceID: accountID,
|
||||
@@ -45,12 +45,12 @@ func NewFileSync(accountID uint, remoteName string) *FileSync {
|
||||
return result
|
||||
}
|
||||
|
||||
// Updates multiple columns in the database.
|
||||
// Updates mutates multiple columns on the existing row.
|
||||
func (m *FileSync) Updates(values interface{}) error {
|
||||
return UnscopedDb().Model(m).UpdateColumns(values).Error
|
||||
}
|
||||
|
||||
// Update a column in the database.
|
||||
// Update mutates a single column on the existing row.
|
||||
func (m *FileSync) Update(attr string, value interface{}) error {
|
||||
return UnscopedDb().Model(m).UpdateColumn(attr, value).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user