2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS accounts (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
name TEXT NOT NULL UNIQUE,
|
2021-12-05 17:54:36 +00:00
|
|
|
password TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
gm_level BIGINT NOT NULL DEFAULT 0,
|
|
|
|
locked INTEGER NOT NULL DEFAULT FALSE,
|
|
|
|
banned INTEGER NOT NULL DEFAULT FALSE,
|
|
|
|
play_key_id INTEGER NOT NULL DEFAULT 0,
|
|
|
|
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
|
|
|
mute_expire BIGINT NOT NULL DEFAULT 0
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS charinfo (
|
2021-12-05 17:54:36 +00:00
|
|
|
id BIGINT NOT NULL PRIMARY KEY,
|
2024-11-15 09:05:05 +00:00
|
|
|
account_id INTEGER NOT NULL REFERENCES accounts(id),
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
pending_name TEXT NOT NULL,
|
|
|
|
needs_rename INTEGER NOT NULL DEFAULT FALSE,
|
|
|
|
prop_clone_id BIGINT AUTO_INCREMENT UNIQUE,
|
|
|
|
last_login BIGINT NOT NULL DEFAULT 0,
|
|
|
|
permission_map BIGINT NOT NULL DEFAULT 0
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS charxml (
|
2021-12-05 17:54:36 +00:00
|
|
|
id BIGINT NOT NULL PRIMARY KEY REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
xml_data TEXT NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS command_log (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
2021-12-05 17:54:36 +00:00
|
|
|
character_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
command TEXT NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS friends (
|
2021-12-05 17:54:36 +00:00
|
|
|
player_id BIGINT NOT NULL REFERENCES charinfo(id),
|
|
|
|
friend_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
best_friend INTEGER NOT NULL DEFAULT FALSE,
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
PRIMARY KEY (player_id, friend_id)
|
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS leaderboard (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
game_id INTEGER NOT NULL DEFAULT 0,
|
|
|
|
last_played DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
2021-12-05 17:54:36 +00:00
|
|
|
character_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
time BIGINT NOT NULL,
|
|
|
|
score BIGINT NOT NULL DEFAULT 0
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS mail (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
sender_id INTEGER NOT NULL DEFAULT 0,
|
|
|
|
sender_name TEXT NOT NULL DEFAULT '',
|
2021-12-05 17:54:36 +00:00
|
|
|
receiver_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
receiver_name TEXT NOT NULL,
|
|
|
|
time_sent BIGINT NOT NULL,
|
2021-12-05 17:54:36 +00:00
|
|
|
subject TEXT NOT NULL,
|
|
|
|
body TEXT NOT NULL,
|
|
|
|
attachment_id BIGINT NOT NULL DEFAULT 0,
|
2024-11-15 09:05:05 +00:00
|
|
|
attachment_lot INTEGER NOT NULL DEFAULT 0,
|
2021-12-05 17:54:36 +00:00
|
|
|
attachment_subkey BIGINT NOT NULL DEFAULT 0,
|
2024-11-15 09:05:05 +00:00
|
|
|
attachment_count INTEGER NOT NULL DEFAULT 0,
|
|
|
|
was_read INTEGER NOT NULL DEFAULT FALSE
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS object_id_tracker (
|
2024-11-15 09:05:05 +00:00
|
|
|
last_object_id BIGINT NOT NULL DEFAULT 0 PRIMARY KEY
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS pet_names (
|
2021-12-05 17:54:36 +00:00
|
|
|
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
pet_name TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
approved INTEGER NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS play_keys (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
key_string TEXT NOT NULL UNIQUE,
|
|
|
|
key_uses INTEGER NOT NULL DEFAULT 1,
|
|
|
|
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
|
|
|
active INTEGER NOT NULL DEFAULT TRUE
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS properties (
|
2021-12-05 17:54:36 +00:00
|
|
|
id BIGINT NOT NULL PRIMARY KEY,
|
|
|
|
owner_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
template_id INTEGER NOT NULL,
|
|
|
|
clone_id BIGINT REFERENCES charinfo(prop_clone_id),
|
2021-12-05 17:54:36 +00:00
|
|
|
name TEXT NOT NULL,
|
|
|
|
description TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
rent_amount INTEGER NOT NULL,
|
2021-12-05 17:54:36 +00:00
|
|
|
rent_due BIGINT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
privacy_option INTEGER NOT NULL,
|
|
|
|
mod_approved INTEGER NOT NULL DEFAULT FALSE,
|
2021-12-05 17:54:36 +00:00
|
|
|
last_updated BIGINT NOT NULL,
|
|
|
|
time_claimed BIGINT NOT NULL,
|
|
|
|
rejection_reason TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
reputation BIGINT NOT NULL,
|
|
|
|
zone_id INTEGER NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS ugc (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
|
|
account_id INTEGER NOT NULL REFERENCES accounts(id),
|
2021-12-05 17:54:36 +00:00
|
|
|
character_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
is_optimized INTEGER NOT NULL DEFAULT FALSE,
|
|
|
|
lxfml BLOB NOT NULL,
|
|
|
|
bake_ao INTEGER NOT NULL DEFAULT FALSE,
|
2021-12-07 01:06:12 +00:00
|
|
|
filename TEXT NOT NULL DEFAULT ('')
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS properties_contents (
|
2021-12-05 17:54:36 +00:00
|
|
|
id BIGINT NOT NULL PRIMARY KEY,
|
|
|
|
property_id BIGINT NOT NULL REFERENCES properties(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
ugc_id INTEGER NULL REFERENCES ugc(id),
|
|
|
|
lot INTEGER NOT NULL,
|
|
|
|
x DOUBLE NOT NULL,
|
|
|
|
y DOUBLE NOT NULL,
|
|
|
|
z DOUBLE NOT NULL,
|
|
|
|
rx DOUBLE NOT NULL,
|
|
|
|
ry DOUBLE NOT NULL,
|
|
|
|
rz DOUBLE NOT NULL,
|
|
|
|
rw DOUBLE NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS activity_log (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
2021-12-05 17:54:36 +00:00
|
|
|
character_id BIGINT NOT NULL REFERENCES charinfo(id),
|
2024-11-15 09:05:05 +00:00
|
|
|
activity INTEGER NOT NULL,
|
|
|
|
time BIGINT NOT NULL,
|
|
|
|
map_id INTEGER NOT NULL
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS bug_reports (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
2021-12-05 17:54:36 +00:00
|
|
|
body TEXT NOT NULL,
|
|
|
|
client_version TEXT NOT NULL,
|
|
|
|
other_player_id TEXT NOT NULL,
|
|
|
|
selection TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
submitted DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP()
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|
|
|
|
|
2022-04-09 07:48:14 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS servers (
|
2024-11-15 09:05:05 +00:00
|
|
|
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
2021-12-05 17:54:36 +00:00
|
|
|
name TEXT NOT NULL,
|
|
|
|
ip TEXT NOT NULL,
|
2024-11-15 09:05:05 +00:00
|
|
|
port INTEGER NOT NULL,
|
|
|
|
state INTEGER NOT NULL,
|
|
|
|
version INTEGER NOT NULL DEFAULT 0
|
2021-12-05 17:54:36 +00:00
|
|
|
);
|