Skip to content

Commit fb9d3e1

Browse files
committed
Round 4
1 parent f1a08ed commit fb9d3e1

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 {
@@ -401,7 +395,6 @@ model RuntimeEnvironment {
401395
events EventRecord[]
402396
jobRuns JobRun[]
403397
JobQueue JobQueue[]
404-
sources TriggerSource[]
405398
eventDispatchers EventDispatcher[]
406399
ExternalAccount ExternalAccount[]
407400
concurrencyLimitGroups ConcurrencyLimitGroup[]
@@ -473,7 +466,6 @@ model Project {
473466
jobVersion JobVersion[]
474467
events EventRecord[]
475468
runs JobRun[]
476-
sources TriggerSource[]
477469
httpEndpoints TriggerHttpEndpoint[]
478470
backgroundWorkers BackgroundWorker[]
479471
backgroundWorkerTasks BackgroundWorkerTask[]
@@ -532,7 +524,6 @@ model Endpoint {
532524
jobVersions JobVersion[]
533525
jobRuns JobRun[]
534526
dynamictriggers DynamicTrigger[]
535-
sources TriggerSource[]
536527
537528
@@unique([environmentId, slug])
538529
}
@@ -600,7 +591,6 @@ model JobVersion {
600591
601592
runs JobRun[]
602593
dynamicTriggers DynamicTrigger[]
603-
triggerSources TriggerSource[]
604594
605595
status JobVersionStatus @default(ACTIVE)
606596
@@ -648,27 +638,6 @@ model JobQueue {
648638
@@unique([environmentId, name])
649639
}
650640

651-
model RunConnection {
652-
id String @id @default(cuid())
653-
key String
654-
655-
authSource IntegrationAuthSource @default(HOSTED)
656-
657-
run JobRun @relation(fields: [runId], references: [id], onDelete: Cascade, onUpdate: Cascade)
658-
runId String
659-
660-
connection IntegrationConnection? @relation(fields: [connectionId], references: [id], onDelete: Cascade, onUpdate: Cascade)
661-
connectionId String?
662-
663-
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
664-
integrationId String
665-
666-
createdAt DateTime @default(now())
667-
updatedAt DateTime @updatedAt
668-
669-
@@unique([runId, key])
670-
}
671-
672641
model DynamicTrigger {
673642
id String @id @default(cuid())
674643
type DynamicTriggerType @default(EVENT)
@@ -677,8 +646,7 @@ model DynamicTrigger {
677646
endpoint Endpoint @relation(fields: [endpointId], references: [id], onDelete: Cascade, onUpdate: Cascade)
678647
endpointId String
679648
680-
jobs Job[]
681-
sources TriggerSource[]
649+
jobs Job[]
682650
683651
sourceRegistrationJob JobVersion? @relation(fields: [sourceRegistrationJobId], references: [id], onDelete: Cascade, onUpdate: Cascade)
684652
sourceRegistrationJobId String?
@@ -824,8 +792,6 @@ model JobRun {
824792
825793
forceYieldImmediately Boolean @default(false)
826794
827-
runConnections RunConnection[]
828-
829795
@@index([jobId, createdAt(sort: Desc)], map: "idx_jobrun_jobId_createdAt")
830796
@@index([organizationId, createdAt], map: "idx_jobrun_organizationId_createdAt")
831797
@@index([versionId], map: "idx_jobrun_versionId")
@@ -883,7 +849,6 @@ model SecretReference {
883849
884850
connections IntegrationConnection[]
885851
integrations Integration[]
886-
triggerSources TriggerSource[]
887852
httpEndpoints TriggerHttpEndpoint[]
888853
environmentVariableValues EnvironmentVariableValue[]
889854
@@ -908,58 +873,6 @@ model SecretStore {
908873
@@index([key(ops: raw("text_pattern_ops"))], type: BTree)
909874
}
910875

911-
model TriggerSource {
912-
id String @id @default(cuid())
913-
914-
key String
915-
params Json?
916-
917-
channel TriggerChannel @default(HTTP)
918-
channelData Json?
919-
920-
version String @default("1")
921-
922-
metadata Json?
923-
924-
secretReference SecretReference @relation(fields: [secretReferenceId], references: [id], onDelete: Cascade, onUpdate: Cascade)
925-
secretReferenceId String
926-
927-
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
928-
organizationId String
929-
930-
environment RuntimeEnvironment @relation(fields: [environmentId], references: [id], onDelete: Cascade, onUpdate: Cascade)
931-
environmentId String
932-
933-
endpoint Endpoint @relation(fields: [endpointId], references: [id], onDelete: Cascade, onUpdate: Cascade)
934-
endpointId String
935-
936-
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade, onUpdate: Cascade)
937-
projectId String
938-
939-
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade, onUpdate: Cascade)
940-
integrationId String
941-
942-
dynamicTrigger DynamicTrigger? @relation(fields: [dynamicTriggerId], references: [id], onDelete: Cascade, onUpdate: Cascade)
943-
dynamicTriggerId String?
944-
945-
externalAccount ExternalAccount? @relation(fields: [externalAccountId], references: [id], onDelete: Cascade, onUpdate: Cascade)
946-
externalAccountId String?
947-
948-
sourceRegistrationJob JobVersion? @relation(fields: [sourceRegistrationJobId], references: [id], onDelete: Cascade, onUpdate: Cascade)
949-
sourceRegistrationJobId String?
950-
951-
dynamicSourceId String?
952-
dynamicSourceMetadata Json?
953-
954-
active Boolean @default(false)
955-
interactive Boolean @default(false)
956-
957-
createdAt DateTime @default(now())
958-
updatedAt DateTime @updatedAt
959-
960-
@@unique([key, environmentId])
961-
}
962-
963876
enum TriggerChannel {
964877
HTTP
965878
SQS

0 commit comments

Comments
 (0)