db/users: add indexes on users.pubkey and users.username

This commit is contained in:
Alex Gleason 2023-09-04 13:18:11 -05:00
parent 561ae9532a
commit 25e023aaf2
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import { Kysely } from '@/deps.ts';
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.createIndex('idx_users_pubkey')
.on('users')
.column('pubkey')
.execute();
await db.schema
.createIndex('idx_users_username')
.on('users')
.column('username')
.execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema.dropIndex('idx_users_pubkey').execute();
await db.schema.dropIndex('idx_users_username').execute();
}