-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
48 lines (39 loc) · 1.05 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql" // other supported databases are "mysql" and "sqlite"
url = env("DATABASE_URL")
}
model Admin {
id String @id @default(uuid())
username String @unique
password String
}
model Artist {
id Int @id @default(autoincrement())
name String @unique
tracks Track[]
}
model Track {
id Int @id @default(autoincrement())
title String
artist_id Int
artist Artist @relation(fields: [artist_id], references: [id], onDelete: Cascade)
reports Report[]
@@unique([title, artist_id])
}
model Report {
id Int @id @default(autoincrement())
track_id Int
track Track @relation(fields: [track_id], references: [id], onDelete: Cascade)
desc String
}
model Request {
id Int @id @default(autoincrement())
track_title String
artist_name String
@@unique([track_title, artist_name])
}