-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathschema.dbml
160 lines (139 loc) · 2.99 KB
/
schema.dbml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
enum line_kind {
refrain
heading
line
invocation
orphan
}
enum language {
"iso-639"
}
enum asset_type {
primary
translations
}
// Use DBML to define your database structure
// Docs: https://dbml.dbdiagram.io/docs
Table line_groups {
id string [pk]
bookmark_id string [ref: > bookmarks.id]
line_id string [ref: > lines.id]
author string [ref: - authors.id]
related_assets string [ref: <> assets.id]
order_id int
}
Table lines {
id string [primary key]
kind line_kind
// Standardised ordering for conceptual
line_number int
// need a better letter
p int
related_assets string [ref: <> assets.id]
}
Table recommended_line_assets {
asset_id string [ref: - assets.id]
language language
type asset_type
priority int
}
// asset_id | lang | type
// --
// ssa2 | pa | primary
// svsv | pa | primary
Table line_data {
line_id string [ref: < lines.id]
asset_id int [ref: - assets.id]
type asset_type
language language
data string
}
Table authors {
id string
first_name string
last_names string
}
// Banis also have to be able to include / augment from other material sources
// TO discuss
table bookmark_folders {
// id = 0 is root folder
id string
bookmark_id string [ref: - bookmarks.id]
bookmarks b [ref: <> bookmarks.id]
}
table bookmarks {
id string
name string
}
table banis {
id string
bookmark_id string [ref: - bookmarks.id]
name i18string
asset_id string [ref: - assets.id]
lines string [ref: <> lines.id]
}
// Amrit Keertan will be an asset (for research reasons)
// But a bookmark for browsing reasons
// Mahan Kosh -> word level
table dictionaries {
id string
asset_id string [ref: - assets.id]
}
table words {
id string
}
// future can have recommended dicitionaries
// for now, return all defintiions but ordered
table word_definitions {
word_id string [ref: - words.id]
dictionary_id string [ref: - dictionaries.id]
language language
definition string
}
// generated from word_representations
table words_search {
query string [primary key]
word_id string [ref: > words.id]
// unique per query <> word_id pair
priority int
}
table word_representations {
dictionary_id string [ref: - dictionaries.id]
word_id string [ref: - words.id]
language language
script script
// primary key (dict_id, word_id, lang, script)
word string
alternative_spellings string[]
}
// Assets Scenarios:
// - Kirtan of (line groups | banis)[]
// - Katha/Podcasts of (lines, line groups, banis)[]
// - Notes / compositions (pictures) of (line groups, banis)
// - PDFs, books (line groups)[]
Table asset_author {
id string [pk]
name string
}
Table asset_group {
id string [pk]
name string
assets string [ref: > assets.id]
}
Table assets {
id string [primary key]
name string
authors string [ref: > asset_author.id]
publisher string
published_date Date
// ....
}
Table audio {
asset_id string [ref: > assets.id]
}
Table video {
asset_id string [ref: > assets.id]
}
Table pdf {
asset_id string [ref: > assets.id]
}