Skip to content

Tankōbon / main/db/schema / migrate

Function: migrate() ​

migrate(db): void

Defined in: main/db/schema.ts:272

Brings db up to the current schema by applying, in order, the migrations newer than its PRAGMA user_version. Each runs in its own transaction together with the version bump, so a failure leaves the database at the last fully applied version. Never destructive on its own, and a no-op on an up-to-date database, so it runs on every start.

A database whose version is ahead of this build (written by a newer release) is left untouched.

Parameters ​

db ​

DatabaseSync

Returns ​

void