DarkflameServer/migrations/dlu/15_guilds.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
599 B
MySQL
Raw Normal View History

2022-12-20 14:14:58 +00:00
CREATE TABLE IF NOT EXISTS guilds (
2022-12-20 14:54:52 +00:00
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
2022-12-20 14:14:58 +00:00
name VARCHAR(35) NOT NULL,
2022-12-20 14:54:52 +00:00
owner_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE,
2022-12-20 14:14:58 +00:00
motd TEXT,
2023-11-16 06:32:50 +00:00
reputation INT NOT NULL DEFAULT 0,
2023-11-21 20:16:56 +00:00
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP()
2022-12-20 14:14:58 +00:00
);
CREATE TABLE IF NOT EXISTS guild_members (
2022-12-20 14:54:52 +00:00
guild_id BIGINT NOT NULL REFERENCES guilds(id) ON DELETE CASCADE,
character_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE,
2022-12-20 14:14:58 +00:00
rank INT NOT NULL DEFAULT 4,
2023-11-21 20:16:56 +00:00
joined TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
2023-11-16 06:32:50 +00:00
PRIMARY KEY (guild_id, character_id)
2022-12-20 14:14:58 +00:00
);