-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
64 lines (57 loc) · 1.61 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// 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 = "sqlite"
url = env("DATABASE_URL")
}
model Account {
id Int @id @default(autoincrement())
pubkey String @unique
private_key String? @unique
user User @relation(fields: [user_id], references: [id])
user_id Int @unique
added_at DateTime @default(now())
}
model User {
id Int @id @default(autoincrement())
pubkey String @unique
account Account?
metadata Metadata?
added_at DateTime @default(now())
}
model Metadata {
id Int @id @default(autoincrement())
user User @relation(fields: [user_id], references: [id])
user_id Int @unique
event Event @relation(fields: [event_id], references: [id])
event_id Int @unique
lud06 String?
website String?
nip05 String?
picture String?
display_name String?
banner String?
about String?
name String?
}
model Relay {
id Int @id @default(autoincrement())
url String @unique
added_at DateTime @default(now())
}
model Event {
id Int @id @default(autoincrement())
metadata Metadata?
event_id String @unique
event_signature String
event_kind Int
event_pubkey String
event_content String?
event_tags String?
// Refactor this to event_created_at?
event_createdAt DateTime
added_at DateTime @default(now())
}