-- Migration 007: Add ticket assignment functionality
-- Adds assigned_to column to tickets table

-- Add assigned_to column to tickets table
ALTER TABLE tickets
    ADD COLUMN assigned_to INT NULL,
    ADD CONSTRAINT fk_tickets_assigned_to
        FOREIGN KEY (assigned_to)
        REFERENCES users(user_id)
        ON DELETE SET NULL;

-- Add index for performance
CREATE INDEX idx_assigned_to ON tickets(assigned_to);
