From the course: Supabase Essential Training

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Why use migrations and seeds?

Why use migrations and seeds?

- [Instructor] Running queries in the SQL editor is a great way to test database changes quickly. But when you're done, how do you get that into your production environment? You can be very careful making notes of all of your queries and then running them in the same order. But, even then, sometimes you forget and make mistakes. Instead, you can use migrations. Migrations make it easy for you to order your queries while letting the computer keep track of what is run and what has not yet been run. They're all timestamped, which keeps them in the right order. Then when you use a CLI, Supabase will run those migrations. Similar to migrations, seeds are a way of setting up a new environment. This way, you can have realistic test data to use in a local development environment without having to create an anonymized export of production. Migrations and seeds work together to keep the state of your databases consistent. By…

Contents