mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
db/users: add indexes on users.pubkey and users.username
This commit is contained in:
parent
561ae9532a
commit
25e023aaf2
1 changed files with 20 additions and 0 deletions
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…
Add table
Reference in a new issue