From fe9424943bfe52fbe016b8bdb29f52b7c3bec002 Mon Sep 17 00:00:00 2001 From: Alan Garber Date: Sun, 1 Mar 2026 23:52:38 -0500 Subject: [PATCH] Add Prisma migration for NewsArticle model The previous commit used `prisma db push` which doesn't create migration files. Railway runs `prisma migrate deploy` on startup, which requires a migration file in prisma/migrations/ to apply schema changes. Co-Authored-By: Claude Opus 4.6 --- .../migration.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 prisma/migrations/20260301000000_add_news_article/migration.sql diff --git a/prisma/migrations/20260301000000_add_news_article/migration.sql b/prisma/migrations/20260301000000_add_news_article/migration.sql new file mode 100644 index 000000000..e1844385d --- /dev/null +++ b/prisma/migrations/20260301000000_add_news_article/migration.sql @@ -0,0 +1,25 @@ +-- CreateTable +CREATE TABLE "NewsArticle" ( + "id" TEXT NOT NULL, + "symbol" TEXT NOT NULL, + "headline" TEXT NOT NULL, + "summary" TEXT NOT NULL, + "source" TEXT NOT NULL, + "url" TEXT NOT NULL, + "imageUrl" TEXT, + "publishedAt" TIMESTAMP(3) NOT NULL, + "finnhubId" INTEGER NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "NewsArticle_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsArticle_finnhubId_key" ON "NewsArticle"("finnhubId"); + +-- CreateIndex +CREATE INDEX "NewsArticle_symbol_idx" ON "NewsArticle"("symbol"); + +-- CreateIndex +CREATE INDEX "NewsArticle_publishedAt_idx" ON "NewsArticle"("publishedAt");