# Migrations

Migrations are how Fakebase remembers schema work. Each change becomes a SQL file in your project.

## Set up migrations

Migrations belong to a project: a folder with `fakebase.toml` and a `migrations` folder. If the database you have selected is a connection without a project, **Migrations** shows **Browse-only connection**. Choose **Create project** to make one for this database, or **Open project folder** to use one you already have. See [Databases](https://fakebase.studio/docs/studio-databases.md).

If the database already has tables, choose how to start:

- **Baseline** takes a snapshot of the current schema without writing a file. Your next change becomes the first migration.
- **Initial migration** writes the current schema as the first migration file and records it as applied.
- **Import SQL files** appears when the folder has `.sql` files that aren't named as migrations yet. Studio renames them to timestamped migration names, and they stay pending until you apply them.

A project with no migrations shows **No migrations yet**. Make your first one in your editor, or change the schema in **Tables** or the **SQL Editor** and save it as a migration.

## The journal

The Migrations page is the journal: what has been applied, what is still pending, and whether the live database still matches the files.

[Reviewing migrations in Fakebase Studio](https://fakebase.studio/docs/11_migrations_overview_image.mp4)

## Statuses

- **Applied** — this file has been recorded on the database.
- **Pending to be applied** — the SQL is on disk and still needs to run.
- **Waiting for file save** — the database already changed (for example from the studio). Save it as a migration, or discard it. See [Schema drift](https://fakebase.studio/docs/schema-drift.md).
- **Modified** — an applied file was edited on disk. Restore it before you apply, bundle, or revert.

An amber dot on **Migrations** in the sidebar means the live schema and the snapshot have drifted.

## Review a file

Select a migration to open it. **SQL Migration** shows the file. **Schema Overview** shows what was added, removed, changed, or left alone.

From here you [apply pending files](https://fakebase.studio/docs/apply-migrations.md), [capture drift](https://fakebase.studio/docs/schema-drift.md), or [manage history](https://fakebase.studio/docs/manage-migration-history.md) — restore, bundle, delete, or relink the folder.

---

## Next steps

- [Apply and review](https://fakebase.studio/docs/apply-migrations.md): Review a pending migration and apply it to the database.
- [Schema drift](https://fakebase.studio/docs/schema-drift.md): Capture schema changes that already landed in the database as a migration file.
- [Manage history](https://fakebase.studio/docs/manage-migration-history.md): Restore, bundle, delete, and relink migrations in Fakebase Studio.
