· 7 years ago · Dec 16, 2018, 01:24 PM
1
2
3CREATE DATABASE IF NOT EXISTS arenapvp;
4
5
6CREATE TABLE IF NOT EXISTS arenapvp.UserProfiles {
7 _id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
8 user varchar(500),
9 armor_helmet TEXT,
10 armor_chestplate TEXT,
11 armor_leggings TEXT,
12 armor_boots TEXT,
13 weapon_sword TEXT,
14 weapon_bow TEXT,
15 inventory TEXT,
16 pvp_normal_wins INT DEFAULT 0,
17 pvp_normal_losses INT DEFAULT 0,
18 pvp_normal_streak INT DEFAULT 0,
19 pvp_ranked_wins INT DEFAULT 0,
20 pvp_ranked_losses INT DEFAULT 0,
21 pvp_ranked_streak INT DEFAULT 0,
22 pvp_ranked_division TEXT,
23 pvp_ranked_points INT DEFAULT 0,
24 pvp_ranked_promo TEXT,
25 level INT,
26 created_at INT,
27 INDEX USERS_LIST(user, level),
28 INDEX USER_GAME(user, pvp_normal_wins, pvp_ranked_wins, pvp_normal_losses, pvp_ranked_losses)
29}
30
31CREATE TABLE IF NOT EXISTS arenapvp.UserShop {
32 _id INT PRIMARY KEY NOT NULL AUTO INCREMENT,
33 user VARCHAR(500),
34 item TEXT,
35 price INT,
36 created_at INT,
37 expires_at INT,
38 INDEX USER_SHOP(user, price, expires_at)
39}
40
41CREATE TABLE IF NOT EXISTS arenapvp.AdminShop {
42 _id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
43 item VARCHAR(500),
44 price INT,
45 created_at INT,
46 expires_at INT
47 INDEX ADMIN_SHOP(item, price, expires_at)
48}
49
50CREATE TABLE IF NOT EXISTS arenapvp.ChestRewards {
51 _id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
52 name VARCHAR(500),
53 items TEXT,
54 price INT,
55 created_at INT,
56 expires_at INT,
57 INDEX CHEST_REWARDS(name, price, expires_at)
58}
59
60CREATE TABLE IF NOT EXISTS arenapvp.UserInventory {
61 _id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
62 item_id INT,
63 text TEXT,
64 unlocked_at INT,
65 expires_at INT,
66 INDEX USER_INV(item_id, expires_at)
67}