DBMigratorclass

new DBMigrator<T>(provider: T)
ParamType
providerT
The database provider whose storage this migrator updates. required
Return
DBMigrator<T>
Base class for database schema migrators that bring a provider's storage into line with a set of collection schemas.
PropertyType
.providerT
The database provider whose storage this migrator updates. required readonly

Base class for database schema migrators that bring a provider's storage into line with a set of collection schemas.

  • Subclasses implement migrate() for a specific backend (e.g. SQL via SQLMigrator).

Examples

class MyMigrator extends DBMigrator { async migrate(...collections) { ... } }
 await new MyMigrator(provider).migrate(users, posts);

Methods

Go

DBMigrator.migrate()method

Bring the provider's storage into line with the given collection schemas.

migrate(...collections: Collections): Promise<void>