Skip to content

Commit

Permalink
Map Prisma Model Names to Snake Case
Browse files Browse the repository at this point in the history
  • Loading branch information
otobot1 committed Nov 14, 2023
1 parent 325d12c commit d265cea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ model Length {
Map_Edit Map_Edit[]
Map_NewWithMod_New Map_NewWithMod_New[]
Map_NewSolo Map_NewSolo[]
@@map("length")
}

model Difficulty {
Expand All @@ -39,6 +40,7 @@ model Difficulty {
@@unique([parentDifficultyId, name])
@@unique([parentDifficultyId, order])
@@index([parentDifficultyId])
@@map("difficulty")
}

model Tech {
Expand All @@ -55,6 +57,7 @@ model Tech {
Map_NewSoloToTechs Map_NewSoloToTechs[]
@@index([difficultyId])
@@map("tech")
}

model TechVideo {
Expand All @@ -64,6 +67,7 @@ model TechVideo {
url String @db.VarChar(100)
@@index([techId])
@@map("tech-video")
}

model Publisher {
Expand All @@ -78,6 +82,7 @@ model Publisher {
Mod_New Mod_New[]
@@index([userId])
@@map("publisher")
}

model Mod {
Expand Down Expand Up @@ -108,6 +113,7 @@ model Mod {
@@index([contentWarning])
@@index([publisherId])
@@index([submittedBy])
@@map("mod")
}

model Map {
Expand Down Expand Up @@ -149,6 +155,7 @@ model Map {
@@index([mapperUserId])
@@index([modId])
@@index([submittedBy])
@@map("map")
}

model MapsToTechs {
Expand All @@ -160,6 +167,7 @@ model MapsToTechs {
@@id([mapId, techId])
@@index([techId])
@@map("maps-to-techs")
}

model Mod_Archive {
Expand Down Expand Up @@ -188,6 +196,7 @@ model Mod_Archive {
@@index([contentWarning])
@@index([publisherId])
@@index([submittedBy])
@@map("mod-archive")
}

model Map_Archive {
Expand Down Expand Up @@ -223,6 +232,7 @@ model Map_Archive {
@@index([mapperUserId])
@@index([mapId])
@@index([submittedBy])
@@map("map-archive")
}

model Map_ArchivesToTechs {
Expand All @@ -234,6 +244,7 @@ model Map_ArchivesToTechs {
@@id([map_ArchiveId, techId])
@@index([techId])
@@map("mod-archives-to-techs")
}

model Mod_Edit {
Expand All @@ -257,6 +268,7 @@ model Mod_Edit {
@@index([contentWarning])
@@index([publisherId])
@@index([submittedBy])
@@map("mod-edit")
}

model Map_Edit {
Expand Down Expand Up @@ -287,6 +299,7 @@ model Map_Edit {
@@index([mapperUserId])
@@index([mapId])
@@index([submittedBy])
@@map("map-edit")
}

model Map_EditsToTechs {
Expand All @@ -298,6 +311,7 @@ model Map_EditsToTechs {
@@id([map_editId, techId])
@@index([techId])
@@map("map-edits-to-techs")
}

model Mod_New {
Expand All @@ -320,6 +334,7 @@ model Mod_New {
@@index([contentWarning])
@@index([publisherId])
@@index([submittedBy])
@@map("mod-new")
}

model Map_NewWithMod_New {
Expand Down Expand Up @@ -352,6 +367,7 @@ model Map_NewWithMod_New {
@@index([mapperUserId])
@@index([mod_NewId])
@@index([submittedBy])
@@map("map-new-with-mod-new")
}

model Map_NewWithMod_NewToTechs {
Expand All @@ -363,6 +379,7 @@ model Map_NewWithMod_NewToTechs {
@@id([map_NewWithMod_NewId, techId])
@@index([techId])
@@map("map-new-with-mod-new-to-techs")
}

model Map_NewSolo {
Expand Down Expand Up @@ -395,6 +412,7 @@ model Map_NewSolo {
@@index([mapperUserId])
@@index([modId])
@@index([submittedBy])
@@map("map-new-solo")
}

model Map_NewSoloToTechs {
Expand All @@ -406,6 +424,7 @@ model Map_NewSoloToTechs {
@@id([map_NewSoloId, techId])
@@index([techId])
@@map("map-new-solo-to-techs")
}

model Quality {
Expand All @@ -414,6 +433,8 @@ model Quality {
description String @db.VarChar(100)
order Int @unique @db.UnsignedTinyInt //1 is the worst, higher numbers are better
Rating Rating[]
@@map("quality")
}

model Rating {
Expand All @@ -433,6 +454,7 @@ model Rating {
@@index([mapId])
@@index([qualityId])
@@index([submittedBy])
@@map("rating")
}

model ReviewCollection {
Expand All @@ -445,6 +467,7 @@ model ReviewCollection {
@@unique([userId, name])
@@index([userId])
@@map("review-collection")
}

model Review {
Expand All @@ -462,6 +485,7 @@ model Review {
@@unique([reviewCollectionId, modId])
@@index([modId])
@@index([reviewCollectionId])
@@map("review")
}

model MapReview {
Expand All @@ -482,6 +506,7 @@ model MapReview {
@@index([lengthId])
@@index([mapId])
@@index([reviewId])
@@map("map-review")
}

model UsersToCompletedMaps {
Expand All @@ -492,6 +517,7 @@ model UsersToCompletedMaps {
@@id([userId, mapId])
@@index([mapId])
@@map("users-to-completed-maps")
}

// Next auth models
Expand Down Expand Up @@ -532,6 +558,7 @@ model User {
Map_NewSolo_submittedByToUser Map_NewSolo[] @relation("Map_NewSolo_SubmittedByToUser")
@@unique([discordUsername, discordDiscriminator])
@@map("user")
}

model Account {
Expand All @@ -550,6 +577,7 @@ model Account {
session_state String? @map("sessionState")
@@unique([provider, providerAccountId])
@@map("account")
}

model Session {
Expand All @@ -558,6 +586,8 @@ model Session {
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Restrict)
userId String
expires DateTime
@@map("session")
}

model VerificationToken {
Expand All @@ -566,6 +596,7 @@ model VerificationToken {
expires DateTime
@@unique([identifier, token])
@@map("verification-token")
}

//End Next Auth models
Expand Down

0 comments on commit d265cea

Please sign in to comment.