Skip to Content
GuidesRunning Migrations

Running migrations

Migrations will automatically be run when you call sidetrack.start().

The migrations create a few tables in your database, like sidetrack_jobs and sidetrack_cron_jobs and associated database artifacts sidetrack needs to operate.

Programmatically

If you want to manually run the migrations, call runMigrations with your database connection string.

import { } from "sidetrack"; await (.["DATABASE_URL"]!);

CLI

You may also manually run migrations using Sidetrack’s CLI:

npx sidetrack migrations run --database-url $DATABASE_URL

The database-url flag is optional, and defaults to the DATABASE_URL environment variable if you do not provide a connection string.


You may also run it in wizard mode to see an interactive walkthrough of the available commands.

npx sidetrack --wizard
Last updated on