SupaLaunch logo
SUPALAUNCH
ShowcaseDocs
SupaLaunch
HomeDemoDashboardDocumentationBlogShowcaseServices and FrameworksTerms of ServicePrivacy policy
Tools
DB Schema GeneratorStartup Idea Generator
Other Projects
Syntha AICreateChatsCron Expression GeneratorAI Prompts Generator
Contacts
Created with ❤️ by Denisdenis@supalaunch.com
  • Showcase
  • Docs
Blog

Supabase Storage Migrations Files

24 Dec 2023
By Denis
supabasenextjsdatabase

Launch your startup with our Supabase + NextJS Starter Kit

SupaLaunch is a SaaS boilerplate built using Supabase and Next.js. It includes authentication, Stripe payments, Postgres database, 20+ TailwindCSS themes, emails, OpenAI API streaming, file storage and more.

  • Save weeks of your time: No need to setup authentication, payments, emails, file storage, etc.
  • Focus on what matters: Spend your time building your product, not boilerplate code.
Get started with SupaLaunch

Supabase Storage Migrations Files

We discussed Supabase Database Migrations in the previous article. In this article, we will show you a little trick to create Supabase Storage Migrations Files.

The information about File Storage in Supabase is stored in the storage schema. So, we can use the --schema flag to create the migration files for the storage schema.

supabase db diff --use-migra <name> -f <name> --schema storage

The above command will create a migration file for the storage schema.

IMPORTANT: The created migration files will not contain the information about created buckets, only about the permissions. So, you have to create the buckets manually in the Supabase Dashboard.

In order to apply the migration to the production database, we need to use the following command:

supabase db push

Hope this helps you to create Supabase Storage Migrations Files.