View file File name : database_schema_updates.sql Content :-- Omni Rewards: Database Schema Updates for Tiers & Referrals -- -- Run these commands in your database manager (e.g., phpMyAdmin) -- to add the necessary columns to your `customers` table. -- Adds a column to store the customer's loyalty tier. ALTER TABLE `customers` ADD `tier` VARCHAR(50) NOT NULL DEFAULT 'Bronze' AFTER `rewards`; -- Adds a column to track lifetime points for tier progression. ALTER TABLE `customers` ADD `total_points_earned` INT NOT NULL DEFAULT 0 AFTER `tier`; -- Adds a column for the customer's unique referral code. ALTER TABLE `customers` ADD `referral_code` VARCHAR(255) NULL UNIQUE AFTER `password`; -- Adds a column to track who referred this customer. ALTER TABLE `customers` ADD `referred_by` VARCHAR(255) NULL AFTER `referral_code`; -- Optional: Run this to pre-populate existing customers with some initial values. UPDATE `customers` SET `total_points_earned` = (`rewards` * 10) + `points`; UPDATE `customers` SET `referral_code` = CONCAT('REF', SUBSTRING(id, 5, 8));