mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user