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 0000000..d9071c6 --- /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(); +}