add: deployment & fix cascading issues
This commit is contained in:
parent
40744a0502
commit
dd98781cc5
|
@ -51,6 +51,7 @@ model User {
|
||||||
accounts Account[]
|
accounts Account[]
|
||||||
sessions Session[]
|
sessions Session[]
|
||||||
Workspace Workspace[]
|
Workspace Workspace[]
|
||||||
|
Deployment Deployment[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model VerificationToken {
|
model VerificationToken {
|
||||||
|
@ -71,6 +72,7 @@ model Workspace {
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
Application Application[]
|
Application Application[]
|
||||||
|
Deployment Deployment[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model Application {
|
model Application {
|
||||||
|
@ -82,8 +84,31 @@ model Application {
|
||||||
repositoryId String
|
repositoryId String
|
||||||
path String
|
path String
|
||||||
autoDeploy Boolean
|
autoDeploy Boolean
|
||||||
Workspace Workspace @relation(fields: [workspaceId], references: [id])
|
|
||||||
workspaceId String
|
workspaceId String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
Deployment Deployment[]
|
||||||
|
|
||||||
|
Workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DeploymentStatus {
|
||||||
|
PENDING
|
||||||
|
IN_PROGRESS
|
||||||
|
FAILED
|
||||||
|
SUCCESS
|
||||||
|
}
|
||||||
|
|
||||||
|
model Deployment {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
applicationId String
|
||||||
|
workspaceId String
|
||||||
|
userId String
|
||||||
|
status DeploymentStatus @default(PENDING)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
Application Application @relation(fields: [applicationId], references: [id], onDelete: Cascade)
|
||||||
|
Workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
||||||
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue