Rebuild association tables, ensure file-system-based galleries cannot be changed (#2955)

* Re-create tables to include primary keys
* Filesystem-based galleries cannot change images
This commit is contained in:
WithoutPants
2022-09-30 09:18:58 +10:00
committed by GitHub
parent dce90a3ed9
commit ad7fbce5f7
16 changed files with 983 additions and 52 deletions

View File

@@ -768,16 +768,16 @@ func Test_imageQueryBuilder_UpdatePartialRelationships(t *testing.T) {
// only compare fields that were in the partial
if tt.partial.PerformerIDs != nil {
assert.Equal(tt.want.PerformerIDs, got.PerformerIDs)
assert.Equal(tt.want.PerformerIDs, s.PerformerIDs)
assert.ElementsMatch(tt.want.PerformerIDs.List(), got.PerformerIDs.List())
assert.ElementsMatch(tt.want.PerformerIDs.List(), s.PerformerIDs.List())
}
if tt.partial.TagIDs != nil {
assert.Equal(tt.want.TagIDs, got.TagIDs)
assert.Equal(tt.want.TagIDs, s.TagIDs)
assert.ElementsMatch(tt.want.TagIDs.List(), got.TagIDs.List())
assert.ElementsMatch(tt.want.TagIDs.List(), s.TagIDs.List())
}
if tt.partial.GalleryIDs != nil {
assert.Equal(tt.want.GalleryIDs, got.GalleryIDs)
assert.Equal(tt.want.GalleryIDs, s.GalleryIDs)
assert.ElementsMatch(tt.want.GalleryIDs.List(), got.GalleryIDs.List())
assert.ElementsMatch(tt.want.GalleryIDs.List(), s.GalleryIDs.List())
}
})
}