-- SQL Script to add Table Header Background Color field to tblfont_settings table
-- Database: uzrs-inventorydb
-- Date: 2025-11-05
-- Description: Adds TableHeaderBgColor column to allow customization of invoice table header background color

USE `uzrs-inventorydb`;

-- Add new column for Table Header Background Color
ALTER TABLE `tblfont_settings` 
ADD COLUMN `TableHeaderBgColor` VARCHAR(20) NOT NULL DEFAULT '#f0f0f0' AFTER `TableHeaderWeight`;

-- Update existing records with default value
UPDATE `tblfont_settings` 
SET `TableHeaderBgColor` = '#f0f0f0' 
WHERE `TableHeaderBgColor` = '' OR `TableHeaderBgColor` IS NULL;

-- Verify the change
SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_SCHEMA = 'uzrs-inventorydb' 
AND TABLE_NAME = 'tblfont_settings' 
AND COLUMN_NAME = 'TableHeaderBgColor';

-- Display confirmation message
SELECT 'Table header background color column added successfully!' AS Status;
