Jump to content

Manual:block_target table

From mediawiki.org
Manual:Contents MediaWiki database layout block_target table

The targets of blocks

Fields

[edit]

bt_id

[edit]

Primary key.

bt_address

[edit]

Blocked IP address or range in dotted-quad form, or null for a user block. If bt_auto is 1 then the address is private.

bt_user

[edit]

Blocked user ID or null for IP blocks.

bt_user_text

[edit]

The name of the blocked user, or null for IP blocks. For Special:BlockList sorting. (T48013)

bt_auto

[edit]

Indicates that the IP address was banned because a banned user accessed a page through it. If this is 1, ipb_address will be hidden, and the block identified by block ID number.

bt_range_start

[edit]

Start of an address range, in hexadecimal. Null for single-IP and user blocks.

bt_range_end

[edit]

End of an address range, in hexadecimal. Null for single-IP and user blocks.

bt_ip_hex

[edit]

If the block is for a single IP, this is the IP address in hexadecimal. If the block is for a range, the start of the range in hexadecimal, identical to bt_range_start.

bt_count

[edit]

The number of block rows associated with this target.

Schema summary

[edit]
MediaWiki version:
1.42

DESCRIBE block_target;

+----------------+------------------+------+-----+---------+----------------+
| Field          | Type             | Null | Key | Default | Extra          |
+----------------+------------------+------+-----+---------+----------------+
| bt_id          | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| bt_address     | tinyblob         | YES  | MUL | NULL    |                |
| bt_user        | int(10) unsigned | YES  | MUL | NULL    |                |
| bt_user_text   | varbinary(255)   | YES  |     | NULL    |                |
| bt_auto        | tinyint(1)       | NO   |     | 0       |                |
| bt_range_start | tinyblob         | YES  | MUL | NULL    |                |
| bt_range_end   | tinyblob         | YES  |     | NULL    |                |
| bt_ip_hex      | tinyblob         | YES  | MUL | NULL    |                |
| bt_count       | int(11)          | NO   |     | 0       |                |
+----------------+------------------+------+-----+---------+----------------+

Indexes

[edit]
MediaWiki version:
1.42

SHOW INDEX IN block_target;

+--------------+------------+-----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table        | Non_unique | Key_name        | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------+------------+-----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| block_target |          0 | PRIMARY         |            1 | bt_id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| block_target |          1 | bt_address      |            1 | bt_address     | A         |           0 |       42 | NULL   | YES  | BTREE      |         |               |
| block_target |          1 | bt_ip_user_text |            1 | bt_ip_hex      | A         |           0 |       35 | NULL   | YES  | BTREE      |         |               |
| block_target |          1 | bt_ip_user_text |            2 | bt_user_text   | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
| block_target |          1 | bt_range        |            1 | bt_range_start | A         |           0 |       35 | NULL   | YES  | BTREE      |         |               |
| block_target |          1 | bt_range        |            2 | bt_range_end   | A         |           0 |       35 | NULL   | YES  | BTREE      |         |               |
| block_target |          1 | bt_user         |            1 | bt_user        | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
+--------------+------------+-----------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+