-- Add currency_id columns to markets and restaurants tables
-- This script adds currency support for pricing information

-- Add currency_id column to markets table
ALTER TABLE markets 
ADD COLUMN IF NOT EXISTS currency_id BIGINT REFERENCES currencies(currency_id);

-- Add currency_id column to restaurants table
ALTER TABLE restaurants 
ADD COLUMN IF NOT EXISTS currency_id BIGINT REFERENCES currencies(currency_id);

-- Add indexes for better performance
CREATE INDEX IF NOT EXISTS idx_markets_currency_id ON markets(currency_id);
CREATE INDEX IF NOT EXISTS idx_restaurants_currency_id ON restaurants(currency_id);

-- Add comments for documentation
COMMENT ON COLUMN markets.currency_id IS 'Foreign key reference to currencies table for price display';
COMMENT ON COLUMN restaurants.currency_id IS 'Foreign key reference to currencies table for price display';