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:
DingDongSoLong4
2023-07-13 04:15:02 +02:00
committed by GitHub
parent 67d4f9729a
commit 5580525c2d
74 changed files with 520 additions and 807 deletions

View File

@@ -69,8 +69,8 @@ func Test_PerformerStore_Create(t *testing.T) {
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
birthdate = models.NewDate("2003-02-01")
deathdate = models.NewDate("2023-02-01")
birthdate, _ = models.ParseDate("2003-02-01")
deathdate, _ = models.ParseDate("2023-02-01")
)
tests := []struct {
@@ -217,8 +217,8 @@ func Test_PerformerStore_Update(t *testing.T) {
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
birthdate = models.NewDate("2003-02-01")
deathdate = models.NewDate("2023-02-01")
birthdate, _ = models.ParseDate("2003-02-01")
deathdate, _ = models.ParseDate("2023-02-01")
)
tests := []struct {
@@ -400,8 +400,8 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
createdAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
updatedAt = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
birthdate = models.NewDate("2003-02-01")
deathdate = models.NewDate("2023-02-01")
birthdate, _ = models.ParseDate("2003-02-01")
deathdate, _ = models.ParseDate("2023-02-01")
)
tests := []struct {