mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34: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:
@@ -7,13 +7,12 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stashapp/stash/pkg/sqlite"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestChapterFindByGalleryID(t *testing.T) {
|
||||
withTxn(func(ctx context.Context) error {
|
||||
mqb := sqlite.GalleryChapterReaderWriter
|
||||
mqb := db.GalleryChapter
|
||||
|
||||
galleryID := galleryIDs[galleryIdxWithChapters]
|
||||
chapters, err := mqb.FindByGalleryID(ctx, galleryID)
|
||||
@@ -24,7 +23,7 @@ func TestChapterFindByGalleryID(t *testing.T) {
|
||||
|
||||
assert.Greater(t, len(chapters), 0)
|
||||
for _, chapter := range chapters {
|
||||
assert.Equal(t, galleryIDs[galleryIdxWithChapters], int(chapter.GalleryID.Int64))
|
||||
assert.Equal(t, galleryIDs[galleryIdxWithChapters], chapter.GalleryID)
|
||||
}
|
||||
|
||||
chapters, err = mqb.FindByGalleryID(ctx, 0)
|
||||
|
||||
Reference in New Issue
Block a user