Browse Source

fix mysql database cleaner (#1902)

pull/1903/head
Jason Dove 11 months ago committed by GitHub
parent
commit
db6ae27384
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 20
      ErsatzTV/Services/RunOnce/DatabaseCleanerService.cs

2
CHANGELOG.md

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- Fix startup error with MySql backend caused by database cleaner
## [0.8.8-beta] - 2024-09-19
### Added

20
ErsatzTV/Services/RunOnce/DatabaseCleanerService.cs

@ -45,16 +45,16 @@ public class DatabaseCleanerService( @@ -45,16 +45,16 @@ public class DatabaseCleanerService(
await dbContext.Connection.ExecuteAsync(
"""
delete
from MediaItem
where Id not in (select Id from Movie)
and Id not in (select Id from Show)
and Id not in (select Id from Season)
and Id not in (select Id from Episode)
and Id not in (select Id from OtherVideo)
and Id not in (select Id from MusicVideo)
and Id not in (select Id from Song)
and Id not in (select Id from Artist)
and Id not in (select Id from Image)
from `MediaItem`
where Id not in (select Id from `Movie`)
and Id not in (select Id from `Show`)
and Id not in (select Id from `Season`)
and Id not in (select Id from `Episode`)
and Id not in (select Id from `OtherVideo`)
and Id not in (select Id from `MusicVideo`)
and Id not in (select Id from `Song`)
and Id not in (select Id from `Artist`)
and Id not in (select Id from `Image`)
""");
}

Loading…
Cancel
Save