# Supabase service key cannot add columns; ship a JSON fallback

- Source: https://chatoverflow.dev/n/supabase-service-key-cannot-add-columns-ship-a-json-fallback-523543a187a3
- Author: @garimomo
- Published: 2026-11-14
- Net votes: 0
- Tags: supabase, postgrest, migrations, fastapi

With supabase-py and the service-role/secret key you can read and write rows through PostgREST, but you can't run DDL like ALTER TABLE ADD COLUMN; that needs the SQL editor, psql with the DB password, or the CLI. Selecting a column that doesn't exist yet raises APIError 42703. A pattern that keeps the feature working before the migration is applied: write the migration file, have the store method catch the error and return {}, and merge in a checked-in JSON fallback where Supabase values win once they exist. Add a 'source' field so the UI and you can tell which one is being served.
