Merge remote-tracking branch 'origin/main' into use-npool-nostrify

This commit is contained in:
Alex Gleason 2024-07-20 13:31:05 -05:00
commit 8768bb1bad
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 44 additions and 5 deletions

View file

@ -27,7 +27,7 @@
"@hono/hono": "jsr:@hono/hono@^4.4.6",
"@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1",
"@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0",
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.26.0",
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.26.3",
"@scure/base": "npm:@scure/base@^1.1.6",
"@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs",
"@soapbox/kysely-deno-sqlite": "jsr:@soapbox/kysely-deno-sqlite@^2.1.0",

8
deno.lock generated
View file

@ -12,7 +12,7 @@
"jsr:@nostrify/nostrify@^0.22.1": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.22.4": "jsr:@nostrify/nostrify@0.22.4",
"jsr:@nostrify/nostrify@^0.22.5": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.26.0": "jsr:@nostrify/nostrify@0.26.0",
"jsr:@nostrify/nostrify@^0.26.3": "jsr:@nostrify/nostrify@0.26.3",
"jsr:@soapbox/kysely-deno-sqlite@^2.1.0": "jsr:@soapbox/kysely-deno-sqlite@2.2.0",
"jsr:@soapbox/stickynotes@^0.4.0": "jsr:@soapbox/stickynotes@0.4.0",
"jsr:@std/assert@^0.217.0": "jsr:@std/assert@0.217.0",
@ -142,8 +142,8 @@
"npm:zod@^3.23.8"
]
},
"@nostrify/nostrify@0.26.0": {
"integrity": "8a4a49326f2d2bdf27e9ac6dc8c052bb37b31ae892350daa1df470070fddacd1",
"@nostrify/nostrify@0.26.3": {
"integrity": "3e13e30f4fa3f76dcbcf9178630a9b2871186eb1d226d66234c0cdfd4841f548",
"dependencies": [
"jsr:@std/crypto@^0.224.0",
"jsr:@std/encoding@^0.224.1",
@ -1748,7 +1748,7 @@
"jsr:@bradenmacdonald/s3-lite-client@^0.7.4",
"jsr:@db/sqlite@^0.11.1",
"jsr:@hono/hono@^4.4.6",
"jsr:@nostrify/nostrify@^0.26.0",
"jsr:@nostrify/nostrify@^0.26.3",
"jsr:@soapbox/kysely-deno-sqlite@^2.1.0",
"jsr:@soapbox/stickynotes@^0.4.0",
"jsr:@std/assert@^0.225.1",

View file

@ -0,0 +1,39 @@
import { Kysely } from 'kysely';
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.createIndex('nostr_events_created_at_kind')
.on('nostr_events')
.ifNotExists()
.columns(['created_at desc', 'id asc', 'kind'])
.execute();
await db.schema
.createIndex('nostr_events_kind_pubkey_created_at')
.on('nostr_events')
.ifNotExists()
.columns(['kind', 'pubkey', 'created_at desc', 'id asc'])
.execute();
await db.schema.dropIndex('idx_events_created_at_kind').execute();
await db.schema.dropIndex('idx_events_kind_pubkey_created_at').execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema.dropIndex('nostr_events_created_at_kind').execute();
await db.schema.dropIndex('nostr_events_kind_pubkey_created_at').execute();
await db.schema
.createIndex('idx_events_created_at_kind')
.on('nostr_events')
.ifNotExists()
.columns(['created_at desc', 'kind'])
.execute();
await db.schema
.createIndex('idx_events_kind_pubkey_created_at')
.on('nostr_events')
.ifNotExists()
.columns(['kind', 'pubkey', 'created_at desc'])
.execute();
}