db: pragma, enable fk constraints, enable autovacuum full

This commit is contained in:
Alex Gleason 2023-09-05 17:25:14 -05:00
parent 02049ed9d1
commit a25d6c9755
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { Kysely, sql } from '@/deps.ts';
export async function up(db: Kysely<any>): Promise<void> {
await sql`PRAGMA foreign_keys = ON`.execute(db);
await sql`PRAGMA auto_vacuum = FULL`.execute(db);
await sql`VACUUM`.execute(db);
}
export async function down(db: Kysely<any>): Promise<void> {
await sql`PRAGMA foreign_keys = OFF`.execute(db);
await sql`PRAGMA auto_vacuum = NONE`.execute(db);
}