Create new table + view regex_whitelist + rename old regex table to regex_blacklist. This updates the gravity.db version to 3.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-07-08 21:23:46 +02:00
parent 3d3fc2947e
commit 054c7a2c05
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD
6 changed files with 62 additions and 18 deletions

View file

@ -29,4 +29,11 @@ upgrade_gravityDB(){
database_table_from_file "domain_audit" "${auditFile}"
fi
fi
if [[ "$version" == "2" ]]; then
# This migration script upgrades the gravity.db file by
# renaming the regex table to regex_blacklist, and
# creating a new regex_whitelist table + corresponding linking table and views
sqlite3 "${database}" < "/etc/.pihole/advanced/Scripts/database_migration/gravity/2_to_3.sql"
version=3
fi
}