From 2972cb4b6df58991d3343c8e2f7c2380f1ce2cd3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 2 Mar 2024 21:20:43 -0600 Subject: [PATCH] Add event stats indexes --- src/db/migrations/014_stats_indexes.ts.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/db/migrations/014_stats_indexes.ts.ts diff --git a/src/db/migrations/014_stats_indexes.ts.ts b/src/db/migrations/014_stats_indexes.ts.ts new file mode 100644 index 00000000..d9071c62 --- /dev/null +++ b/src/db/migrations/014_stats_indexes.ts.ts @@ -0,0 +1,11 @@ +import { Kysely } from '@/deps.ts'; + +export async function up(db: Kysely): Promise { + await db.schema.createIndex('idx_author_stats_pubkey').on('author_stats').column('pubkey').execute(); + await db.schema.createIndex('idx_event_stats_event_id').on('event_stats').column('event_id').execute(); +} + +export async function down(db: Kysely): Promise { + await db.schema.dropIndex('idx_author_stats_pubkey').on('author_stats').execute(); + await db.schema.dropIndex('idx_event_stats_event_id').on('event_stats').execute(); +}