mirror of
https://github.com/sunrin-ana/2025-SSF.git
synced 2026-03-09 18:40:02 +00:00
2025 SSF Public
This commit is contained in:
commit
76a02076c9
192 changed files with 5016 additions and 0 deletions
25
Backend/utils/queries/avatar.py
Normal file
25
Backend/utils/queries/avatar.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
class AvatarQueries:
|
||||
|
||||
CREATE_TABLE = """
|
||||
CREATE TABLE IF NOT EXISTS avatars (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id INTEGER UNIQUE NOT NULL,
|
||||
avatar_type TEXT NOT NULL,
|
||||
top_clothe_type TEXT,
|
||||
bottom_clothe_type TEXT,
|
||||
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
|
||||
)
|
||||
"""
|
||||
|
||||
SELECT_USER_AVATAR = """
|
||||
SELECT * FROM avatars WHERE user_id = ?
|
||||
"""
|
||||
|
||||
INSERT_AVATAR = """
|
||||
INSERT INTO avatars (user_id, avatar_type, top_clothe_type, bottom_clothe_type)
|
||||
VALUES (?, ?, ?, ?)
|
||||
"""
|
||||
|
||||
UPDATE_AVATAR = """
|
||||
UPDATE avatars SET {fields} WHERE user_id = ?
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue