Setup your environment
Set up migrations
Link a migrations folder to your database so Fakebase can track schema changes.
After you have a database, set up migrations so schema changes live in your project as SQL files. The work you do in Fakebase then travels with your repo - ready for deploy, and easy to pick up again later.
Open Set up migrations from the migrations area, or continue into it after creating a local database. You will choose one of two starting points.
Set up in a project
This path creates migration files from the database you already have. Fakebase reads the current schema and writes it into your project.
- Choose Set up in a project.
- Pick the project folder (the root of your git repo).
- Choose a subfolder —
migrations/ordb/migrations/. - Confirm. Fakebase snapshots the schema as a baseline, or generates an initial migration file from the existing database.
Use this when you do not have migration files yet. The database is the source of truth, and Fakebase turns it into SQL in your repo.
Use existing folder
This path is an import. You already have migration files, and the database adopts them.
- Choose Use existing folder.
- Pick the folder that already contains the migration files.
- Confirm. Fakebase links those files to this database so it can follow that history — including adopting files that already match the database, or importing SQL that is not in the journal yet.
Use this when the files are the source of truth — for example from another tool, a teammate, or a previous Fakebase setup. The database is brought in line with what you import.