Fix domain modification. The UNIQUE key in the domainlist table is the combination of domain+type, not domain alone so you can add the same domain, e.g. once as allowed and once as denied entries and assign them to different clients using appropriate groups
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
9345841b10
commit
c450d488a4
|
@ -1664,7 +1664,7 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, tablerow *row,
|
|||
"ON CONFLICT(ip) DO UPDATE SET comment = :comment;";
|
||||
else // domainlist
|
||||
querystr = "INSERT INTO domainlist (domain,type,enabled,comment) VALUES (:item,:type,:enabled,:comment) "\
|
||||
"ON CONFLICT(domain) DO UPDATE SET type = :type, enabled = :enabled, comment = :comment;";
|
||||
"ON CONFLICT(domain,type) DO UPDATE SET type = :type, enabled = :enabled, comment = :comment;";
|
||||
}
|
||||
|
||||
int rc = sqlite3_prepare_v2(gravity_db, querystr, -1, &stmt, NULL);
|
||||
|
|
Loading…
Reference in New Issue