feat(db): align movie state with canonical MediaState #85
Reference in New Issue
Block a user
Delete Branch "issue/73-movie-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #73.
movies.stateusedmissing|grabbed|imported, predating arr-core's canonicalMediaStatevocabulary (missing|downloading|available) that series/episodes already follow.Migration
0007_movie_state_canonical.sqlrebuilds themoviestable with the newCHECKconstraint and renames existing rows in place (grabbed->downloading,imported->available). SQLite can't alter aCHECKconstraint in place, and the rebuild drops the old table, which would cascade-deletemovie_releasesthrough its FK -- the migration stashes those rows and restores them once the newmoviestable exists with the same ids. The two triggers0005defines onmoviesare recreated for the same reason (DROP TABLEdrops triggers with it).Updated the two places that wrote the old vocabulary (
arr-daemon's grab action and its test). Added a regression test that runs the pre-#73 migrations, inserts rows under the old vocabulary, then runs the rest and checks they land on the new names.Reviewed
6c1900be14137698bed33149234aa8cbc36d715d. No findings.\n\n