-- Phase 7 therapist permissions. Safe to run more than once.
INSERT IGNORE INTO permissions (name, display_name) VALUES
('therapists.view', 'View therapists'),
('therapists.create', 'Create therapists'),
('therapists.edit', 'Edit therapists');

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id FROM roles r CROSS JOIN permissions p
WHERE r.name IN ('SUPER_ADMIN','ADMIN') AND p.name IN ('therapists.view','therapists.create','therapists.edit');
