Creating migrations
📖 Scenario: You are working on a Supabase project to manage your database schema changes safely and consistently. You want to create a migration file that adds a new table to your database.
🎯 Goal: Create a migration file that defines a new table called profiles with columns id (UUID primary key), username (text, unique), and created_at (timestamp with time zone, default to now).
📋 What You'll Learn
Create a migration file with the correct SQL syntax
Define the
profiles table with the specified columns and constraintsUse best practices for UUID primary keys and timestamps
Ensure the migration is valid and deployable in Supabase
💡 Why This Matters
🌍 Real World
Database migrations help you safely change your database schema over time without losing data or causing errors.
💼 Career
Knowing how to write migrations is essential for backend developers and cloud engineers working with databases and Supabase.
Progress0 / 4 steps