diff --git a/doc/schema.dot b/doc/schema.dot
new file mode 100644
index 0000000..2157596
--- /dev/null
+++ b/doc/schema.dot
@@ -0,0 +1,87 @@
+digraph "$schema" {
+ rankdir=RL
+ node [ shape=plaintext ]
+ archived_versions [ label=<
+
+ archived_versions |
+ |
+ | id | INT(11) | | |
+ | volume | INT(11) | | |
+ | version | INT(11) | | |
+ | file | INT(11) | | |
+ | offset | BIGINT(20) | | |
+
>]
+ archived_versions:volume_out -> volumes:id_in
+ archived_versions:version_out -> versions2:id_in
+ archived_versions:file_out -> files:id_in
+ files [ label=<
+
+ files |
+ |
+ | id | INT(11) | | |
+ | path | TEXT(65535) | | |
+ | fileset | INT(11) | | |
+
>]
+ files:fileset_out -> filesets:id_in
+ filesets [ label=<
+
+ filesets |
+ |
+ | id | INT(11) | | |
+ | host | VARCHAR(255) | | |
+ | dir | TEXT(65535) | | |
+ | options | TEXT(65535) | | |
+ | pid | INT(11) | | |
+ | active | TINYINT(4) | | |
+
>]
+ instances [ label=<
+
+ instances |
+ |
+ | id | BIGINT(20) | | |
+ | file | INT(11) | | |
+ | file_id | VARCHAR(255) | | |
+ | date | INT(11) | | |
+ | online | TINYINT(1) | | |
+ | session | INT(11) | | |
+ | version | INT(11) | | |
+
>]
+ instances:file_out -> files:id_in
+ instances:session_out -> sessions:id_in
+ instances:version_out -> versions2:id_in
+ sessions [ label=<
+
+ sessions |
+ |
+ | id | INT(11) | | |
+ | start_date | INT(11) | | |
+ | end_date | INT(11) | | |
+ | prefix | VARCHAR(255) | | |
+
>]
+ versions2 [ label=<
+
+ versions2 |
+ |
+ | id | INT(11) | | |
+ | file_type | CHAR(1) | | |
+ | file_size | BIGINT(20) | | |
+ | file_mtime | INT(11) | | |
+ | file_owner | VARCHAR(255) | | |
+ | file_group | VARCHAR(255) | | |
+ | file_acl | VARCHAR(255) | | |
+ | file_unix_bits | SET(20) | | |
+ | file_rdev | INT(11) | | |
+ | checksum | VARCHAR(255) | | |
+ | file_linktarget | TEXT(65535) | | |
+
>]
+ volumes [ label=<
+
+ volumes |
+ |
+ | id | INT(11) | | |
+ | label | VARCHAR(255) | | |
+ | barcode | VARCHAR(255) | | |
+ | filesize | BIGINT(20) | | |
+ | blocksize | INT(11) | | |
+
>]
+}
diff --git a/doc/schema.png b/doc/schema.png
new file mode 100644
index 0000000..f58a3ee
Binary files /dev/null and b/doc/schema.png differ