diff --git a/scripts/createdb.sh b/scripts/createdb.sh index 920fe23..4c66ff3 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); EOF chown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.db chmod g+w $HOME/BirdNET-Pi/scripts/birds.db diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index be307e7..2361ed5 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;then fi sudo 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-reload restart_services.sh