change database, add queries

This commit is contained in:
zardzul
2026-03-14 18:18:10 +01:00
parent 3ffd7cfc8d
commit 433c7b4085
5 changed files with 65 additions and 4 deletions
+4 -1
View File
@@ -3,7 +3,9 @@ CREATE TABLE IF NOT EXISTS users (
user_name VARCHAR(255) NOT NULL,
user_mail VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
session_token VARCHAR(255),
session_expiry TIMESTAMP
);
CREATE TABLE IF NOT EXISTS albums (
@@ -25,6 +27,7 @@ CREATE TABLE IF NOT EXISTS artists (
CREATE TABLE IF NOT EXISTS user_albums (
user_id UUID,
album_id UUID,
date_added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
album_owned BOOLEAN NOT NULL DEFAULT FALSE,
album_want BOOLEAN NOT NULL DEFAULT FALSE,
is_vinyl BOOLEAN NOT NULL DEFAULT FALSE,