Skip to content
Select themeSelect language

Add a database migration

SupaCloud uses sequential, numbered SQL migrations in server/migrations/.

  1. Find the next number — safely. Migration numbers are a shared namespace across parallel developers and worktrees. Before picking a number:

    Terminal window
    git fetch
    ls server/migrations/ # scan the highest number on main

    Also scan any sibling worktrees. Then take the next free number.

  2. Add the file as NNN_short_description.sql in server/migrations/.

  3. Verify it applies and the server still type-checks:

    Terminal window
    cd server && cargo check