SQLite model refactoring, part 2 (#3839)

* Treat empty image input as null
* Add validation to models.Date
* Allow zero dates in database
* Make scene_markers.scene_id non-nullable
* Drop scraped_items table
* Remove movie/studio checksum
* Add migration notes
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
DingDongSoLong4
2023-07-13 04:15:02 +02:00
committed by GitHub
parent 67d4f9729a
commit 5580525c2d
74 changed files with 520 additions and 807 deletions

View File

@@ -2,13 +2,10 @@ package models
import (
"time"
"github.com/stashapp/stash/pkg/hash/md5"
)
type Studio struct {
ID int `json:"id"`
Checksum string `json:"checksum"`
Name string `json:"name"`
URL string `json:"url"`
ParentID *int `json:"parent_id"`
@@ -21,7 +18,6 @@ type Studio struct {
}
type StudioPartial struct {
Checksum OptionalString
Name OptionalString
URL OptionalString
ParentID OptionalInt
@@ -36,7 +32,6 @@ type StudioPartial struct {
func NewStudio(name string) *Studio {
currentTime := time.Now()
return &Studio{
Checksum: md5.FromString(name),
Name: name,
CreatedAt: currentTime,
UpdatedAt: currentTime,