first commit
This commit is contained in:
commit
7e62f366e7
8 changed files with 224 additions and 0 deletions
3
migrations/1_create_tables.down.sql
Normal file
3
migrations/1_create_tables.down.sql
Normal file
|
@ -0,0 +1,3 @@
|
|||
DROP TABLE servers;
|
||||
DROP TABLE regions;
|
||||
DROP TABLE gamemodes;
|
21
migrations/1_create_tables.up.sql
Normal file
21
migrations/1_create_tables.up.sql
Normal file
|
@ -0,0 +1,21 @@
|
|||
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,
|
||||
app_id INT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
map TEXT NOT NULL,
|
||||
players INT,
|
||||
max_players INT
|
||||
);
|
||||
|
||||
CREATE TABLE regions (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE gamemodes (
|
||||
id UUID PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
description NOT NULL
|
||||
);
|
Reference in a new issue