Skip to content

Database Schema

Risto Lahtela edited this page Jan 17, 2019 · 23 revisions

Plan Header

Database Schema

4.6.0 has large schema changes and this page is not yet up to date
Please be patient as it will take a while to update everything in the wiki.

Schema Version Plan Version
13 4.1.0
11 4.0.2
10 4.0.0
8 3.6.4

This wiki article is about Schema version 10 and beyond.

Page Version: 4.1.4 schema img: 4.0.2

Tables in Plan database

SHOW TABLES IN Plan;
+--------------------------+
| Tables_in_Plan           |
+--------------------------+
| plan_actions             |
| plan_commandusages       |
| plan_ips                 |
| plan_kills               |
| plan_nicknames           |
| plan_security            |
| plan_servers             |
| plan_sessions            |
| plan_tps                 |
| plan_user_info           |
| plan_users               |
| plan_version             |
| plan_world_times         |
| plan_worlds              |
| plan_aac_hack_table      | // Only if AAC is installed as well.
| plan_version_protocol    | // Only if ViaVersion or ProtocolSupport is installed as well.
+--------------------------+

Table relation

Table Relation image

Some notes

plan_actions:action_id: Actions id relates to Actions enum values

plan_server:uuid: This uuid is ServerUUID, which the server generates the first time the server connects to the database. It uses server properties as the seed and can be found in ServerInfoFile.yml

Data types

SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT FROM information_schema.columns WHERE table_schema = 'Plan';
+--------------------------+------------------+-----------+--------------------------+----------------+
| TABLE_NAME               | COLUMN_NAME      | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | COLUMN_DEFAULT |
+--------------------------+------------------+-----------+--------------------------+----------------+
| plan_actions             | user_id          | int       |                     NULL | NULL           |
| plan_actions             | server_id        | int       |                     NULL | NULL           |
| plan_actions             | date             | bigint    |                     NULL | NULL           |
| plan_actions             | action_id        | int       |                     NULL | NULL           |
| plan_actions             | additional_info  | varchar   |                      100 | NULL           |
| plan_commandusages       | id               | int       |                     NULL | NULL           |
| plan_commandusages       | command          | varchar   |                       20 | NULL           |
| plan_commandusages       | times_used       | int       |                     NULL | NULL           |
| plan_commandusages       | server_id        | int       |                     NULL | NULL           |
| plan_ips                 | user_id          | int       |                     NULL | NULL           |
| plan_ips                 | ip               | varchar   |                       20 | NULL           |
| plan_ips                 | geolocation      | varchar   |                       50 | NULL           |
| plan_kills               | killer_id        | int       |                     NULL | NULL           |
| plan_kills               | victim_id        | int       |                     NULL | NULL           |
| plan_kills               | weapon           | varchar   |                       30 | NULL           |
| plan_kills               | date             | bigint    |                     NULL | NULL           |
| plan_kills               | session_id       | int       |                     NULL | NULL           |
| plan_nicknames           | user_id          | int       |                     NULL | NULL           |
| plan_nicknames           | nickname         | varchar   |                       75 | NULL           |
| plan_nicknames           | server_id        | int       |                     NULL | NULL           |
| plan_security            | username         | varchar   |                      100 | NULL           |
| plan_security            | salted_pass_hash | varchar   |                      100 | NULL           |
| plan_security            | permission_level | int       |                     NULL | NULL           |
| plan_servers             | id               | int       |                     NULL | NULL           |
| plan_servers             | uuid             | varchar   |                       36 | NULL           |
| plan_servers             | name             | varchar   |                      100 | NULL           |
| plan_servers             | web_address      | varchar   |                      100 | NULL           |
| plan_servers             | is_installed     | tinyint   |                     NULL | 0              |
| plan_servers             | max_players      | int       |                     NULL | -1             |
| plan_sessions            | id               | int       |                     NULL | NULL           |
| plan_sessions            | user_id          | int       |                     NULL | NULL           |
| plan_sessions            | server_id        | int       |                     NULL | NULL           |
| plan_sessions            | session_start    | bigint    |                     NULL | NULL           |
| plan_sessions            | session_end      | bigint    |                     NULL | NULL           |
| plan_sessions            | mob_kills        | int       |                     NULL | NULL           |
| plan_sessions            | deaths           | int       |                     NULL | NULL           |
| plan_tps                 | server_id        | int       |                     NULL | NULL           |
| plan_tps                 | date             | bigint    |                     NULL | NULL           |
| plan_tps                 | tps              | double    |                     NULL | NULL           |
| plan_tps                 | players_online   | int       |                     NULL | NULL           |
| plan_tps                 | cpu_usage        | double    |                     NULL | NULL           |
| plan_tps                 | ram_usage        | bigint    |                     NULL | NULL           |
| plan_tps                 | entities         | int       |                     NULL | NULL           |
| plan_tps                 | chunks_loaded    | int       |                     NULL | NULL           |
| plan_user_info           | user_id          | int       |                     NULL | NULL           |
| plan_user_info           | registered       | bigint    |                     NULL | NULL           |
| plan_user_info           | opped            | tinyint   |                     NULL | 0              |
| plan_user_info           | banned           | tinyint   |                     NULL | 0              |
| plan_user_info           | server_id        | int       |                     NULL | NULL           |
| plan_users               | id               | int       |                     NULL | NULL           |
| plan_users               | uuid             | varchar   |                       36 | NULL           |
| plan_users               | registered       | bigint    |                     NULL | NULL           |
| plan_users               | name             | varchar   |                       16 | NULL           |
| plan_users               | times_kicked     | int       |                     NULL | 0              |
| plan_version             | version          | int       |                     NULL | NULL           |
| plan_version_protocol    | uuid             | varchar   |                       36 | NULL           |
| plan_version_protocol    | protocol_version | int       |                     NULL | NULL           |
| plan_world_times         | user_id          | int       |                     NULL | NULL           |
| plan_world_times         | world_id         | int       |                     NULL | NULL           |
| plan_world_times         | session_id       | int       |                     NULL | NULL           |
| plan_world_times         | survival_time    | bigint    |                     NULL | 0              |
| plan_world_times         | creative_time    | bigint    |                     NULL | 0              |
| plan_world_times         | adventure_time   | bigint    |                     NULL | 0              |
| plan_world_times         | spectator_time   | bigint    |                     NULL | 0              |
| plan_worlds              | id               | int       |                     NULL | NULL           |
| plan_worlds              | world_name       | varchar   |                      100 | NULL           |
+--------------------------+------------------+-----------+--------------------------+----------------+

Clone this wiki locally