From 5fc857449011f76ed7677aad40576790310d23e1 Mon Sep 17 00:00:00 2001
From: ilotterytea <iltsu@alright.party>
Date: Sun, 20 Apr 2025 16:06:19 +0500
Subject: feat: moved from SQLite to MySQL

---
 database.sql | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

(limited to 'database.sql')

diff --git a/database.sql b/database.sql
index ccd4c7e..3436b2c 100644
--- a/database.sql
+++ b/database.sql
@@ -1,25 +1,25 @@
-CREATE TABLE IF NOT EXISTS "users" (
-    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-    "username" TEXT NOT NULL UNIQUE,
-    "password" TEXT,
-    "secret_key" TEXT NOT NULL,
-    "joined_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+CREATE TABLE IF NOT EXISTS users (
+    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
+    username TEXT NOT NULL UNIQUE,
+    password TEXT,
+    secret_key TEXT NOT NULL,
+    joined_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
 );
 
-CREATE TABLE IF NOT EXISTS "connections" (
-    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-    "user_id" INTEGER NOT NULL,
-    "alias_id" TEXT NOT NULL,
-    "platform" TEXT NOT NULL,
-    "data" TEXT NOT NULL,
-    "connected_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+CREATE TABLE IF NOT EXISTS connections (
+    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
+    user_id INTEGER NOT NULL REFERENCES users(id),
+    alias_id TEXT NOT NULL,
+    platform TEXT NOT NULL,
+    data TEXT NOT NULL,
+    connected_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
 );
 
-CREATE TABLE IF NOT EXISTS "emotes" (
-    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-    "code" TEXT NOT NULL,
-    "mime" TEXT NOT NULL,
-    "ext" TEXT NOT NULL,
-    "uploaded_by" INTEGER,
-    "created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+CREATE TABLE IF NOT EXISTS emotes (
+    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
+    code TEXT NOT NULL,
+    mime TEXT NOT NULL,
+    ext TEXT NOT NULL,
+    uploaded_by INTEGER REFERENCES users(id),
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
 );
\ No newline at end of file
-- 
cgit v1.2.3

