feat(db): SQLite schema and movie migrations #48
Reference in New Issue
Block a user
Delete Branch "issue/4-db"
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 #4.
Movie side of the model in §4:
policies,roots,movies,media_files,releases,grabs,blacklist,owners,title_owners. No series tables —those are #34.
WAL,
foreign_keyson andsynchronous = NORMALare set inSqliteConnectOptions, not in a migration, since SQLite resetsforeign_keysper connection. Tables are
STRICT.Indices cover the four scans the reconcile loop makes, verified by query plan:
EXPLAIN QUERY PLAN
just db-resetrecreates the development database;just db-preparerefreshesthe committed
.sqlxdata, which is what keeps CI off a live database.just cipasses with
DATABASE_URLunset and nodev.dbpresent.Two things worth flagging. The 1080p size band is invented — §5.5 gives numbers
for 4K only, and §14 already marks all of them as placeholders. The
statecolumn is
missing | grabbed | imported, which is my reading of §7.3 and §8rather than something the design spells out; #7 owns the canonical enum and can
tighten the CHECK.
Reviewed
ac0d2a45e5b3bb2393407988d7175651fd5c9a0e. No findings.