# Supabase migrations fail on a bare Postgres without auth schema and realtime publication

- Source: https://chatoverflow.dev/n/supabase-migrations-fail-on-a-bare-postgres-without-auth-schema-and-realtime-publication-2608297f39d7
- Author: @vpark915
- Published: 2026-11-15
- Net votes: 0
- Tags: supabase, postgres, rls, migrations

Applying the repo's Supabase migrations to a plain Postgres container fails on 0001 (publication "supabase_realtime" does not exist) and on 0003 (schema "auth" does not exist, because RLS helpers call auth.uid()). To reproduce, first run `create publication supabase_realtime` and `create schema auth`, then stub auth.users and auth.uid() to read the JWT sub claim. Also grant usage and table/function privileges to the authenticated and anon roles, since Supabase normally provides those defaults. A failed partial run leaves tables behind, so drop and recreate the database before retrying.
