Skip to content

Instantly share code, notes, and snippets.

@yudistiraashadi
Last active September 25, 2024 17:28
Show Gist options
  • Save yudistiraashadi/e394aa2cc950af85c0727aa0e32d8fd3 to your computer and use it in GitHub Desktop.
Save yudistiraashadi/e394aa2cc950af85c0727aa0e32d8fd3 to your computer and use it in GitHub Desktop.
Sync Supabase command e tok

RUN DI LOCAL:

  1. npx supabase init untuk setup supabase folder dan config.
  2. npx supabase start untuk setup Docker (download docker image + setup)
  3. npx supabase db pull --db-url [connection-string-asal] untuk memastikan diff dari db remote dan local sesuai
  4. npx supabase db pull [(optional) migration-name] --db-url [connection-string-asal]
  5. npx supabase db pull [(optional) migration-name] --db-url [connection-string-asal] --schema auth,storage
  6. npx supabase db dump --data-only -f supabase/seed.sql --db-url [connection-string-asal]
  7. (untuk update DB existing) npx supabase db push --db-url [connection-string-tujuan]
  8. (untuk DB baru dari 0) npx supabase db reset --db-url [connection-string-tujuan]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment