914 B
914 B
Database Migration Script
This script addresses the issue where init-db.sh skipped adding new columns to existing tables.
Usage
- Make sure you have access to the PostgreSQL database
- Run the migration script:
./migration-fix-columns.sh
What it does
The script adds missing columns to existing tables in the database. It uses ALTER TABLE ... ADD COLUMN IF NOT EXISTS statements to ensure that:
- If a column already exists, it won't cause an error
- If a column doesn't exist, it will be added
Affected Tables
- rooms
- places
- menu_items
- users
- reservations
- social_events
- reviews
- social_event_reservations
- calendar_events
- room_comments
- offers
- coupons
- benefits
- slides
- config
Columns Added
- photos (TEXT[])
- featured_photo (VARCHAR(500))
- first_name (VARCHAR(255))
- last_name (VARCHAR(255))
- comments_disabled (BOOLEAN DEFAULT false)