CREATE OR REPLACE VIEW view__roles as
select
    `uhor`.`roleID` AS `roleID`,
    `or`.name AS roleName,
    `uhor`.`userID` AS `userID`,
    `uhor`.`main` AS `main`,
    `or`.`organizationID` AS `organizationID`,
    `or`.`admin` AS `admin`,
    `o`.`partnerID` AS `partnerID`
from ((
    `smd_dev`.`smd__user_has_organization_role` `uhor`
join `smd_dev`.`smd__organization_role` `or` on((`or`.`roleID` = `uhor`.`roleID`)))
join `smd_dev`.`smd__organization` `o` on((`or`.`organizationID` = `o`.`organizationID`)))