-- Add missing columns to suppliers table
-- These columns are needed for categories and rating functionality

-- Check if table exists first
SHOW TABLES LIKE 'suppliers';

-- Add categories column (JSON for storing array of categories)
ALTER TABLE `suppliers` ADD COLUMN `categories` JSON NULL AFTER `description`;

-- Add rating_breakdown column (JSON for storing detailed rating breakdown)
ALTER TABLE `suppliers` ADD COLUMN `rating_breakdown` JSON NULL AFTER `categories`;

-- Add rating column (decimal for overall rating)
ALTER TABLE `suppliers` ADD COLUMN `rating` DECIMAL(3,2) DEFAULT 0.00 AFTER `rating_breakdown`;

-- Verify the table structure
DESCRIBE suppliers;

-- Show all columns
SHOW COLUMNS FROM suppliers;
