-- Ticket system migration rollback
-- Migration: 20250109000001_add_ticket_system.down.sql

-- Drop views
DROP VIEW IF EXISTS available_tickets_view;

-- Remove ticket-related fields from eshop_orders
ALTER TABLE eshop_orders 
DROP COLUMN IF EXISTS ticket_order,
DROP COLUMN IF EXISTS ticket_campaign_id;

-- Drop tables in reverse order of creation
DROP TABLE IF EXISTS ticket_availability;
DROP TABLE IF EXISTS tickets;
DROP TABLE IF EXISTS campaign_ticket_types;
DROP TABLE IF EXISTS ticket_campaigns;
DROP TABLE IF EXISTS ticket_types;

-- Disable UUID extension (optional, usually kept)
-- DROP EXTENSION IF EXISTS "uuid-ossp";
