mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-03 06:22:32 -05:00
test and fix signal_camera upgrade problems
- after 3->4 upgrade, it left the foreign key referring to the nonexistent old_camera table. Likely no one who did the upgrade has ever inserted anything into this table, so no one's noticed. - 6->7 upgrade dropped tables in the wrong order, so if there was anything in the signal_camera table, the upgrade would fail.
This commit is contained in:
@@ -457,10 +457,9 @@ pub fn run(_args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
|
||||
composite_id integer not null,
|
||||
primary key (sample_file_dir_id, composite_id)
|
||||
) without rowid;
|
||||
drop index recording_cover;
|
||||
insert into garbage select * from old_garbage;
|
||||
drop table old_garbage;
|
||||
|
||||
drop index recording_cover;
|
||||
alter table recording rename to old_recording;
|
||||
create table recording (
|
||||
composite_id integer primary key,
|
||||
@@ -510,8 +509,8 @@ pub fn run(_args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
|
||||
video_index blob not null check (length(video_index) > 0)
|
||||
);
|
||||
insert into recording_playback select * from old_recording_playback;
|
||||
drop table old_signal;
|
||||
drop table signal_camera;
|
||||
drop table old_signal;
|
||||
drop table old_recording_playback;
|
||||
drop table old_recording_integrity;
|
||||
drop table old_recording;
|
||||
|
||||
Reference in New Issue
Block a user