Added: check active and expired table entries

ensure active and expired tables don't contain '' in expires field
master
shivajiva101 2021-12-14 01:36:32 +00:00 committed by GitHub
parent a0e38ced3e
commit 6d5813745c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1454,6 +1454,11 @@ local function data_integrity_check()
minetest.log("action", ([[[sban] id: %i %s %s %s %s is orphaned!]]
):format(row.id, row.name, row.source, hrdf(row.created), row.reason))
end
q = [[BEGIN TRANSACTION;
UPDATE active SET expires = 0 WHERE expires = '';
UPDATE expired SET expires = 0 WHERE expires = '';
COMMIT;]]
db_exec(q)
end
data_integrity_check() -- check for orphaned ban records!