Skip to main content
Skip table of contents

Script to resolve the Supervisor assignment limit to each Team

Problem Statement:

      In our current structure, teams are implemented on Keycloak side as Groups and each team is assigned Supervisors using Group Attributes. The problem is that Keycloak Attribute only allows 255 character as value due to table schema limitation. Hence, we can only assign the number of supervisors that can fit with-in 255 character limit.

Solution:

Change the field value schema from VARCHAR(255) to TEXT in group_attribute table of keycloak_db.

Steps:

Copy the current password for your postgresql server pod

POWERSHELL
kubectl get secret --namespace ef-external ef-postgresql -o jsonpath="{.data.password}" | base64 -d

you will need this password in next command as POSTGRES User's password to connect and run the SQL Transaction.

POWERSHELL
kubectl  -n ef-external exec  -ti ef-postgresql-0 -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash -c "psql --host localhost -U sa -d keycloak_db -p 5432"

Once inside postgresql db, run the below given Transaction block containing the following Query:

SQL
BEGIN;
 
--- changing the schema of value field inside group_attribute table from VARCHAR(255) to TEXT
ALTER TABLE group_attribute ALTER COLUMN value TYPE TEXT;
 
COMMIT;

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.