USE samity360;
START TRANSACTION;

-- Member QR Card is a company-specific optional feature and is hidden by default.
INSERT INTO company_features(company_id,feature_key,is_enabled,enabled_by,enabled_at,notes)
SELECT c.id,'member_qr_card',0,
       (SELECT u.id FROM users u JOIN roles r ON r.id=u.role_id WHERE r.slug='developer' ORDER BY u.id LIMIT 1),
       NOW(),'Controls visibility and access to printable Member QR Cards.'
FROM companies c
WHERE c.deleted_at IS NULL
ON DUPLICATE KEY UPDATE feature_key=VALUES(feature_key);



COMMIT;
