db: add models

This commit is contained in:
凌莞 2022-02-15 23:23:03 +08:00
parent 5a25b3e154
commit 88c8555444
No known key found for this signature in database
GPG Key ID: 05F8479BA63A8E92
2 changed files with 35 additions and 6 deletions

3
.gitignore vendored
View File

@ -19,9 +19,6 @@ test/
*.log.*
*.sig
pkg/
src/
### VisualStudio template
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

View File

@ -11,13 +11,45 @@ datasource db {
}
model Message {
id Int @id @default(autoincrement())
roomId Int
senderId Int
id Int @id @default(autoincrement())
qqRoomId Int
qqSenderId Int
time DateTime
brief String
seq Int
rand Int
pktnum Int
tgChatId Int
tgMsgId Int
@@unique([qqRoomId, qqSenderId, seq, rand, pktnum])
@@unique([tgChatId, tgMsgId])
}
model ForwardPair {
id Int @id @default(autoincrement())
qqRoomId Int @unique
tgChatId Int @unique
}
model File {
id Int @id @default(autoincrement())
groupId Int
fileId String
info String
@@unique([groupId, fileId])
}
model FlashPhoto {
id Int @id @default(autoincrement())
photoMd5 String
}
model FlashPhotoView {
id Int @id @default(autoincrement())
flashPhotoId Int
viewerId Int
@@unique([flashPhotoId, viewerId])
}