mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
feat: add progress indication for long downloads
This commit is contained in:
18
prisma/migrations/20250519130610_progress/migration.sql
Normal file
18
prisma/migrations/20250519130610_progress/migration.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "progress" (
|
||||
"id" UUID NOT NULL,
|
||||
"user_id" UUID NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"data" JSONB,
|
||||
"current" INTEGER NOT NULL DEFAULT 0,
|
||||
"total" INTEGER NOT NULL DEFAULT 0,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "progress_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "progress_user_id_idx" ON "progress"("user_id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "progress" ADD CONSTRAINT "progress_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -39,6 +39,7 @@ model User {
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
appData AppData[]
|
||||
progress Progress[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
@@ -219,3 +220,17 @@ model AppData {
|
||||
@@unique([userId, app])
|
||||
@@map("app_data")
|
||||
}
|
||||
|
||||
model Progress {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
userId String @map("user_id") @db.Uuid
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
type String
|
||||
data Json?
|
||||
current Int @default(0)
|
||||
total Int @default(0)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
@@index([userId])
|
||||
@@map("progress")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user