Self Checks
AgentifUI Version
main (commit fbcbe9f)
Environment
Local Development (pnpm dev)
Bug Description
Applying Supabase migrations with npx supabase db push fails on the notification RLS policy because target_roles is defined as text[] while profiles.role is the user_role enum. The policy uses text[] && user_role[], and Postgres errors out.
Steps to Reproduce
- Fresh checkout of main
- Run
npx supabase db push against the project
- Migration
20250822140000_create_notifications_system.sql fails when creating the policy
✔️ Expected Behavior
The migration should apply cleanly and create notification policies.
❌ Actual Behavior
Migration stops with SQLSTATE 42883: operator does not exist: text[] && user_role[] in the policy "Users can read targeted published notifications".
Console Logs
ERROR: operator does not exist: text[] && user_role[] (SQLSTATE 42883)
At statement: (target_roles && ARRAY[(SELECT role FROM public.profiles WHERE id = auth.uid())])
Additional Context
Root cause: target_roles column is text[] but compared with profiles.role (user_role). Fix: change target_roles to user_role[] or cast role to text. I patched locally to user_role[] to match the enum.
Self Checks
AgentifUI Version
main (commit fbcbe9f)
Environment
Local Development (pnpm dev)
Bug Description
Applying Supabase migrations with
npx supabase db pushfails on the notification RLS policy becausetarget_rolesis defined astext[]whileprofiles.roleis theuser_roleenum. The policy usestext[] && user_role[], and Postgres errors out.Steps to Reproduce
npx supabase db pushagainst the project20250822140000_create_notifications_system.sqlfails when creating the policy✔️ Expected Behavior
The migration should apply cleanly and create notification policies.
❌ Actual Behavior
Migration stops with SQLSTATE 42883: operator does not exist:
text[] && user_role[]in the policy "Users can read targeted published notifications".Console Logs
Additional Context
Root cause:
target_rolescolumn istext[]but compared withprofiles.role(user_role). Fix: changetarget_rolestouser_role[]or castroleto text. I patched locally touser_role[]to match the enum.