Skip to content

Fix Postgres RLS policy syntax in launch readiness migration#2

Open
Rexxyin wants to merge 1 commit intomainfrom
codex/fix-syntax-error-in-migration-file
Open

Fix Postgres RLS policy syntax in launch readiness migration#2
Rexxyin wants to merge 1 commit intomainfrom
codex/fix-syntax-error-in-migration-file

Conversation

@Rexxyin
Copy link
Copy Markdown
Owner

@Rexxyin Rexxyin commented Apr 14, 2026

Motivation

  • The migration used create policy if not exists, which Postgres flagged as a syntax error (42601) and caused the migration to fail.
  • The intent is to make the migration idempotent and compatible with PostgreSQL so it can be re-run without parse errors.

Description

  • Replaced each create policy if not exists with a drop policy if exists ...; create policy ... pair to maintain idempotence while avoiding unsupported syntax.
  • Updated all three RLS policies on public.expense_settlements: Participant read settlements, Self manage settlement, and Self update settlement.
  • Kept the original policy definitions and access logic unchanged while altering only the surrounding statements for compatibility.

Testing

  • No automated SQL or migration tests were executed for this change because it is an SQL-only migration edit.
  • The repository commit containing the change was created successfully with no test suite run.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant