-- Add is_default column to role_permissions table if it doesn't exist
ALTER TABLE role_permissions ADD COLUMN IF NOT EXISTS is_default TINYINT(1) NOT NULL DEFAULT 1;

-- Update existing records to have is_default = 1
UPDATE role_permissions SET is_default = 1 WHERE is_default IS NULL;