Skip to content

Commit aac53bd

Browse files
authored
Merge branch 'master' into fix/remove-jaeger-env-vars
2 parents bf1934a + e7091ed commit aac53bd

File tree

4 files changed

+25
-80
lines changed

4 files changed

+25
-80
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

+17-77
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)

rev-upgrade.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,18 @@ echo "Project: $PRJ"
5454
echo "Old rev: $REV_OLD"
5555
echo "New rev: $REV_NEW"
5656

57-
if [ $REV_OLD == $REV_NEW ]; then
57+
if [ "$REV_OLD" == "$REV_NEW" ]; then
5858
exit 0
5959
fi
6060

61-
for file in $(git ls-files | xargs egrep -l $REV_OLD); do
61+
for file in $(git ls-files | xargs egrep -l "$REV_OLD"); do
6262
echo "# $file"
63-
sed -i '' "s/$REV_OLD/$REV_NEW/g" $file
63+
if [[ $OSTYPE == darwin* ]]; then
64+
sed -i '' "s/$REV_OLD/$REV_NEW/g" "$file"
65+
else
66+
sed -i'' "s/$REV_OLD/$REV_NEW/g" "$file"
67+
fi
68+
6469
done
6570

6671
err=$?

0 commit comments

Comments
 (0)