User => Player

This commit is contained in:
2024-12-08 13:41:37 +01:00
parent c6da328023
commit 65576fc5b1
39 changed files with 193 additions and 240 deletions

View File

@@ -7,7 +7,7 @@ datasource db {
url = env("DATABASE_URL")
}
model User {
model Player {
id Int @id @default(autoincrement())
name String @unique
password String
@@ -21,8 +21,8 @@ model User {
model Geolocation {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
player Player @relation(fields: [playerId], references: [id])
playerId Int
longitude Float
latitude Float
speed Float
@@ -42,8 +42,8 @@ model Challenge {
model ChallengeAction {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
player Player @relation(fields: [playerId], references: [id])
playerId Int
challenge Challenge @relation(fields: [challengeId], references: [id])
challengeId Int @unique
active Boolean @default(false)
@@ -57,8 +57,8 @@ model ChallengeAction {
model TrainTrip {
id String @id
user User @relation(fields: [userId], references: [id])
userId Int
player Player @relation(fields: [playerId], references: [id])
playerId Int
distance Float
from String
to String
@@ -70,8 +70,8 @@ model TrainTrip {
model MoneyUpdate {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
player Player @relation(fields: [playerId], references: [id])
playerId Int
amount Int
reason MoneyUpdateType
action ChallengeAction? @relation(fields: [actionId], references: [id])