From 4e29d4041e7cf254041e22d2052e94a7c53c9066 Mon Sep 17 00:00:00 2001
From: ilotterytea <iltsu@alright.party>
Date: Wed, 14 May 2025 21:40:06 +0500
Subject: feat: personal badges

---
 database.sql | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'database.sql')

diff --git a/database.sql b/database.sql
index 36beec8..a92ad46 100644
--- a/database.sql
+++ b/database.sql
@@ -87,6 +87,12 @@ CREATE TABLE IF NOT EXISTS badges (
     created_at TIMESTAMP NOT NULL DEFAULT UTC_TIMESTAMP
 );
 
+CREATE TABLE IF NOT EXISTS user_badges (
+    id CHAR(32) NOT NULL PRIMARY KEY DEFAULT REPLACE(UUID(),'-',''),
+    user_id CHAR(32) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+    badge_id CHAR(32) NOT NULL REFERENCES badges(id) ON DELETE CASCADE
+);
+
 CREATE TABLE IF NOT EXISTS roles (
     id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
     priority INTEGER NOT NULL DEFAULT 0,
-- 
cgit v1.2.3

