aboutsummaryrefslogtreecommitdiff
path: root/schema.prisma
diff options
context:
space:
mode:
authorPeerawas Archavanuntakun <[email protected]>2022-01-06 03:30:32 +0700
committerGitHub <[email protected]>2022-01-05 14:30:32 -0600
commit51d378e4cb4584196b14132b4d330b8d370f8fb3 (patch)
tree176959c304bcb28ef33df0a3546bb4b88d691b09 /schema.prisma
parent129d121364c7e976c7bf5e2da3976da230058d77 (diff)
downloadmuse-51d378e4cb4584196b14132b4d330b8d370f8fb3.tar.xz
muse-51d378e4cb4584196b14132b4d330b8d370f8fb3.zip
Setup and migrate to Prisma (#456)
Diffstat (limited to 'schema.prisma')
-rw-r--r--schema.prisma49
1 files changed, 49 insertions, 0 deletions
diff --git a/schema.prisma b/schema.prisma
new file mode 100644
index 0000000..95ce596
--- /dev/null
+++ b/schema.prisma
@@ -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])
+}