-- Add user_id column to admins table to link admin accounts to db_users_a
-- This allows admin messages in support tickets to use the admin's user_id
ALTER TABLE `admins` 
ADD COLUMN `user_id` INT NULL AFTER `id`,
ADD CONSTRAINT `fk_admins_user_id` FOREIGN KEY (`user_id`) REFERENCES `db_users_a`(`id`) ON DELETE RESTRICT,
ADD INDEX `idx_user_id` (`user_id`);

