function up
up(db: DatabaseSync): void

Run once by runMigrations. Every existing category becomes a dump category, filing the same dumps.

SQLite can't change a table's UNIQUE constraints in place, so categories is rebuilt. foreign_keys can't be switched off inside the runner's transaction, and dropping categories would then empty dump_categories through its cascade, so both are read, dropped child first, made anew as in schema.sql, and refilled. A database made from schema.sql already has the kind column and is left as it is.

Parameters

db: DatabaseSync

Return Type

void

Usage

import { up } from "api/db/migrations/0025_playlist_categories.ts";