27 lines
650 B
SQL
27 lines
650 B
SQL
CREATE TABLE regions (
|
|
id UUID PRIMARY KEY,
|
|
name TEXT NOT NULL
|
|
);
|
|
|
|
CREATE TABLE gamemodes (
|
|
id UUID PRIMARY KEY,
|
|
name TEXT NOT NULL
|
|
);
|
|
|
|
CREATE TABLE flags (
|
|
server_ip TEXT PRIMARY KEY,
|
|
flag VARCHAR(2) NULL DEFAULT NULL,
|
|
);
|
|
|
|
CREATE TABLE servers (
|
|
id UUID PRIMARY KEY,
|
|
region_id UUID NOT NULL REFERENCES regions(id) ON DELETE CASCADE,
|
|
gamemode_id UUID NOT NULL REFERENCES gamemodes(id) ON DELETE CASCADE,
|
|
server_id UUID NOT NULL REFERENCES flags(server_ip) ON DELETE CASCADE,
|
|
app_id INT NOT NULL,
|
|
server_ip TEXT NOT NULL,
|
|
name TEXT NOT NULL,
|
|
map TEXT NOT NULL,
|
|
players INT,
|
|
max_players INT
|
|
);
|