Home | Emulators | Seeds & Migrations | Deployment | Test Runners | Known Issues
A seed adds user data to the database.
// TODO: Fix up our current seeds
A migration is a script that either:
- setups up new structure required for new functionality
- transforms existing data (e.g. restructuring) to accomodate new functionality
Migrations are stored in admin/migrations
:
- must start with a 3 digit number (E.g.
001-your-migration.ts
) - contain an
up
method that performs the transformation on a Firestore instance
-
Make a copy of
_000-template.ts
and rename it with the next available consecutive number. -
Write your database changes in a batched write or transaction inside the
up
method (example in the template).
Runs all unperformed migrations
- from admin
-
yarn migrate
To see what migrations have been run, inspect configuration/migrations
in Firestore.