mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 21:47:24 +00:00
a4bf11502f
no crashes
17 lines
599 B
SQL
17 lines
599 B
SQL
CREATE TABLE IF NOT EXISTS guilds (
|
|
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
name VARCHAR(35) NOT NULL,
|
|
owner_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE,
|
|
motd TEXT,
|
|
reputation INT NOT NULL DEFAULT 0,
|
|
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP()
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS guild_members (
|
|
guild_id BIGINT NOT NULL REFERENCES guilds(id) ON DELETE CASCADE,
|
|
character_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE,
|
|
rank INT NOT NULL DEFAULT 4,
|
|
joined TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
|
PRIMARY KEY (guild_id, character_id)
|
|
);
|