Skip to content

Instantly share code, notes, and snippets.

@KisaragiEffective
Last active October 26, 2019 13:04
Show Gist options
  • Save KisaragiEffective/37c86066f93cd6f9baa5ef0ed1e0f058 to your computer and use it in GitHub Desktop.
Save KisaragiEffective/37c86066f93cd6f9baa5ef0ed1e0f058 to your computer and use it in GitHub Desktop.
CREATE TABLE locations (
id int primary key,
x int NOT NULL,
y int NOT NULL,
z int NOT NULL
);
CREATE TABLE worlds (
id int primary key,
name nvarchar(64) NOT NULL
);
CREATE TABLE placement (
time long NOT NULL,
location_id int NOT NULL,
world_id int NOT NULL,
player_id int NOT NULL,
block_type int NOT NULL,
rolled_back bool NOT NULL
);
CREATE TABLE removal (
time long NOT NULL,
location_id int NOT NULL,
world_id int NOT NULL,
player_id int NOT NULL,
block_type int NOT NULL,
rolled_back bool NOT NULL
);
CREATE TABLE IF NOT EXISTS itemframe_placement (
time long NOT NULL,
itemframe_id int NOT NULL,
player_id int NOT NULL,
item_id int NOT NULL,
rolled_back int NOT NULL
);
CREATE TABLE IF NOT EXISTS itemframes (
id int NOT NULL,
world_id int NOT NULL,
location_id int NOT NULL
);
CREATE TABLE IF NOT EXISTS player_name (
id int primary key,
name nvarchar(16) NOT NULL
);
CREATE TABLE IF NOT EXISTS player_uuid (
id int primary key,
uuid nchar(36) NOT NULL
);
CREATE TABLE IF NOT EXISTS chats (
player_id int NOT NULL,
content nvarchar(256) NOT NULL
);
CREATE TABLE IF NOT EXISTS commands (
player_id int NOT NULL,
content nvarchar(256) NOT NULL
);
CREATE TABLE IF NOT EXISTS int2bool (
key int primary key,
value nvarchar(5)
);
/* useful */
CREATE VIEW player as SELECT n.id, n.name, u.uuid
FROM player_uuid as u, player_name as n
WHERE u.id = n.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment