db/users: add indexes on users.pubkey and users.username
This commit is contained in:
parent
561ae9532a
commit
25e023aaf2
20
src/db/migrations/004_add_user_indexes.ts
Normal file
20
src/db/migrations/004_add_user_indexes.ts
Normal 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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user