Skip to content

Commit 255031e

Browse files
authored
Merge pull request #353 from mcarmonaa/improvement/docs-add-commit-files-table
docs: add commit_files table to the schema documentation
2 parents ea87958 + ca2899d commit 255031e

File tree

3 files changed

+17
-77
lines changed

3 files changed

+17
-77
lines changed

docs/assets/gitbase-db-diagram.png

-17 KB
Loading

docs/assets/gitbase_model.mwb

13.9 KB
Binary file not shown.

docs/using-gitbase/schema.md

Lines changed: 17 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@ This table represents the relation between commits and blobs. With this table yo
150150

151151
This table represents the relation between commits and trees. With this table you can obtain all the tree entries contained on a commit object.
152152

153+
### commit_files
154+
```sql
155+
+---------------+------+
156+
| name | type |
157+
+---------------+------+
158+
| repository_id | TEXT |
159+
| commit_hash | TEXT |
160+
| file_path | TEXT |
161+
| blob_hash | TEXT |
162+
| tree_hash | TEXT |
163+
+---------------+------+
164+
```
165+
166+
This table represents the relation between commits and [files](#files). Using this table, you can obtain all the files related to a certain commit object.
167+
153168
### ref_commits
154169
```sql
155170
+---------------+-------+
@@ -171,83 +186,8 @@ Commits will be repeated if they are in several repositories or references.
171186
## Database diagram
172187
<!--
173188
174-
repositories as r
175-
-
176-
repository_id string
177-
178-
remotes
179-
-
180-
repository_id string FK - r.repository_id
181-
remote_name string
182-
remote_push_url string
183-
remote_fetch_url string
184-
remote_push_refspec string
185-
remote_fetch_refspec string
186-
187-
refs
188-
-
189-
repository_id string FK >- repositories.repository_id
190-
ref_name string
191-
commit_hash string FK >- commits.commit_hash
192-
193-
commits as c
194-
-
195-
repository_id string FK >- repositories.repository_id
196-
commit_hash string
197-
commit_author_name string
198-
commit_author_email string
199-
commit_author_when timestamp
200-
committer_name string
201-
committer_email string
202-
committer_when timestamp
203-
commit_message string
204-
tree_hash string FK >- tree_entries.tree_hash
205-
commit_parents array[string]
206-
207-
blobs as b
208-
-
209-
repository_id string FK >- repositories.repository_id
210-
blob_hash string
211-
blob_size number
212-
blob_content blob
213-
214-
tree_entries as te
215-
-
216-
repository_id string FK >- repositories.repository_id
217-
tree_hash string
218-
blob_hash string FK >- blobs.blob_hash
219-
tree_entry_mode number
220-
tree_entry_name string
221-
222-
files as f
223-
-
224-
repository_id string FK >- repositories.repository_id
225-
blob_hash string FK >- blobs.blob_hash
226-
file_path string
227-
tree_hash string FK >- tree_entries.tree_hash
228-
tree_entry_mode number
229-
blob_content blob
230-
blob_size number
231-
232-
ref_commits
233-
-
234-
repository_id string FK >- repositories.repository_id
235-
commit_hash string FK >- commits.commit_hash
236-
ref_name string FK >- refs.ref_name
237-
index number
238-
239-
commit_trees
240-
-
241-
repository_id string FK >- repositories.repository_id
242-
commit_hash string FK >- commits.commit_hash
243-
tree_hash string FK >- tree_entries.tree_hash
244-
245-
commit_blobs
246-
-
247-
repository_id string FK >- repositories.repository_id
248-
commit_hash string FK >- commits.commit_hash
249-
blob_hash string FK >- blobs.blob_hash
189+
Diagram generated with MySQL Workbench. Edit the model in docs/assets/gitbase_model.mwb to generate a new diagram in case it needs some changes.
250190
251191
-->
252192

253-
![gitbase schema](/docs/assets/gitbase-db-diagram.png)
193+
![gitbase schema](/docs/assets/gitbase-db-diagram.png)

0 commit comments

Comments
 (0)