diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-15 01:44:01 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-15 01:44:01 +0500 |
| commit | 53a2e84af1ef1f35d835ef439260157038c70a46 (patch) | |
| tree | c1db7d2ec52960909b69a6eb4b56c2367a7f1106 /database.sql | |
| parent | 29337b30b7071cff678a7be54161507f3eb278be (diff) | |
feat: tags
Diffstat (limited to 'database.sql')
| -rw-r--r-- | database.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/database.sql b/database.sql index 6ce0c96..5f3bfbc 100644 --- a/database.sql +++ b/database.sql @@ -30,6 +30,17 @@ CREATE TABLE IF NOT EXISTS emotes ( visibility INTEGER NOT NULL ); +CREATE TABLE IF NOT EXISTS tags ( + id CHAR(32) NOT NULL PRIMARY KEY DEFAULT REPLACE(UUID(),'-',''), + code TEXT NOT NULL UNIQUE +); + +CREATE TABLE IF NOT EXISTS tag_assigns ( + id CHAR(32) NOT NULL PRIMARY KEY DEFAULT REPLACE(UUID(),'-',''), + tag_id CHAR(32) NOT NULL REFERENCES tags(id) ON DELETE CASCADE, + emote_id CHAR(32) NOT NULL REFERENCES emote(id) ON DELETE CASCADE +); + CREATE TABLE IF NOT EXISTS emote_sets ( id CHAR(32) NOT NULL PRIMARY KEY DEFAULT REPLACE(UUID(),'-',''), owner_id CHAR(32) NOT NULL REFERENCES users(id) ON DELETE CASCADE, |
