A live bird collage card for your Home Assistant dashboard.
issue #521 - DB speed improvements
ehpersonal38df880bc9071a
diff --git a/scripts/createdb.sh b/scripts/createdb.shindex 920fe235..4c66ff38 100755--- a/scripts/createdb.sh+++ b/scripts/createdb.sh@@ -15,6 +15,8 @@ CREATE TABLE IF NOT EXISTS detections (Sens FLOAT,Overlap FLOAT,File_Name VARCHAR(100) NOT NULL);+CREATE INDEX "detections_Com_Name" ON "detections" ("Com_Name");+CREATE INDEX "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);EOFchown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.dbchmod g+w $HOME/BirdNET-Pi/scripts/birds.dbdiff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.shindex be307e70..2361ed56 100755--- a/scripts/update_birdnet_snippets.sh+++ b/scripts/update_birdnet_snippets.sh@@ -152,5 +152,10 @@ if ! grep SF_THRESH /etc/birdnet/birdnet.conf &>/dev/null;thenfisudo chmod +x ~/BirdNET-Pi/scripts/install_language_label_nm.sh+sqlite3 $HOME/BirdNET-Pi/scripts/birds.db << EOF+CREATE INDEX IF NOT EXISTS "detections_Com_Name" ON "detections" ("Com_Name");+CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);+EOF+sudo systemctl daemon-reloadrestart_services.sh