mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
feat: add create_time to db
This commit is contained in:
@@ -2,6 +2,7 @@ package schema
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -34,6 +35,7 @@ func (DownloadClients) Fields() []ent.Field {
|
||||
field.Bool("remove_completed_downloads").Default(true),
|
||||
field.Bool("remove_failed_downloads").Default(true),
|
||||
field.String("tags").Default(""),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -23,6 +25,7 @@ func (Episode) Fields() []ent.Field {
|
||||
field.Enum("status").Values("missing", "downloading", "downloaded").Default("missing"),
|
||||
field.Bool("monitored").Default(false).StructTag("json:\"monitored\""), //whether this episode is monitored
|
||||
field.String("target_file").Optional(),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
@@ -26,6 +28,7 @@ func (History) Fields() []ent.Field {
|
||||
field.String("link").Optional().Comment("deprecated, use hash instead"), //should be magnet link
|
||||
field.String("hash").Optional().Comment("torrent hash"),
|
||||
field.Enum("status").Values("running", "success", "fail", "uploading", "seeding", "removed"),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
//field.String("saved").Optional().Comment("deprecated"), //deprecated
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
@@ -25,6 +27,7 @@ func (Indexers) Fields() []ent.Field {
|
||||
field.String("api_key").Optional(),
|
||||
field.String("url").Optional(),
|
||||
field.Bool("synced").Optional().Default(false).Comment("synced from prowlarr"),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ func (Media) Fields() []ent.Field {
|
||||
field.JSON("limiter", MediaLimiter{}).Optional(),
|
||||
field.JSON("extras", MediaExtras{}).Optional(),
|
||||
field.JSON("alternative_titles", []AlternativeTilte{}).Optional(),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
@@ -20,6 +22,7 @@ func (Storage) Fields() []ent.Field {
|
||||
field.String("settings").Optional(),
|
||||
field.Bool("deleted").Default(false),
|
||||
field.Bool("default").Default(false),
|
||||
field.Time("create_time").Optional().Default(time.Now).Immutable(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user