Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ban_table_p2
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 depends_on
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 update_schema
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 revert_schema
0.00% covered (danger)
0.00%
0 / 24
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 *
4 * This file is part of the phpBB Forum Software package.
5 *
6 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7 * @license GNU General Public License, version 2 (GPL-2.0)
8 *
9 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14namespace phpbb\db\migration\data\v400;
15
16class ban_table_p2 extends \phpbb\db\migration\migration
17{
18    public static function depends_on(): array
19    {
20        return ['\phpbb\db\migration\data\v400\ban_table_p1'];
21    }
22
23    public function update_schema(): array
24    {
25        return [
26            'drop_tables'    => [
27                $this->table_prefix . 'banlist',
28            ],
29        ];
30    }
31
32    public function revert_schema(): array
33    {
34        return [
35            'add_tables'    => [
36                $this->table_prefix . 'banlist'        => [
37                    'COLUMNS'    => [
38                        'ban_id'            => ['ULINT', null, 'auto_increment'],
39                        'ban_userid'        => ['ULINT', 0],
40                        'ban_ip'            => ['VCHAR:40', ''],
41                        'ban_email'            => ['VCHAR_UNI:100', ''],
42                        'ban_start'            => ['TIMESTAMP', 0],
43                        'ban_end'            => ['TIMESTAMP', 0],
44                        'ban_exclude'        => ['BOOL', 0],
45                        'ban_reason'        => ['VCHAR_UNI', ''],
46                        'ban_give_reason'    => ['VCHAR_UNI', ''],
47                    ],
48                    'PRIMARY_KEY'    => 'ban_id',
49                    'KEYS'    => [
50                        'ban_end'    => ['INDEX', 'ban_end'],
51                        'ban_user'    => ['INDEX', ['ban_userid', 'ban_exclude']],
52                        'ban_email'    => ['INDEX', ['ban_email', 'ban_exclude']],
53                        'ban_ip'    => ['INDEX', ['ban_ip', 'ban_exclude']],
54                    ],
55                ],
56            ],
57        ];
58    }
59}