Module

x/kysely_postgrs_js_dialect/mod.ts>kysely.Migrator#migrateTo

Kysely dialect for PostgreSQL using the Postgres.js client.
method kysely.Migrator.prototype.migrateTo
import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/mod.ts";
const { Migrator } = kysely;

Migrate up/down to a specific migration.

This method returns a MigrationResultSet instance and never throws. {@link MigrationResultSet.error} holds the error if something went wrong. {@link MigrationResultSet.results} contains information about which migrations were executed and which failed.

Examples

await migrator.migrateTo('some_migration')

If you specify the name of the first migration, this method migrates down to the first migration, but doesn't run the down method of the first migration. In case you want to migrate all the way down, you can use a special constant NO_MIGRATIONS:

await migrator.migrateTo(NO_MIGRATIONS)

Parameters

targetMigrationName: string | NoMigrations