moonfire-nvr/db/upgrade
Scott Lamb 840524ec83 fix a couple v5->v6 schema upgrade problems
* Get rid of unused video_sample_entry rows. h264_reader rejected some
  of these; perhaps they were corrupted by some long-fixed bug.
* Use an i64 for cum_duration_90k (oops); an i32 overflows with only 6.6 hours
  of recording, so this was guaranteed to fail on any real setup.
* Add some context to those errors for debugging.

For posterity, a video_sample_entry that failed:

sqlite> select id, hex(sha1), width, height, rfc6381_codec, hex(data) from video_sample_entry where id = 9;
9|B3607B06107E779F57D062331FB54B59E964B9BC|1920|1080|avc1.640028|000000B26176633100000000000000010000000000000000000000000000000007800438004800000048000000000000000100000000000000000000000000000000000000000000000000000000000000000018FFFF0000005C6176634301640028FFE1002967640028AC1B1A80780227E5C05B808080A000007D0000186A1D0C0029FF5DE5C6860014FFAEF2E140010020A886052ACA0500769C28476EFE104A8000F08781320819888E894B5200000000
2020-06-10 19:38:45 -07:00
..
mod.rs fix a couple v5->v6 schema upgrade problems 2020-06-10 19:38:45 -07:00
v0_to_v1.rs upgrade copyright notices 2020-03-01 22:53:41 -08:00
v0.sql upgrade copyright notices 2020-03-01 22:53:41 -08:00
v1_to_v2.rs switch from docopt to structopt 2020-04-17 21:53:37 -07:00
v1.sql upgrade copyright notices 2020-03-01 22:53:41 -08:00
v2_to_v3.rs style: use rusqlite's {named_,}params! everywhere 2020-03-19 20:46:25 -07:00
v3_to_v4.rs upgrade copyright notices 2020-03-01 22:53:41 -08:00
v3.sql upgrade copyright notices 2020-03-01 22:53:41 -08:00
v4_to_v5.rs upgrade copyright notices 2020-03-01 22:53:41 -08:00
v5_to_v6.rs fix a couple v5->v6 schema upgrade problems 2020-06-10 19:38:45 -07:00
v5.sql schema version 6 with pixel aspect ratio 2020-03-19 21:40:59 -07:00