-- Add parent_id to categories for nested structure
ALTER TABLE categories
    ADD COLUMN parent_id INT NULL AFTER id,
    ADD CONSTRAINT fk_category_parent
    FOREIGN KEY (parent_id) REFERENCES categories(id) ON DELETE SET NULL;
