ALTER TABLE applications
    ADD COLUMN description VARCHAR(500) NULL AFTER application_name,
    ADD COLUMN homepage_url VARCHAR(500) NULL AFTER description,
    ADD COLUMN logout_url VARCHAR(500) NULL AFTER callback_url;

INSERT INTO permissions (permission_key, permission_name)
VALUES ('users.delete', 'Delete users')
ON DUPLICATE KEY UPDATE permission_name = VALUES(permission_name);

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
CROSS JOIN permissions p
WHERE r.role_key = 'super_admin'
  AND p.permission_key = 'users.delete';
