Backend: Refactor person entity #98 #144

Database column types are now UPPERCASE so that developers can easily recognize them. After upgrading to GORM 2.0, we can use generic types instead.

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-09-13 17:51:43 +02:00
parent 768f9b3064
commit 84b17194af
23 changed files with 158 additions and 183 deletions

View File

@@ -11,9 +11,9 @@ type DuplicatesMap map[string]Duplicate
// Duplicate represents an exact file duplicate.
type Duplicate struct {
FileName string `gorm:"type:varbinary(768);primary_key;" json:"Name" yaml:"Name"`
FileRoot string `gorm:"type:varbinary(16);primary_key;default:'/';" json:"Root" yaml:"Root,omitempty"`
FileHash string `gorm:"type:varbinary(128);default:'';index" json:"Hash" yaml:"Hash,omitempty"`
FileName string `gorm:"type:VARBINARY(768);primary_key;" json:"Name" yaml:"Name"`
FileRoot string `gorm:"type:VARBINARY(16);primary_key;default:'/';" json:"Root" yaml:"Root,omitempty"`
FileHash string `gorm:"type:VARBINARY(128);default:'';index" json:"Hash" yaml:"Hash,omitempty"`
FileSize int64 `json:"Size" yaml:"Size,omitempty"`
ModTime int64 `json:"ModTime" yaml:"-"`
}