mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
SQLite model refactoring (#3791)
* Remove ID from PerformerPartial * Separate studio model from sqlite model * Separate movie model from sqlite model * Separate tag model from sqlite model * Separate saved filter model from sqlite model * Separate scene marker model from sqlite model * Separate gallery chapter model from sqlite model * Move ErrNoRows checks into sqlite, improve empty result error messages * Move SQLiteDate and SQLiteTimestamp to sqlite * Use changesetTranslator everywhere, refactor for consistency * Make PerformerStore.DestroyImage private * Fix rating on movie create
This commit is contained in:
@@ -163,7 +163,7 @@ func TestGetStudioName(t *testing.T) {
|
||||
studioErr := errors.New("error getting image")
|
||||
|
||||
mockStudioReader.On("Find", testCtx, studioID).Return(&models.Studio{
|
||||
Name: models.NullString(studioName),
|
||||
Name: studioName,
|
||||
}, nil).Once()
|
||||
mockStudioReader.On("Find", testCtx, missingStudioID).Return(nil, nil).Once()
|
||||
mockStudioReader.On("Find", testCtx, errStudioID).Return(nil, studioErr).Once()
|
||||
@@ -246,23 +246,15 @@ var validChapters = []*models.GalleryChapter{
|
||||
ID: validChapterID1,
|
||||
Title: chapterTitle1,
|
||||
ImageIndex: chapterImageIndex1,
|
||||
CreatedAt: models.SQLiteTimestamp{
|
||||
Timestamp: createTime,
|
||||
},
|
||||
UpdatedAt: models.SQLiteTimestamp{
|
||||
Timestamp: updateTime,
|
||||
},
|
||||
CreatedAt: createTime,
|
||||
UpdatedAt: updateTime,
|
||||
},
|
||||
{
|
||||
ID: validChapterID2,
|
||||
Title: chapterTitle2,
|
||||
ImageIndex: chapterImageIndex2,
|
||||
CreatedAt: models.SQLiteTimestamp{
|
||||
Timestamp: createTime,
|
||||
},
|
||||
UpdatedAt: models.SQLiteTimestamp{
|
||||
Timestamp: updateTime,
|
||||
},
|
||||
CreatedAt: createTime,
|
||||
UpdatedAt: updateTime,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user