Fix update to rev.24

This commit is contained in:
Visman 2020-11-01 20:38:39 +07:00
parent 0ce0b8e572
commit 8b6cbdde1c

View file

@ -1006,22 +1006,22 @@ class Update extends Admin
$this->c->DB->addField('forums', 'last_poster_id', 'INT(10) UNSIGNED', false, 0, 'last_poster');
$query = 'UPDATE ::forums AS f
SET f.last_poster_id=(
SET f.last_poster_id=COALESCE((
SELECT u.id
FROM ::users AS u
WHERE u.username=f.last_poster AND u.id > 1
)';
WHERE u.username=f.last_poster AND u.id>1
), 0)';
$this->c->DB->exec($query);
$this->c->DB->renameField('posts', 'edited_by', 'editor');
$this->c->DB->addField('posts', 'editor_id', 'INT(10) UNSIGNED', false, 0, 'editor');
$query = 'UPDATE ::posts AS p
SET p.editor_id=(
SET p.editor_id=COALESCE((
SELECT u.id
FROM ::users AS u
WHERE u.username=p.editor AND u.id > 1
)';
WHERE u.username=p.editor AND u.id>1
), 0)';
$this->c->DB->exec($query);
unset($this->c->config->o_merge_timeout);