Setup and migrate to Prisma (#456)

This commit is contained in:
Peerawas Archavanuntakun 2022-01-06 03:30:32 +07:00 committed by GitHub
parent 129d121364
commit 51d378e4cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 605 additions and 273 deletions

49
schema.prisma Normal file
View file

@ -0,0 +1,49 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model FileCache {
hash String @id
bytes Int
accessedAt DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model KeyValueCache {
key String @id
value String
expiresAt DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Setting {
guildId String @id
prefix String
channel String?
finishedSetup Boolean @default(false)
playlistLimit Int @default(50)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Shortcut {
id Int @id @default(autoincrement())
guildId String
authorId String
shortcut String
command String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([shortcut], map: "shortcuts_shortcut")
@@index([guildId], map: "shortcuts_guild_id")
@@index([guildId, shortcut])
}