mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 18:53:56 +00:00
e589e665a7
Signed-off-by: DL6ER <dl6er@dl6er.de>
30 lines
776 B
SQL
30 lines
776 B
SQL
.timeout 30000
|
|
|
|
PRAGMA FOREIGN_KEYS=OFF;
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
ALTER TABLE "group" RENAME TO "group__";
|
|
|
|
CREATE TABLE "group"
|
|
(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
enabled BOOLEAN NOT NULL DEFAULT 1,
|
|
name TEXT UNIQUE NOT NULL,
|
|
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
|
|
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
|
|
description TEXT
|
|
);
|
|
|
|
CREATE TRIGGER tr_group_update AFTER UPDATE ON "group"
|
|
BEGIN
|
|
UPDATE "group" SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE id = NEW.id;
|
|
END;
|
|
|
|
INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__";
|
|
|
|
DROP TABLE "group__";
|
|
|
|
UPDATE info SET value = 8 WHERE property = 'version';
|
|
|
|
COMMIT;
|