Automate diary entries and add photo galleries

This commit is contained in:
kai
2026-08-29 11:58:56 +02:00
parent 0b0b19b53a
commit b2af6c6857
7 changed files with 238 additions and 62 deletions
+12 -1
View File
@@ -213,7 +213,7 @@ CREATE TABLE followed_venues (
CREATE TABLE concert_diary (
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
concert_id INTEGER NOT NULL REFERENCES concerts(id) ON DELETE CASCADE,
rating SMALLINT NOT NULL CHECK (rating BETWEEN 1 AND 5),
rating SMALLINT CHECK (rating BETWEEN 1 AND 5),
favorite_song VARCHAR(255),
notes TEXT,
photo_path TEXT,
@@ -222,6 +222,17 @@ CREATE TABLE concert_diary (
PRIMARY KEY (user_id, concert_id)
);
CREATE TABLE concert_diary_photos (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
concert_id INTEGER NOT NULL REFERENCES concerts(id) ON DELETE CASCADE,
path TEXT NOT NULL UNIQUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_concert_diary_photos_entry
ON concert_diary_photos(user_id, concert_id, created_at);
CREATE TABLE concert_bands (
concert_id INTEGER NOT NULL REFERENCES concerts(id) ON DELETE CASCADE,
band_key VARCHAR(255) NOT NULL,