cli icon indicating copy to clipboard operation
cli copied to clipboard

`supabase db dump`: no triggers in output

Open d9k opened this issue 2 years ago • 1 comments

How can I dump triggers (CREATE TRIGGER statements with supabase db dump)?

Tried with and without --data-only argument.

On the other side, pg_dump dumps triggers perfectly.

Why is it better to use supabase db dump instead of pg_dump at all?

Also supabase db dump doesn't dump migrations (but it can be dumped separately with supabase db dump --data-only --schema supabase_migrations)

Version

"supabase": "1.115.5"

d9k avatar Dec 08 '23 23:12 d9k

Are you triggers defined in auth or storage schema? Those are ignored by default so you need to pass in the schema flag directly, ie.

supabase db dump --schema auth

Why is it better to use supabase db dump instead of pg_dump at all?

db dump uses pg_dump behind the scenes but with extra flags to ignore supabase managed schemas. This is essential for future compatibility when upgrading to newer versions of services, like gotrue or realtime.

sweatybridge avatar Dec 08 '23 23:12 sweatybridge