Files
la-huasca-ts/README_MIGRATION.md
T

914 B

Database Migration Script

This script addresses the issue where init-db.sh skipped adding new columns to existing tables.

Usage

  1. Make sure you have access to the PostgreSQL database
  2. 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:

  1. If a column already exists, it won't cause an error
  2. 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)