Browse Source

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 <noreply@anthropic.com>
pull/6456/head
Alan Garber 1 month ago
parent
commit
fe9424943b
  1. 25
      prisma/migrations/20260301000000_add_news_article/migration.sql

25
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");
Loading…
Cancel
Save