Skip to content

Commit e1bba09

Browse files
committed
Remove the RunEngine prisma schema changes
1 parent 386ee00 commit e1bba09

File tree

1 file changed

+1
-143
lines changed

1 file changed

+1
-143
lines changed

internal-packages/database/prisma/schema.prisma

Lines changed: 1 addition & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,6 @@ model Project {
470470
alertStorages ProjectAlertStorage[]
471471
bulkActionGroups BulkActionGroup[]
472472
BackgroundWorkerFile BackgroundWorkerFile[]
473-
waitpoints Waitpoint[]
474-
taskRunWaitpoints TaskRunWaitpoint[]
475473
}
476474

477475
enum ProjectVersion {
@@ -1113,8 +1111,6 @@ model TaskAttempt {
11131111
createdAt DateTime @default(now())
11141112
updatedAt DateTime @updatedAt
11151113
1116-
executionSnapshot TaskRunExecutionSnapshot[]
1117-
11181114
@@unique([taskId, number])
11191115
}
11201116

@@ -1658,8 +1654,6 @@ model TaskRun {
16581654
number Int @default(0)
16591655
friendlyId String @unique
16601656
1661-
engine RunEngineVersion @default(V1)
1662-
16631657
status TaskRunStatus @default(PENDING)
16641658
16651659
idempotencyKey String?
@@ -1681,12 +1675,8 @@ model TaskRun {
16811675
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade)
16821676
projectId String
16831677
1684-
// The specific queue this run is in
16851678
queue String
16861679
1687-
/// The main queue that this run is part of
1688-
masterQueue String @default("main")
1689-
16901680
createdAt DateTime @default(now())
16911681
updatedAt DateTime @updatedAt
16921682
@@ -1718,16 +1708,9 @@ model TaskRun {
17181708
expiredAt DateTime?
17191709
maxAttempts Int?
17201710
1721-
///When this run is finished, the waitpoint will be marked as completed
1722-
associatedWaitpoint Waitpoint?
1723-
1724-
///If there are any blocked waitpoints, the run won't be executed
1725-
blockedByWaitpoints TaskRunWaitpoint[]
1726-
17271711
batchItems BatchTaskRunItem[]
17281712
dependency TaskRunDependency?
17291713
CheckpointRestoreEvent CheckpointRestoreEvent[]
1730-
executionSnapshot TaskRunExecutionSnapshot[]
17311714
17321715
alerts ProjectAlert[]
17331716
@@ -1857,131 +1840,6 @@ enum TaskRunStatus {
18571840
TIMED_OUT
18581841
}
18591842

1860-
enum RunEngineVersion {
1861-
/// The original version that uses marqs v1 and Graphile
1862-
V1
1863-
V2
1864-
}
1865-
1866-
/// Used by the RunEngine during TaskRun execution
1867-
/// It has the required information to transactionally progress a run through states,
1868-
/// and prevent side effects like heartbeats failing a run that has progressed.
1869-
/// It is optimised for performance and is designed to be cleared at some point,
1870-
/// so there are no cascading relationships to other models.
1871-
model TaskRunExecutionSnapshot {
1872-
id String @id @default(cuid())
1873-
1874-
/// This should never be V1
1875-
engine RunEngineVersion @default(V2)
1876-
1877-
/// The execution status
1878-
executionStatus TaskRunExecutionStatus
1879-
/// For debugging
1880-
description String
1881-
1882-
/// Run
1883-
runId String
1884-
run TaskRun @relation(fields: [runId], references: [id])
1885-
runStatus TaskRunStatus
1886-
1887-
/// Attempt
1888-
currentAttemptId String?
1889-
currentAttempt TaskAttempt? @relation(fields: [currentAttemptId], references: [id])
1890-
currentAttemptStatus TaskAttemptStatus?
1891-
1892-
/// todo Checkpoint
1893-
1894-
/// These are only ever appended, so we don't need updatedAt
1895-
createdAt DateTime @default(now())
1896-
1897-
///todo machine spec?
1898-
1899-
///todo worker
1900-
1901-
/// Used to get the latest state quickly
1902-
@@index([runId, createdAt(sort: Desc)])
1903-
}
1904-
1905-
enum TaskRunExecutionStatus {
1906-
RUN_CREATED
1907-
DEQUEUED_FOR_EXECUTION
1908-
EXECUTING
1909-
BLOCKED_BY_WAITPOINTS
1910-
FINISHED
1911-
}
1912-
1913-
/// A Waitpoint blocks a run from continuing until it's completed
1914-
/// If there's a waitpoint blocking a run, it shouldn't be in the queue
1915-
model Waitpoint {
1916-
id String @id @default(cuid())
1917-
1918-
type WaitpointType
1919-
status WaitpointStatus @default(PENDING)
1920-
1921-
completedAt DateTime?
1922-
1923-
/// If it's an Event type waitpoint, this is the event. It can also be provided for the DATETIME type
1924-
idempotencyKey String
1925-
userProvidedIdempotencyKey Boolean
1926-
1927-
/// If an idempotencyKey is no longer active, we store it here and generate a new one for the idempotencyKey field.
1928-
/// This is a workaround because Prisma doesn't support partial indexes.
1929-
inactiveIdempotencyKey String?
1930-
1931-
/// If it's a RUN type waitpoint, this is the associated run
1932-
completedByTaskRunId String? @unique
1933-
completedByTaskRun TaskRun? @relation(fields: [completedByTaskRunId], references: [id], onDelete: SetNull)
1934-
1935-
/// If it's a DATETIME type waitpoint, this is the date
1936-
completedAfter DateTime?
1937-
1938-
/// The runs this waitpoint is blocking
1939-
blockingTaskRuns TaskRunWaitpoint[]
1940-
1941-
/// When completed, an output can be stored here
1942-
output String?
1943-
outputType String @default("application/json")
1944-
1945-
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade)
1946-
projectId String
1947-
1948-
createdAt DateTime @default(now())
1949-
updatedAt DateTime @updatedAt
1950-
1951-
@@unique([projectId, idempotencyKey])
1952-
}
1953-
1954-
enum WaitpointType {
1955-
RUN
1956-
DATETIME
1957-
EVENT
1958-
}
1959-
1960-
enum WaitpointStatus {
1961-
PENDING
1962-
COMPLETED
1963-
}
1964-
1965-
model TaskRunWaitpoint {
1966-
id String @id @default(cuid())
1967-
1968-
taskRun TaskRun @relation(fields: [taskRunId], references: [id])
1969-
taskRunId String
1970-
1971-
waitpoint Waitpoint @relation(fields: [waitpointId], references: [id])
1972-
waitpointId String
1973-
1974-
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade)
1975-
projectId String
1976-
1977-
createdAt DateTime @default(now())
1978-
updatedAt DateTime @updatedAt
1979-
1980-
@@unique([taskRunId, waitpointId])
1981-
@@index([taskRunId])
1982-
@@index([waitpointId])
1983-
}
1984-
19851843
model TaskRunTag {
19861844
id String @id @default(cuid())
19871845
name String
@@ -2011,7 +1869,7 @@ model TaskRunDependency {
20111869
checkpointEvent CheckpointRestoreEvent? @relation(fields: [checkpointEventId], references: [id], onDelete: Cascade, onUpdate: Cascade)
20121870
checkpointEventId String? @unique
20131871
2014-
/// An attempt that is dependent on this task run.
1872+
/// An attempt that is dependent on this task run.
20151873
dependentAttempt TaskRunAttempt? @relation(fields: [dependentAttemptId], references: [id])
20161874
dependentAttemptId String?
20171875

0 commit comments

Comments
 (0)