Fixes: null expires entries in migration process

catch null expires entries correctly when the data is migrated from the ban table to fix issue #34
master
shivajiva101 2021-12-08 00:04:00 +00:00 committed by GitHub
parent 30c882337b
commit 4189cf4caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -166,6 +166,9 @@ WHERE typeof(bans.id) = 'text';
DELETE FROM bans WHERE typeof(bans.id) = 'text';
INSERT INTO bans SELECT * FROM fix_tmp;
-- fix null expires entries
UPDATE bans SET expires = 0 WHERE expires = '';
-- transfer existing data to new tables
----------------------------------------------
@ -194,9 +197,6 @@ INSERT INTO active_tmp SELECT
last_pos
FROM bans WHERE active = 'true';
-- initialise expires
UPDATE active SET expires = 0 WHERE expires = '';
-- initialise versions
INSERT INTO config VALUES('db_version', '0.2.1');
INSERT INTO config VALUES('mod_version', '0.2.0');