mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-27 22:20:51 +08:00
33 lines
716 B
Go
33 lines
716 B
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// Storage holds the schema definition for the Storage entity.
|
|
type Storage struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the Storage.
|
|
func (Storage) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("name").Unique(),
|
|
field.Enum("implementation").Values("webdav", "local", "alist"),
|
|
field.String("tv_path").Optional(),
|
|
field.String("movie_path").Optional(),
|
|
field.String("settings").Optional(),
|
|
field.Bool("deleted").Default(false),
|
|
field.Bool("default").Default(false),
|
|
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
|
}
|
|
}
|
|
|
|
// Edges of the Storage.
|
|
func (Storage) Edges() []ent.Edge {
|
|
return nil
|
|
}
|