-- Adds role-based permissions: Motaher is admin (full access, unchanged
-- behavior everywhere); Sumona can see everything, add any expense, but
-- can only edit/delete her own expenses, cannot touch Income at all, and
-- can view (but not change) Budgets, Manage, and the admin parts of
-- Settings — her own display name/password stay editable either way.
--
-- Run once via phpMyAdmin.

ALTER TABLE users ADD COLUMN is_admin TINYINT(1) NOT NULL DEFAULT 0 AFTER password_hash;

UPDATE users SET is_admin = 1 WHERE username = 'motaher';
-- Sumona (and anyone else) stays at the column's default, is_admin = 0.
