prorm API Reference
    Preparing search index...

    Class Migrator

    Migrator class - Manages database migrations

    Index
    • Register a migration file

      Parameters

      • migrationPath: string

        Path to the migration file

      Returns Promise<void>

    • Find and register all migration files in a directory

      Returns Promise<void>

    • Revert all executed migrations with a batch number greater than targetBatch, actually running each migration's down() function (loaded the same way up() is) before removing its tracking row.

      Parameters

      • targetBatch: number

        Batch number to revert down to

      Returns Promise<MigratorResult>

    • Set the migration path

      Parameters

      • newPath: string

      Returns void