-- Add updated_at column to amazon_products table
-- This is needed for the database stock synchronization system

ALTER TABLE `amazon_products` 
ADD COLUMN `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

-- Add index for better performance
CREATE INDEX `idx_amazon_products_updated_at` ON `amazon_products` (`updated_at`);

-- Update existing records to have updated_at timestamp
UPDATE `amazon_products` SET `updated_at` = NOW() WHERE `updated_at` IS NULL;
