Skip to content

Commit c5ea9bc

Browse files
committed
Round 4
1 parent dbb8c28 commit c5ea9bc

File tree

2 files changed

+15
-89
lines changed

2 files changed

+15
-89
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the `RunConnection` table. If the table is not empty, all the data it contains will be lost.
5+
- You are about to drop the `TriggerSource` table. If the table is not empty, all the data it contains will be lost.
6+
7+
*/
8+
9+
-- DropTable
10+
DROP TABLE IF EXISTS "RunConnection" CASCADE;
11+
12+
-- DropTable
13+
DROP TABLE IF EXISTS "TriggerSource" CASCADE;

internal-packages/database/prisma/schema.prisma

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ model Organization {
157157
invites OrgMemberInvite[]
158158
externalAccounts ExternalAccount[]
159159
integrations Integration[]
160-
sources TriggerSource[]
161160
organizationIntegrations OrganizationIntegration[]
162161
workerGroups WorkerInstanceGroup[]
163162
workerInstances WorkerInstance[]
@@ -181,7 +180,6 @@ model ExternalAccount {
181180
connections IntegrationConnection[]
182181
events EventRecord[]
183182
runs JobRun[]
184-
triggerSources TriggerSource[]
185183
EventDispatcher EventDispatcher[]
186184
187185
@@unique([environmentId, identifier])
@@ -255,9 +253,7 @@ model Integration {
255253
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
256254
organizationId String
257255
258-
connections IntegrationConnection[]
259-
sources TriggerSource[]
260-
RunConnection RunConnection[]
256+
connections IntegrationConnection[]
261257
262258
@@unique([organizationId, slug])
263259
}
@@ -299,8 +295,6 @@ model IntegrationConnection {
299295
300296
/// If enabled is false, OAuth refreshing will not be attempted
301297
enabled Boolean @default(true)
302-
303-
runConnections RunConnection[]
304298
}
305299

306300
enum ConnectionType {
@@ -385,7 +379,6 @@ model RuntimeEnvironment {
385379
events EventRecord[]
386380
jobRuns JobRun[]
387381
JobQueue JobQueue[]
388-
sources TriggerSource[]
389382
eventDispatchers EventDispatcher[]
390383
ExternalAccount ExternalAccount[]
391384
concurrencyLimitGroups ConcurrencyLimitGroup[]
@@ -455,7 +448,6 @@ model Project {
455448
jobVersion JobVersion[]
456449
events EventRecord[]
457450
runs JobRun[]
458-
sources TriggerSource[]
459451
httpEndpoints TriggerHttpEndpoint[]
460452
backgroundWorkers BackgroundWorker[]
461453
backgroundWorkerTasks BackgroundWorkerTask[]
@@ -514,7 +506,6 @@ model Endpoint {
514506
jobVersions JobVersion[]
515507
jobRuns JobRun[]
516508
dynamictriggers DynamicTrigger[]
517-
sources TriggerSource[]
518509
519510
@@unique([environmentId, slug])
520511
}
@@ -582,7 +573,6 @@ model JobVersion {
582573
583574
runs JobRun[]
584575
dynamicTriggers DynamicTrigger[]
585-
triggerSources TriggerSource[]
586576
587577
status JobVersionStatus @default(ACTIVE)
588578
@@ -630,27 +620,6 @@ model JobQueue {
630620
@@unique([environmentId, name])
631621
}
632622

633-
model RunConnection {
634-
id String @id @default(cuid())
635-
key String
636-
637-
authSource IntegrationAuthSource @default(HOSTED)
638-
639-
run JobRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade)
640-
runId String
641-
642-
connection IntegrationConnection? @relation(fields: [connectionId], references: [id], onDelete: Cascade, onUpdate: Cascade)
643-
connectionId String?
644-
645-
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
646-
integrationId String
647-
648-
createdAt DateTime @default(now())
649-
updatedAt DateTime @updatedAt
650-
651-
@@unique([runId, key])
652-
}
653-
654623
model DynamicTrigger {
655624
id String @id @default(cuid())
656625
type DynamicTriggerType @default(EVENT)
@@ -659,8 +628,7 @@ model DynamicTrigger {
659628
endpoint Endpoint @relation(fields: [endpointId], references: [id], onDelete: Cascade, onUpdate: Cascade)
660629
endpointId String
661630
662-
jobs Job[]
663-
sources TriggerSource[]
631+
jobs Job[]
664632
665633
sourceRegistrationJob JobVersion? @relation(fields: [sourceRegistrationJobId], references: [id], onDelete: Cascade, onUpdate: Cascade)
666634
sourceRegistrationJobId String?
@@ -806,8 +774,6 @@ model JobRun {
806774
807775
forceYieldImmediately Boolean @default(false)
808776
809-
runConnections RunConnection[]
810-
811777
@@index([jobId, createdAt(sort: Desc)], map: "idx_jobrun_jobId_createdAt")
812778
@@index([organizationId, createdAt], map: "idx_jobrun_organizationId_createdAt")
813779
@@index([versionId], map: "idx_jobrun_versionId")
@@ -865,7 +831,6 @@ model SecretReference {
865831
866832
connections IntegrationConnection[]
867833
integrations Integration[]
868-
triggerSources TriggerSource[]
869834
httpEndpoints TriggerHttpEndpoint[]
870835
environmentVariableValues EnvironmentVariableValue[]
871836
@@ -890,58 +855,6 @@ model SecretStore {
890855
@@index([key(ops: raw("text_pattern_ops"))], type: BTree)
891856
}
892857

893-
model TriggerSource {
894-
id String @id @default(cuid())
895-
896-
key String
897-
params Json?
898-
899-
channel TriggerChannel @default(HTTP)
900-
channelData Json?
901-
902-
version String @default("1")
903-
904-
metadata Json?
905-
906-
secretReference SecretReference @relation(fields: [secretReferenceId], references: [id], onDelete: Cascade, onUpdate: Cascade)
907-
secretReferenceId String
908-
909-
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
910-
organizationId String
911-
912-
environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade)
913-
environmentId String
914-
915-
endpoint Endpoint @relation(fields: [endpointId], references: [id], onDelete: Cascade, onUpdate: Cascade)
916-
endpointId String
917-
918-
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade)
919-
projectId String
920-
921-
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
922-
integrationId String
923-
924-
dynamicTrigger DynamicTrigger? @relation(fields: [dynamicTriggerId], references: [id], onDelete: Cascade, onUpdate: Cascade)
925-
dynamicTriggerId String?
926-
927-
externalAccount ExternalAccount? @relation(fields: [externalAccountId], references: [id], onDelete: Cascade, onUpdate: Cascade)
928-
externalAccountId String?
929-
930-
sourceRegistrationJob JobVersion? @relation(fields: [sourceRegistrationJobId], references: [id], onDelete: Cascade, onUpdate: Cascade)
931-
sourceRegistrationJobId String?
932-
933-
dynamicSourceId String?
934-
dynamicSourceMetadata Json?
935-
936-
active Boolean @default(false)
937-
interactive Boolean @default(false)
938-
939-
createdAt DateTime @default(now())
940-
updatedAt DateTime @updatedAt
941-
942-
@@unique([key, environmentId])
943-
}
944-
945858
enum TriggerChannel {
946859
HTTP
947860
SQS

0 commit comments

Comments
 (0)