Upgrade Nostrify to v0.20.0, enable Postgres FTS
This commit is contained in:
parent
405714960e
commit
00d4bf2344
|
@ -21,7 +21,7 @@
|
||||||
"@db/sqlite": "jsr:@db/sqlite@^0.11.1",
|
"@db/sqlite": "jsr:@db/sqlite@^0.11.1",
|
||||||
"@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1",
|
"@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1",
|
||||||
"@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0",
|
"@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0",
|
||||||
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.19.2",
|
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.20.0",
|
||||||
"@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs",
|
"@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs",
|
||||||
"@soapbox/kysely-deno-sqlite": "jsr:@soapbox/kysely-deno-sqlite@^2.1.0",
|
"@soapbox/kysely-deno-sqlite": "jsr:@soapbox/kysely-deno-sqlite@^2.1.0",
|
||||||
"@soapbox/stickynotes": "jsr:@soapbox/stickynotes@^0.4.0",
|
"@soapbox/stickynotes": "jsr:@soapbox/stickynotes@^0.4.0",
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { Kysely, sql } from 'kysely';
|
||||||
|
|
||||||
|
import { Conf } from '@/config.ts';
|
||||||
|
|
||||||
|
export async function up(db: Kysely<any>): Promise<void> {
|
||||||
|
if (['postgres:', 'postgresql:'].includes(Conf.databaseUrl.protocol!)) {
|
||||||
|
await db.schema.createTable('nostr_pgfts')
|
||||||
|
.ifNotExists()
|
||||||
|
.addColumn('event_id', 'text', (c) => c.primaryKey().references('nostr_events.id').onDelete('cascade'))
|
||||||
|
.addColumn('search_vec', sql`tsvector`, (c) => c.notNull())
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(db: Kysely<any>): Promise<void> {
|
||||||
|
if (['postgres:', 'postgresql:'].includes(Conf.databaseUrl.protocol!)) {
|
||||||
|
await db.schema.dropTable('nostr_pgfts').ifExists().execute();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue