mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-23 07:18:07 +00:00
Add abp_entries column (default 0) to the adlist table for newly created gravity databases. This updates the gravity database version to 16
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
e0d7e5df85
commit
5459daa03d
@ -128,4 +128,10 @@ upgrade_gravityDB(){
|
|||||||
pihole-FTL sqlite3 "${database}" < "${scriptPath}/14_to_15.sql"
|
pihole-FTL sqlite3 "${database}" < "${scriptPath}/14_to_15.sql"
|
||||||
version=15
|
version=15
|
||||||
fi
|
fi
|
||||||
|
if [[ "$version" == "15" ]]; then
|
||||||
|
# Add column abp_entries to adlist table
|
||||||
|
echo -e " ${INFO} Upgrading gravity database from version 15 to 16"
|
||||||
|
pihole-FTL sqlite3 "${database}" < "${scriptPath}/15_to_16.sql"
|
||||||
|
version=16
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
11
advanced/Scripts/database_migration/gravity/15_to_16.sql
Normal file
11
advanced/Scripts/database_migration/gravity/15_to_16.sql
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
.timeout 30000
|
||||||
|
|
||||||
|
PRAGMA FOREIGN_KEYS=OFF;
|
||||||
|
|
||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE adlist ADD COLUMN abp_entries INTEGER NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
UPDATE info SET value = 16 WHERE property = 'version';
|
||||||
|
|
||||||
|
COMMIT;
|
@ -35,7 +35,8 @@ CREATE TABLE adlist
|
|||||||
date_updated INTEGER,
|
date_updated INTEGER,
|
||||||
number INTEGER NOT NULL DEFAULT 0,
|
number INTEGER NOT NULL DEFAULT 0,
|
||||||
invalid_domains INTEGER NOT NULL DEFAULT 0,
|
invalid_domains INTEGER NOT NULL DEFAULT 0,
|
||||||
status INTEGER NOT NULL DEFAULT 0
|
status INTEGER NOT NULL DEFAULT 0,
|
||||||
|
abp_entries INTEGER NOT NULL DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE adlist_by_group
|
CREATE TABLE adlist_by_group
|
||||||
|
Loading…
Reference in New Issue
Block a user