-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.prisma
69 lines (63 loc) · 2.83 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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
model SlackToken {
@@map("slack_app_installation")
id Int @id @default(autoincrement())
clientId String? @map("client_id")
appId String? @map("app_id")
enterpriseId String? @map("enterprise_id")
enterpriseName String? @map("enterprise_name")
enterpriseUrl String? @map("enterprise_url")
teamId String? @map("team_id")
teamName String? @map("team_name")
botToken String? @map("bot_token")
botId String? @map("bot_id")
botUserId String? @map("bot_user_id")
botScopes String? @map("bot_scopes")
botRefreshToken String? @map("bot_refresh_token")
botTokenExpiresAt DateTime? @map("bot_token_expires_at")
userId String? @map("user_id")
userToken String? @map("user_token")
userScopes String? @map("user_scopes")
userRefreshToken String? @map("user_refresh_token")
userTokenExpiresAt DateTime? @map("user_token_expires_at")
incomingWebhookUrl String? @map("incoming_webhook_url")
incomingWebhookChannel String? @map("incoming_webhook_channel")
incomingWebhookChannelId String? @map("incoming_webhook_channel_id")
incomingWebhookConfigurationUrl String? @map("incoming_webhook_configuration_url")
isEnterpriseInstall Boolean @default(false) @map("is_enterprise_install")
tokenType String @default("bot") @map("token_type")
installedAt DateTime @default(now()) @map("installed_at")
}
model User {
id String @id
slack String @unique
admin Boolean
transcript String
welcomesGiven Int @default(0)
totalWelcomeTime Int @default(0)
welcomedUsers WelcomeEvent[]
}
model SlackStats {
id Int @id @default(autoincrement())
totalJoins Int @default(0)
totalWelcomed Int @default(0)
pendingWelcomes Int @default(0)
lastUpdated DateTime @default(now())
}
model WelcomeEvent {
id Int @id @default(autoincrement())
newUserId String
welcomer User? @relation(fields: [welcomerId], references: [slack])
welcomerId String?
status String @default("pending")
joinedAt DateTime @default(now())
completedAt DateTime?
timeToWelcome Int?
}