1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/9687] Add separate column for user_id

PHPBB3-9687
This commit is contained in:
Marc Alexander
2023-07-31 11:53:33 +02:00
parent f9a0e4d606
commit 0414536727
6 changed files with 34 additions and 29 deletions

View File

@@ -29,6 +29,7 @@ class ban_table_p1 extends migration
$this->table_prefix . 'bans' => [
'COLUMNS' => [
'ban_id' => ['ULINT', null, 'auto_increment'],
'ban_userid' => ['ULINT', 0],
'ban_mode' => ['VCHAR', ''],
'ban_item' => ['STEXT_UNI', ''],
'ban_start' => ['TIMESTAMP', 0],
@@ -38,6 +39,7 @@ class ban_table_p1 extends migration
],
'PRIMARY_KEY' => 'ban_id',
'KEYS' => [
'ban_userid' => ['INDEX', 'ban_userid'],
'ban_end' => ['INDEX', 'ban_end'],
],
],
@@ -113,6 +115,7 @@ class ban_table_p1 extends migration
$bans[] = [
'ban_mode' => $mode,
'ban_userid' => $row['ban_userid'],
'ban_item' => $item,
'ban_start' => $row['ban_start'],
'ban_end' => $row['ban_end'],
@@ -150,7 +153,7 @@ class ban_table_p1 extends migration
$processed_rows++;
$bans[] = [
'ban_userid' => ($row['ban_mode'] === 'user') ? (int) $row['ban_item'] : 0,
'ban_userid' => (int) $row['ban_userid'],
'ban_ip' => ($row['ban_mode'] === 'ip') ? $row['ban_item'] : '',
'ban_email' => ($row['ban_mode'] === 'email') ? $row['ban_item'] : '',
'ban_start' => $row['ban_start'],