db: pragma, enable fk constraints, enable autovacuum full
This commit is contained in:
parent
02049ed9d1
commit
a25d6c9755
|
@ -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…
Reference in New Issue