@iamcalegari/mongoat / defineMigration
Function: defineMigration()
defineMigration(
migrationModule):MigrationModule
Defined in: src/migrate/index.ts:40
Identity helper for authoring a migration file — takes the up/down exports and returns them unchanged, giving the author full type inference on MigrationContext without an explicit annotation on the exported object.
Parameters
migrationModule
The migration's up (required) and down (optional) functions.
Returns
The same migrationModule, unchanged.
Example
typescript
import { defineMigration } from '@iamcalegari/mongoat';
export default defineMigration({
async up(ctx) {
// ...
},
});