mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
db: pragma, enable fk constraints, enable autovacuum full
This commit is contained in:
parent
02049ed9d1
commit
a25d6c9755
1 changed files with 12 additions and 0 deletions
12
src/db/migrations/006_pragma.ts
Normal file
12
src/db/migrations/006_pragma.ts
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue