feat: user relay management, blog naddr sync, and OG image update

Add UserRelay API and dashboard relays tab with NIP-65 import, store post
naddr for Nostr articles, and ship Prisma migrations for board tables,
user relays, and post metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
bbe
2026-06-23 05:54:34 +02:00
co-authored by Cursor
parent 78271ea110
commit 3bdd01dedf
19 changed files with 896 additions and 132 deletions
@@ -0,0 +1,29 @@
-- CreateTable
CREATE TABLE IF NOT EXISTS "BoardInvoicePending" (
"paymentHash" TEXT NOT NULL PRIMARY KEY,
"content" TEXT NOT NULL,
"guestName" TEXT,
"pubkey" TEXT,
"profilePic" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE IF NOT EXISTS "BoardMessage" (
"id" TEXT NOT NULL PRIMARY KEY,
"paymentHash" TEXT NOT NULL,
"content" TEXT NOT NULL,
"authorName" TEXT NOT NULL,
"pubkey" TEXT,
"profilePic" TEXT,
"satsPaid" INTEGER NOT NULL,
"status" TEXT NOT NULL DEFAULT 'active',
"likeCount" INTEGER NOT NULL DEFAULT 0,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateIndex
CREATE UNIQUE INDEX IF NOT EXISTS "BoardMessage_paymentHash_key" ON "BoardMessage"("paymentHash");
-- DropIndex (cleanup from organizer migration)
DROP INDEX IF EXISTS "Meetup_organizerId_idx";
@@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "UserRelay" (
"id" TEXT NOT NULL PRIMARY KEY,
"pubkey" TEXT NOT NULL,
"url" TEXT NOT NULL,
"read" BOOLEAN NOT NULL DEFAULT true,
"write" BOOLEAN NOT NULL DEFAULT true,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateIndex
CREATE UNIQUE INDEX "UserRelay_pubkey_url_key" ON "UserRelay"("pubkey", "url");
@@ -0,0 +1,5 @@
-- AlterTable: add naddr column to Post
ALTER TABLE "Post" ADD COLUMN "naddr" TEXT;
-- AlterTable: set default for content on Post (new rows only; existing rows keep their content)
-- SQLite doesn't support ALTER COLUMN DEFAULT, but Prisma handles this at the client level.
+13 -1
View File
@@ -61,9 +61,10 @@ model Media {
model Post {
id String @id @default(uuid())
nostrEventId String @unique
naddr String?
title String
slug String @unique
content String
content String @default("")
excerpt String?
authorPubkey String
authorName String?
@@ -117,6 +118,17 @@ model Relay {
createdAt DateTime @default(now())
}
model UserRelay {
id String @id @default(uuid())
pubkey String
url String
read Boolean @default(true)
write Boolean @default(true)
createdAt DateTime @default(now())
@@unique([pubkey, url])
}
model Setting {
id String @id @default(uuid())
key String @unique