From 91fe7acbd22e47b9813e3f4cbf5ece0e177b0431 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 13 Jun 2024 21:36:07 -0500 Subject: [PATCH] Index nostr_tags.name --- src/db/migrations/026_tags_name_index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/db/migrations/026_tags_name_index.ts diff --git a/src/db/migrations/026_tags_name_index.ts b/src/db/migrations/026_tags_name_index.ts new file mode 100644 index 00000000..a15587fb --- /dev/null +++ b/src/db/migrations/026_tags_name_index.ts @@ -0,0 +1,14 @@ +import { Kysely } from 'kysely'; + +export async function up(db: Kysely): Promise { + await db.schema + .createIndex('idx_tags_name') + .on('nostr_tags') + .column('name') + .ifNotExists() + .execute(); +} + +export async function down(db: Kysely): Promise { + await db.schema.dropIndex('idx_tags_name').ifExists().execute(); +}