fix(mssql): do not needlessly qualify columns in ProjectRoleRestrictionModel

this allows the ORM to properly escape the rule column
needed on MSSQL as it is a reserved word
This commit is contained in:
Joe Nahmias
2022-07-10 19:55:59 -04:00
committed by Frédéric Guillot
parent cf739273d5
commit 29df527979

View File

@@ -66,10 +66,10 @@ class ProjectRoleRestrictionModel extends Base
$restrictions = $this->db $restrictions = $this->db
->table(self::TABLE) ->table(self::TABLE)
->columns( ->columns(
self::TABLE.'.restriction_id', 'restriction_id',
self::TABLE.'.project_id', 'project_id',
self::TABLE.'.role_id', 'role_id',
self::TABLE.'.rule' 'rule'
) )
->eq(self::TABLE.'.project_id', $project_id) ->eq(self::TABLE.'.project_id', $project_id)
->findAll(); ->findAll();
@@ -93,10 +93,10 @@ class ProjectRoleRestrictionModel extends Base
return $this->db return $this->db
->table(self::TABLE) ->table(self::TABLE)
->columns( ->columns(
self::TABLE.'.restriction_id', 'restriction_id',
self::TABLE.'.project_id', 'project_id',
self::TABLE.'.role_id', 'role_id',
self::TABLE.'.rule', 'rule',
'pr.role' 'pr.role'
) )
->eq(self::TABLE.'.project_id', $project_id) ->eq(self::TABLE.'.project_id', $project_id)