feat(landscape): multi-photo gallery like rooms with uploads and ordering

This commit is contained in:
2026-06-27 19:29:08 -05:00
parent cfd0c533a4
commit 71ae322b3f
5 changed files with 174 additions and 76 deletions
+8 -1
View File
@@ -101,7 +101,8 @@ export async function initSchema() {
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
photo VARCHAR(500),
photos TEXT[] DEFAULT '{}',
featured_photo VARCHAR(500),
distance_km NUMERIC(8,2),
visit_time VARCHAR(100),
suggestion TEXT,
@@ -165,6 +166,12 @@ export async function initSchema() {
ALTER TABLE users ADD COLUMN IF NOT EXISTS last_name VARCHAR(100);
`);
await db.query(`
ALTER TABLE places ADD COLUMN IF NOT EXISTS featured_photo VARCHAR(500);
UPDATE places SET photos = ARRAY[photo] WHERE photo IS NOT NULL AND (photos IS NULL OR photos = '{}');
ALTER TABLE places DROP COLUMN IF EXISTS photo;
`);
await db.query(`
CREATE TABLE IF NOT EXISTS user_sessions (
id SERIAL PRIMARY KEY,