feat: new importer (#214)
This commit is contained in:
committed by
GitHub
parent
b51bc8f3f6
commit
212254d31a
@@ -194,6 +194,7 @@ model Project {
|
||||
|
||||
notificationRules NotificationRule[]
|
||||
notifications Notification[]
|
||||
imports Import[]
|
||||
|
||||
// When deleteAt > now(), the project will be deleted
|
||||
deleteAt DateTime?
|
||||
@@ -467,3 +468,31 @@ model ResetPassword {
|
||||
|
||||
@@map("reset_password")
|
||||
}
|
||||
|
||||
enum ImportStatus {
|
||||
pending
|
||||
processing
|
||||
completed
|
||||
failed
|
||||
}
|
||||
|
||||
model Import {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
projectId String
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
jobId String? // BullMQ job ID
|
||||
status ImportStatus
|
||||
statusMessage String? // Human-readable current step like "Importing events (Feb 2025)", "Generating session IDs"
|
||||
errorMessage String?
|
||||
/// [IPrismaImportConfig]
|
||||
config Json
|
||||
totalEvents Int @default(0)
|
||||
processedEvents Int @default(0)
|
||||
currentStep String?
|
||||
currentBatch String? // String date 2020-01-01
|
||||
createdAt DateTime @default(now())
|
||||
completedAt DateTime?
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
||||
@@map("imports")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user