mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +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:
@@ -57,7 +57,7 @@ func Test_imageQueryBuilder_Create(t *testing.T) {
|
||||
rating = 60
|
||||
ocounter = 5
|
||||
url = "url"
|
||||
date = models.NewDate("2003-02-01")
|
||||
date, _ = models.ParseDate("2003-02-01")
|
||||
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
|
||||
@@ -216,7 +216,7 @@ func Test_imageQueryBuilder_Update(t *testing.T) {
|
||||
title = "title"
|
||||
rating = 60
|
||||
url = "url"
|
||||
date = models.NewDate("2003-02-01")
|
||||
date, _ = models.ParseDate("2003-02-01")
|
||||
ocounter = 5
|
||||
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
@@ -396,7 +396,7 @@ func Test_imageQueryBuilder_UpdatePartial(t *testing.T) {
|
||||
title = "title"
|
||||
rating = 60
|
||||
url = "url"
|
||||
date = models.NewDate("2003-02-01")
|
||||
date, _ = models.ParseDate("2003-02-01")
|
||||
ocounter = 5
|
||||
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
@@ -965,10 +965,6 @@ func makeImageWithID(index int) *models.Image {
|
||||
ret := makeImage(index)
|
||||
ret.ID = imageIDs[index]
|
||||
|
||||
if ret.Date != nil && ret.Date.IsZero() {
|
||||
ret.Date = nil
|
||||
}
|
||||
|
||||
ret.Files = models.NewRelatedFiles([]file.File{makeImageFile(index)})
|
||||
|
||||
return ret
|
||||
@@ -2877,7 +2873,7 @@ func TestImageQuerySorting(t *testing.T) {
|
||||
"date",
|
||||
models.SortDirectionEnumDesc,
|
||||
imageIdxWithTwoGalleries,
|
||||
imageIdxWithPerformerParentTag,
|
||||
imageIdxWithGrandChildStudio,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user