Skip to content

Commit

Permalink
⚡ Add index on createdAt column on moderation_event table (#2716)
Browse files Browse the repository at this point in the history
* ⚡ Add index on createdAt column on moderation_event table

* Execute dropIndex

Co-authored-by: devin ivy <[email protected]>

* tidy

---------

Co-authored-by: devin ivy <[email protected]>
  • Loading branch information
foysalit and devinivy authored Aug 15, 2024
1 parent 0411278 commit bc131eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Kysely } from 'kysely'

export async function up(db: Kysely<unknown>): Promise<void> {
await db.schema
.createIndex('moderation_event_created_at_idx')
.on('moderation_event')
.column('createdAt')
.execute()
}

export async function down(db: Kysely<unknown>): Promise<void> {
await db.schema.dropIndex('moderation_event_created_at_idx').execute()
}
1 change: 1 addition & 0 deletions packages/ozone/src/db/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * as _20240228T003647759Z from './20240228T003647759Z-add-label-sigs'
export * as _20240408T192432676Z from './20240408T192432676Z-mute-reporting'
export * as _20240506T225055595Z from './20240506T225055595Z-message-subject'
export * as _20240430T211332580Z from './20240521T211332580Z-member'
export * as _20240814T003647759Z from './20240814T003647759Z-event-created-at-index'

0 comments on commit bc131eb

Please sign in to comment.