From faaefd6c31b7e7ea100f3cc3a05509b242a2ce37 Mon Sep 17 00:00:00 2001 From: xCyanGrizzly Date: Tue, 3 Mar 2026 21:47:15 +0100 Subject: [PATCH] fix: correct User table name in bot migration FK The User model has no @@map so its table is "User" (PascalCase), not "users". The FK reference was wrong. --- prisma/migrations/20260303200000_add_telegram_bot/migration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prisma/migrations/20260303200000_add_telegram_bot/migration.sql b/prisma/migrations/20260303200000_add_telegram_bot/migration.sql index 9a96576..6ebcf7c 100644 --- a/prisma/migrations/20260303200000_add_telegram_bot/migration.sql +++ b/prisma/migrations/20260303200000_add_telegram_bot/migration.sql @@ -58,7 +58,7 @@ CREATE UNIQUE INDEX "bot_subscriptions_telegramUserId_pattern_key" ON "bot_subsc CREATE INDEX "bot_subscriptions_telegramUserId_idx" ON "bot_subscriptions"("telegramUserId"); -- AddForeignKey -ALTER TABLE "telegram_links" ADD CONSTRAINT "telegram_links_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE "telegram_links" ADD CONSTRAINT "telegram_links_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey ALTER TABLE "bot_send_requests" ADD CONSTRAINT "bot_send_requests_packageId_fkey" FOREIGN KEY ("packageId") REFERENCES "packages"("id") ON DELETE RESTRICT ON UPDATE CASCADE;