From e7614de332c49bb8535082e4230ca5f4d034974e Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Mon, 25 Jul 2022 16:56:02 +0200 Subject: [PATCH] Update pialert_patch_DB.sh --- install/pialert_patch_DB.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install/pialert_patch_DB.sh b/install/pialert_patch_DB.sh index fd99ca26..bc036abb 100755 --- a/install/pialert_patch_DB.sh +++ b/install/pialert_patch_DB.sh @@ -1,5 +1,7 @@ #!/bin/sh +DB_NAME="pialert.db" echo "Create backup before insert new table" -cp ../db/pialert.db ../db/pialert.db.bak -echo "Insert new table 'Online_History' to pialert.db" -sqlite3 ../db/pialert.db "CREATE TABLE 'Online_History' ('Index' INTEGER, 'Scan_Date' TEXT, 'Online_Devices' INTEGER, 'Down_Devices' INTEGER, 'All_Devices' INTEGER, 'Archived_Devices' INTEGER, PRIMARY KEY('Index' AUTOINCREMENT));" +cp ../db/$DB_NAME ../db/pialert.db.bak +echo "Insert new table 'Online_History' to $DB_NAME" +sqlite3 ../db/$DB_NAME "CREATE TABLE 'Online_History' ('Index' INTEGER, 'Scan_Date' TEXT, 'Online_Devices' INTEGER, 'Down_Devices' INTEGER, 'All_Devices' INTEGER, 'Archived_Devices' INTEGER, PRIMARY KEY('Index' AUTOINCREMENT));" +