mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge pull request #3318 from pi-hole/tweak/default_group
Rename default group to ... well ... "Default"
This commit is contained in:
commit
e728d7f761
3 changed files with 28 additions and 3 deletions
|
@ -104,4 +104,10 @@ upgrade_gravityDB(){
|
||||||
sqlite3 "${database}" < "${scriptPath}/10_to_11.sql"
|
sqlite3 "${database}" < "${scriptPath}/10_to_11.sql"
|
||||||
version=11
|
version=11
|
||||||
fi
|
fi
|
||||||
|
if [[ "$version" == "11" ]]; then
|
||||||
|
# Rename group 0 from "Unassociated" to "Default"
|
||||||
|
echo -e " ${INFO} Upgrading gravity database from version 11 to 12"
|
||||||
|
sqlite3 "${database}" < "${scriptPath}/11_to_12.sql"
|
||||||
|
version=12
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
19
advanced/Scripts/database_migration/gravity/11_to_12.sql
Normal file
19
advanced/Scripts/database_migration/gravity/11_to_12.sql
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
.timeout 30000
|
||||||
|
|
||||||
|
PRAGMA FOREIGN_KEYS=OFF;
|
||||||
|
|
||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
UPDATE "group" SET name = 'Default' WHERE id = 0;
|
||||||
|
UPDATE "group" SET description = 'The default group' WHERE id = 0;
|
||||||
|
|
||||||
|
DROP TRIGGER IF EXISTS tr_group_zero;
|
||||||
|
|
||||||
|
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
||||||
|
BEGIN
|
||||||
|
INSERT OR IGNORE INTO "group" (id,enabled,name,description) VALUES (0,1,'Default','The default group');
|
||||||
|
END;
|
||||||
|
|
||||||
|
UPDATE info SET value = 12 WHERE property = 'version';
|
||||||
|
|
||||||
|
COMMIT;
|
|
@ -10,7 +10,7 @@ CREATE TABLE "group"
|
||||||
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
|
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
|
||||||
description TEXT
|
description TEXT
|
||||||
);
|
);
|
||||||
INSERT INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
INSERT INTO "group" (id,enabled,name,description) VALUES (0,1,'Default','The default group');
|
||||||
|
|
||||||
CREATE TABLE domainlist
|
CREATE TABLE domainlist
|
||||||
(
|
(
|
||||||
|
@ -52,7 +52,7 @@ CREATE TABLE info
|
||||||
value TEXT NOT NULL
|
value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO "info" VALUES('version','11');
|
INSERT INTO "info" VALUES('version','12');
|
||||||
|
|
||||||
CREATE TABLE domain_audit
|
CREATE TABLE domain_audit
|
||||||
(
|
(
|
||||||
|
@ -167,7 +167,7 @@ CREATE TRIGGER tr_group_update AFTER UPDATE ON "group"
|
||||||
|
|
||||||
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
CREATE TRIGGER tr_group_zero AFTER DELETE ON "group"
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated');
|
INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Default');
|
||||||
END;
|
END;
|
||||||
|
|
||||||
CREATE TRIGGER tr_domainlist_delete AFTER DELETE ON domainlist
|
CREATE TRIGGER tr_domainlist_delete AFTER DELETE ON domainlist
|
||||||
|
|
Loading…
Reference in a new issue