-- Migration: Add HSN Code to Stock and Purchase Items
-- Run this migration to add HSN code support

USE mobile_management;

-- Add HSN code column to stock table
ALTER TABLE stock ADD COLUMN IF NOT EXISTS hsn_code VARCHAR(20) NULL AFTER rom;

-- Add HSN code column to purchase_items table
ALTER TABLE purchase_items ADD COLUMN IF NOT EXISTS hsn_code VARCHAR(20) NULL AFTER stock_id;

-- Add index for better query performance
CREATE INDEX IF NOT EXISTS idx_hsn_code ON stock(hsn_code);


