moonfire-nvr/db
Scott Lamb 433be217ac improve test of upgrade from v0 on up; fix bugs
Now the test actually has a recording and garbage with matching files.
This caught a few problems in the upgrade procedure:

* it didn't work with foreign keys enabled because the new recording
  table was set up after the new camera table, and the old recording
  table was destroyed after the old camera table. And now I enable
  foreign keys all the time. Reorder the procedure to fix.

* the pathname manipulation in the v2 to v3 procedure was incorrect
  since my introduction of nix because I gave it a &[u8] with the
  trailing nul, where I should have used CStr::from_bytes_with_nul.

* it wasn't removing garbage files. It'd be most natural to do this
  in the v2 to v3 upgrade (with the rename) but I historically removed
  the table when upgrading to v2. I can't redefine the schema now, so
  do it unnaturally.

  I'm considering also renaming all uuid-like files on upgrade to v4/v5
  to clean up this mess automatically for installations that have
  already done this upgrade.
2019-07-21 22:49:50 -07:00
..
proto Use fixed-size directory meta files 2019-07-04 23:30:37 -05:00
testdata initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
upgrade improve test of upgrade from v0 on up; fix bugs 2019-07-21 22:49:50 -07:00
auth.rs fix db auth tests for domain being optional 2019-06-20 12:06:57 -07:00
build.rs add missing build.rs 2019-06-19 16:53:14 -07:00
Cargo.toml use the nix repository again 2019-07-20 16:13:12 -07:00
check.rs s/std::fs::read_dir/nix::dir::Dir/ in a few spots 2019-07-12 11:07:14 -07:00
coding.rs initial split of database to a separate crate 2018-02-20 23:15:39 -08:00
compare.rs fix d7a918d regression in SQLite required version 2019-07-11 14:00:09 -07:00
db.rs s/std::fs::read_dir/nix::dir::Dir/ in a few spots 2019-07-12 11:07:14 -07:00
dir.rs update deps 2019-07-17 14:32:09 -07:00
fs.rs s/std::fs::read_dir/nix::dir::Dir/ in a few spots 2019-07-12 11:07:14 -07:00
lib.rs s/std::fs::read_dir/nix::dir::Dir/ in a few spots 2019-07-12 11:07:14 -07:00
raw.rs cargo fix --all 2019-06-14 08:47:11 -07:00
recording.rs db crate support for updating signals (#28) 2019-06-13 22:25:55 -07:00
schema.sql Use fixed-size directory meta files 2019-07-04 23:30:37 -05:00
signal.rs fix dumb typo bug in signal/state input validation 2019-06-14 16:41:18 -07:00
testutil.rs improve test of upgrade from v0 on up; fix bugs 2019-07-21 22:49:50 -07:00
writer.rs s/std::fs::read_dir/nix::dir::Dir/ in a few spots 2019-07-12 11:07:14 -07:00