198 lines
6.4 KiB
Plaintext
198 lines
6.4 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = "file:./main.db"
|
|
}
|
|
|
|
model Composition {
|
|
id Int @id @default(autoincrement())
|
|
text String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model Currency {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
full_name String
|
|
value Value[]
|
|
}
|
|
|
|
model Demonetization {
|
|
id Int @id @default(autoincrement())
|
|
is_demonetized Boolean
|
|
demonetization_date String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model Edge {
|
|
id Int @id @default(autoincrement())
|
|
engravers String?
|
|
designers String?
|
|
description String?
|
|
lettering String?
|
|
lettering_scripts String?
|
|
unabridged_legend String?
|
|
lettering_translation String?
|
|
picture String?
|
|
thumbnail String?
|
|
picture_copyright String?
|
|
picture_copyright_url String?
|
|
picture_license_name String?
|
|
picture_license_url String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model Issuer {
|
|
code String @id
|
|
name String
|
|
type NumistaType[]
|
|
}
|
|
|
|
model NumistaType {
|
|
id Int @id @default(autoincrement())
|
|
url String?
|
|
title String
|
|
category String
|
|
issuer_code String?
|
|
min_year Int?
|
|
max_year Int?
|
|
type String?
|
|
value_id Int?
|
|
demonetization_id Int?
|
|
shape String?
|
|
composition_id Int?
|
|
technique_id Int?
|
|
weight Float?
|
|
size Float?
|
|
thickness Float?
|
|
orientation String?
|
|
obverse_id Int?
|
|
reverse_id Int?
|
|
edge_id Int?
|
|
watermark_id Int?
|
|
series String?
|
|
commemorated_topic String?
|
|
comments String?
|
|
count Int @default(1)
|
|
color String?
|
|
watermark Watermark? @relation(fields: [watermark_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
edge Edge? @relation(fields: [edge_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
reverse Reverse? @relation(fields: [reverse_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
obverse Obverse? @relation(fields: [obverse_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
technique Technique? @relation(fields: [technique_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
composition Composition? @relation(fields: [composition_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
demonetization Demonetization? @relation(fields: [demonetization_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
value Value? @relation(fields: [value_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
issuer Issuer? @relation(fields: [issuer_code], references: [code], onDelete: NoAction, onUpdate: NoAction)
|
|
relatedB TypeRelated[] @relation("TypeRelated_type2_idToType")
|
|
relatedA TypeRelated[] @relation("TypeRelated_type1_idToType")
|
|
rulers TypeRuler[]
|
|
}
|
|
|
|
model Obverse {
|
|
id Int @id @default(autoincrement())
|
|
engravers String?
|
|
designers String?
|
|
description String?
|
|
lettering String?
|
|
lettering_scripts String?
|
|
unabridged_legend String?
|
|
lettering_translation String?
|
|
picture String?
|
|
thumbnail String?
|
|
picture_copyright String?
|
|
picture_copyright_url String?
|
|
picture_license_name String?
|
|
picture_license_url String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model Reverse {
|
|
id Int @id @default(autoincrement())
|
|
engravers String?
|
|
designers String?
|
|
description String?
|
|
lettering String?
|
|
lettering_scripts String?
|
|
unabridged_legend String?
|
|
lettering_translation String?
|
|
picture String?
|
|
thumbnail String?
|
|
picture_copyright String?
|
|
picture_copyright_url String?
|
|
picture_license_name String?
|
|
picture_license_url String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model Ruler {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
wikidata_id String?
|
|
group_id Int?
|
|
group RulerGroup? @relation(fields: [group_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
TypeRuler TypeRuler[]
|
|
}
|
|
|
|
model RulerGroup {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
rulers Ruler[]
|
|
}
|
|
|
|
model Technique {
|
|
id Int @id @default(autoincrement())
|
|
text String?
|
|
type NumistaType[]
|
|
}
|
|
|
|
model TypeRelated {
|
|
type1_id Int
|
|
type2_id Int
|
|
type1 NumistaType @relation("TypeRelated_type2_idToType", fields: [type2_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
type2 NumistaType @relation("TypeRelated_type1_idToType", fields: [type1_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
|
|
@@unique([type1_id, type2_id], map: "sqlite_autoindex_TypeRelated_1")
|
|
}
|
|
|
|
model TypeRuler {
|
|
type_id Int
|
|
ruler_id Int
|
|
ruler Ruler @relation(fields: [ruler_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
type NumistaType @relation(fields: [type_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
|
|
@@unique([type_id, ruler_id], map: "sqlite_autoindex_TypeRuler_1")
|
|
}
|
|
|
|
model Value {
|
|
id Int @id @default(autoincrement())
|
|
text String?
|
|
numeric_value Float?
|
|
numerator Int?
|
|
denominator Int?
|
|
currency_id Int?
|
|
type NumistaType[]
|
|
currency Currency? @relation(fields: [currency_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
|
|
}
|
|
|
|
model Watermark {
|
|
id Int @id @default(autoincrement())
|
|
engravers String?
|
|
designers String?
|
|
description String?
|
|
lettering String?
|
|
lettering_scripts String?
|
|
unabridged_legend String?
|
|
lettering_translation String?
|
|
picture String?
|
|
thumbnail String?
|
|
picture_copyright String?
|
|
picture_copyright_url String?
|
|
picture_license_name String?
|
|
picture_license_url String?
|
|
type NumistaType[]
|
|
}
|