Hacker News new | ask | show | jobs
by speakfreely 1239 days ago
How did you define your models and manage database migrations with Supabase?
3 comments

After things were live, my migrations would be backward compatible. It's also possible to organize your tables where most of your data is in private schemas, and public views serve as your apis and versioning. Anything in a public view must be treated as a long-lived API until clients can be phased out.

My userbase was in the dozens at most, so pushing out a version OTA usually was effective to get things moving along.

Worst case, I had some code to check if the client version was too old and would shut it down until they updated.

As per models, what kind of details are you asking?

The supabase CLI supports database migrations:

https://supabase.com/docs/guides/cli/local-development#datab...

Personally, I've found node-pg-migrate works well for a Node stack and Postgres migrations in Supabase. Then, I primarily interact with the database using the Supabase GraphQL API + RLS.