index added to db, pagination working

This commit is contained in:
echo committed 2025-04-10 00:27:55 +02:00
1 parent eada8b3eb1
commit 98c9328a3d
13 files changed
+428 -77

No files matched your search

@@ -0,0 +1,17 @@
-- DropForeignKey
ALTER TABLE "Note" DROP CONSTRAINT "Note_userId_fkey";
-- AlterTable
ALTER TABLE "Note" ALTER COLUMN "userId" DROP NOT NULL;
-- CreateIndex
CREATE INDEX "Article_url_idx" ON "Article"("url");
-- CreateIndex
CREATE INDEX "Collection_userId_idx" ON "Collection"("userId");
-- CreateIndex
CREATE INDEX "QuickNote_collectionId_idx" ON "QuickNote"("collectionId");
-- AddForeignKey
ALTER TABLE "Note" ADD CONSTRAINT "Note_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"
provider = "postgresql"
+6
View File
@@ -18,6 +18,8 @@ model Collection {
notes Note[]
userId String
user User @relation(fields: [userId], references: [id])
@@index([userId])
}
model Article {
@@ -34,6 +36,8 @@ model Article {
categories String[]
authors String[]
Note Note[]
@@index([url])
}
model QuickNote {
@@ -50,6 +54,8 @@ model QuickNote {
articleId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([collectionId])
}
model Note {