mirror of https://github.com/Nofated095/Q2TG.git
db: add models
This commit is contained in:
parent
5a25b3e154
commit
88c8555444
|
@ -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.
|
||||
|
|
|
@ -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])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue