rbac_role_emulation_grants


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 gen_random_uuid()
practice_id text 2147483647 null
schema_migrations.id Implied Constraint R
role_id uuid 2147483647 √ null
rbac_roles.id rbac_role_emulation_grants_role_id_fkey C
token_hash text 2147483647 null
granted_by_user_id text 2147483647 √ null
schema_migrations.id Implied Constraint R
granted_by_user_name text 2147483647 √ null
created_at timestamptz 35,6 now()
expires_at timestamptz 35,6 null
emulation_kind text 2147483647 'role'::text

Indexes

Constraint Name Type Sort Column(s)
rbac_role_emulation_grants_pkey Primary key Asc id
rbac_role_emulation_grants_practice_expiry_idx Performance Asc/Asc practice_id + expires_at
rbac_role_emulation_grants_practice_token_idx Performance Asc/Asc/Asc practice_id + token_hash + expires_at
rbac_role_emulation_grants_role_idx Performance Asc/Asc role_id + expires_at
rbac_role_emulation_grants_token_hash_key Must be unique Asc token_hash

Check Constraints

Constraint Name Constraint
rbac_role_emulation_grants_check ((expires_at > created_at))
rbac_role_emulation_grants_kind_check ((((emulation_kind = 'role'::text) AND (role_id IS NOT NULL)) OR ((emulation_kind = 'super_admin'::text) AND (role_id IS NULL))))
rbac_role_emulation_grants_token_hash_check ((token_hash <> ''::text))

Relationships