Skip to content

Commit b69b141

Browse files
committed
chore: add sanctions to public players
1 parent 44daada commit b69b141

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

hasura/metadata/databases/default/tables/public_players.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ array_relationships:
148148
table:
149149
name: player_unused_utility
150150
schema: public
151+
- name: sanctions
152+
using:
153+
foreign_key_constraint_on:
154+
column: player_steam_id
155+
table:
156+
name: player_sanctions
157+
schema: public
151158
- name: team_invites
152159
using:
153160
foreign_key_constraint_on:

hasura/triggers/players.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DECLARE
55
changing_player_role text;
66
BEGIN
77
IF TG_OP = 'UPDATE' AND NEW.role != OLD.role THEN
8-
SELECT current_setting('hasura.user')::jsonb ->> 'x-hasura-role' INTO changing_player_role;
8+
SELECT current_setting('hasura.user', true)::jsonb ->> 'x-hasura-role' INTO changing_player_role;
99

1010
IF NOT is_role_below(OLD.role, changing_player_role) THEN
1111
RAISE EXCEPTION 'You cannot change the role of a player above your own' USING ERRCODE = '22000';

0 commit comments

Comments
 (0)