CREATE TABLE IF NOT EXISTS staff_schedules ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE, user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, date DATE NOT NULL, shift_start TIME, shift_end TIME, is_day_off BOOLEAN NOT NULL DEFAULT false, notes TEXT, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), UNIQUE(hotel_id, user_id, date) );