summaryrefslogtreecommitdiff
path: root/packages/gateway/prisma/schema.prisma
blob: 3f69cf0acbe4dd05a1164a63f6a1828ecdaeca5b (plain) (blame)
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
generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model UserRole {
  id        String   @id @default(cuid())
  userId    String
  guildId   String
  roleId    String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  @@unique([userId, guildId, roleId])
  @@index([userId, guildId])
}

model EmojiUsage {
  id        String   @id @default(cuid())
  guildId   String
  emojiId   String
  emojiName String
  usageCount Int     @default(1)
  firstUsed DateTime @default(now())
  lastUsed  DateTime @default(now())

  @@unique([guildId, emojiId])
  @@index([guildId, usageCount])
}

model StickerUsage {
  id          String   @id @default(cuid())
  guildId     String
  stickerId   String
  stickerName String
  usageCount  Int      @default(1)
  firstUsed   DateTime @default(now())
  lastUsed    DateTime @default(now())

  @@unique([guildId, stickerId])
  @@index([guildId, usageCount])
}