Master Guides
Database
A friendly wrapper over MasterRecord migrations.
master db runs the MasterRecord migration CLI inside your backend/ workspace with the right context and environment — so you never juggle paths.
The everyday loop#
terminal
$ # change a model, then:$ master db new AddPosts # generate a migration from the diff$ master db migrate # apply pending migrations
All actions#
| Command | What it does |
|---|---|
master db migrate | Apply pending migrations (update-database). |
master db new <Name> | Create a migration from current models (add-migration). |
master db rollback | Revert the latest migration (update-database-down). |
master db enable | One-time: create the snapshot (enable-migrations). |
master db list | List migration files (get-migrations). |
master db ensure | Create the database if missing (ensure-database, MySQL). |
Choosing the environment#
terminal
$ master db migrate --env production$ # or$ NODE_ENV=production master db migrate
Note
The context is
AppContext (in backend/app/models/AppContext.js). Database credentials live in backend/config/environments/env.<env>.json, keyed by AppContext.