MigrateService setups up and runs migrations for you.

const migrateRepo: MigrateRepository

const migrateService = new MigrateService({ migrateRepo })

Hierarchy

  • MigrateService

Constructors

Methods

Constructors

Methods

  • Run a set of migrations. This works well with DECONF_MIGRATIONS.

    NOTE: all migrations must have a unique name, this is so previous migrations are not re-run.

    // Run the deconf migrations
    await migrateService.runMigrations(DECONF_MIGRATIONS)

    // Run custom migrations
    await migrateService.runMigrations([
    {
    id: 'add-custom-table',
    async run(client) {
    await client.sql`CREATE TABLE ...`
    },
    },
    ])

    Parameters

    Returns Promise<void>

Generated using TypeDoc