diff --git a/sql/bin/dot_add_content b/sql/bin/dot_add_content
index e0f507b3..fc24e38e 100755
--- a/sql/bin/dot_add_content
+++ b/sql/bin/dot_add_content
@@ -1,12 +1,15 @@
#!/bin/bash
DOT_FILE="$1"
DOT_EXTRA="$2"
if [ -z "$DOT_FILE" -o -z "$DOT_EXTRA" ] ; then
echo "Usage: $0 DOT_FILE DOT_EXTRA"
exit 1
fi
+schema_version=$(grep -i -A 1 '^insert into dbversion' swh-schema.sql | tail -n 1 \
+ | sed -e 's/.*values(//i' -e 's/,.*//')
+
head -n -1 "$DOT_FILE" # all of $DOT_FILE but last line
-cat "$DOT_EXTRA"
+sed "s/@@VERSION@@/$schema_version/" "$DOT_EXTRA"
echo "}"
diff --git a/sql/clusters.dot b/sql/clusters.dot
index 739ddc18..5580f9d0 100644
--- a/sql/clusters.dot
+++ b/sql/clusters.dot
@@ -1,81 +1,81 @@
subgraph "logical_grouping" {
style = rounded;
bgcolor = gray95;
color = gray;
subgraph cluster_meta {
- label = <meta>;
+ label = <meta
version: @@VERSION@@>;
dbversion;
}
subgraph cluster_content {
label = <content>;
content;
skipped_content;
}
subgraph cluster_directory {
label = <directories>;
directory;
directory_entry_dir;
directory_entry_file;
directory_entry_rev;
}
subgraph cluster_revision {
label = <revisions>;
revision;
revision_history;
person;
}
subgraph cluster_release {
label = <releases>;
release;
}
subgraph cluster_occurrences {
label = <occurrences>;
occurrence;
occurrence_history;
}
subgraph cluster_origins {
label = <origins>;
origin;
fetch_history;
}
subgraph cluster_projects {
label = <projects>;
project;
project_history;
}
subgraph cluster_organization {
label = <organizations>;
organization;
list_history;
}
{
edge [style = dashed];
# "rtcolN" identifies the N-th row in a table, as a source
# "ltcolN" identifies the N-th row in a table, as a destination
"directory_entry_dir":rtcol2 -> "directory":ltcol1;
"directory_entry_file":rtcol2 -> "content":ltcol2;
"directory_entry_file":rtcol2 -> "skipped_content":ltcol2;
"directory_entry_rev":rtcol2 -> "revision":ltcol1;
"directory":rtcol2 -> "directory_entry_dir":ltcol1;
"directory":rtcol3 -> "directory_entry_file":ltcol1;
"directory":rtcol4 -> "directory_entry_rev":ltcol1;
"occurrence":rtcol3 -> "revision":ltcol1;
"occurrence_history":rtcol3 -> "revision":ltcol1;
"release":rtcol2 -> "revision":ltcol1;
"revision":rtcol7 -> "directory":ltcol1;
"revision_history":rtcol2 -> "revision":ltcol1;
}
}