A TypeScript-first library (v0.1.6) for running database migration scripts against Firestore. Integrates with Firebase Admin SDK to manage migration state via a Firestore collection. Provides CLI and programmatic APIs for applying, rolling back, and listing migrations. Designed for teams requiring structured schema evolution in Firestore, similar to Alembic for SQL databases. Ships TypeScript declarations and supports ESM and CJS environments. Active development with limited community adoption.
npm install msr-firebaseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows initializing the runner with Firebase Admin SDK, creating a migration with up/down functions, registering it, and executing pending migrations.
Ensure no conflicting collection named '_migrations' (or configured name) exists with unexpected documents.
Use runner.register() to add all migration scripts. Alternatively, use the programmatic API to load from a folder.
Remove migrationsPath and register migrations manually via runner.register().
Ensure admin.initializeApp() is called before creating MigrationRunner instance.
Use unique migration names or check previously applied migrations with runner.getAppliedMigrations().
Assign appropriate Firestore roles (e.g., 'Cloud Datastore User') to the service account.