-- Admin panel patch: add role column and seed first admin
ALTER TABLE `users` 
  ADD COLUMN `role` ENUM('user','admin') NOT NULL DEFAULT 'user' AFTER `last_login`;

-- Optional: promote the earliest user to admin (adjust as needed)
UPDATE `users` SET `role`='admin' WHERE id = (SELECT id FROM (SELECT MIN(id) AS id FROM users) AS t);
