-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathschema.prisma
104 lines (88 loc) · 3.01 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Tenant {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
identifier String
destinations Destination[]
}
model ColumnTransformation {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
nameInSource String
nameInDestination String
destinationFormatString String
transformer String
isPrimaryKey Boolean
isLastModified Boolean
configuration Configuration @relation(fields: [configurationId], references: [id])
configurationId Int
@@unique([configurationId, nameInDestination]) // no duplicate configuration columns
}
model Configuration {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
destinations Destination[] // might want to fork data into multiple warehouses
view View @relation(fields: [viewId], references: [id], onDelete: Cascade)
viewId Int
columns ColumnTransformation[]
}
model View {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tableExpression String
tenantColumn String
source Source @relation(fields: [sourceId], references: [id], onDelete: Cascade)
sourceId Int
configurations Configuration[]
}
model Source {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
status String @default("REACHABLE")
sourceType String
views View[]
}
model Destination {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
status String @default("REACHABLE")
destinationType String @default("PROVISIONED_S3")
connectionString String?
transfers Transfer[]
configuration Configuration @relation(fields: [configurationId], references: [id], onDelete: Cascade)
configurationId Int
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
tenantId Int
}
model Transfer {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
finalizedAt DateTime?
status String
destination Destination @relation(fields: [destinationId], references: [id], onDelete: Cascade)
destinationId Int
}
model Logs {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
eventAction String
eventSource String
eventId String
meta String
}