From 36743c9055a8caf23ed8ba1776cc6c5834f5ea02 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 29 Mar 2019 12:33:13 -0400 Subject: [PATCH] Add DB diagram to README --- Makefile | 13 +++- README.md | 5 +- design/db.svg | 123 +++++++++++++++++++++++++++++++ design/media-collection-tree.svg | 61 +++++++++++++++ 4 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 design/db.svg create mode 100644 design/media-collection-tree.svg diff --git a/Makefile b/Makefile index 5eede15..7d3fda8 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ else Q := @ endif +GRAPH_SRC=$(wildcard design/*.gv) +GRAPH_SVG=$(patsubst %.gv,%.svg,$(GRAPH_SRC)) +GRAPH_IMG=$(patsubst %.gv,%.png,$(GRAPH_SRC)) + all: $(DEFAULT) @@ -24,7 +28,7 @@ help: $(Q)echo "make examples - Builds examples" $(Q)echo "make clean - Deletes binaries and documentation. -.PHONY: build run test bench doc examples clean +.PHONY: build run test bench doc examples graphs clean build: $(CARGO) build @@ -39,4 +43,9 @@ doc: $(CARGO) doc test: - $(CARGO) test \ No newline at end of file + $(CARGO) test + +graphs: $(GRAPH_SVG) +design/%.svg: design/%.gv + dot -Tsvg $^ -o $@ + diff --git a/README.md b/README.md index c5c681c..bccbb16 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,7 @@ This is an experiment with using Rust to build a CRUD web app. ## Non-Goals * Single-Page App -* Full interface / Web API separation \ No newline at end of file +* Full interface / Web API separation + +### DB Design +![DB Design](./design/db.svg) \ No newline at end of file diff --git a/design/db.svg b/design/db.svg new file mode 100644 index 0000000..d50f9a6 --- /dev/null +++ b/design/db.svg @@ -0,0 +1,123 @@ + + + + + + +%3 + + + +media + +media + +id + +media_type_id + +display_name + +notes + + + +media_type + +media_type + +id + +type_name + +description + + + +media:media_type_id->media_type:id + + + + + +media_name + +media_name + +id + +media_id + +name + +language + + + +media_name:media_id->media:id + + + + + +media_format + +media_format + +id + +is_physical + +format_name + +description + + + +media_format_link + +media_format_link + +media_type_id + +media_format_id + + + +media_format_link:media_id->media:id + + + + + +media_format_link:media_format_id->media_format:id + + + + + +media_type_format_link + +media_type_format_link + +media_type_id + +media_format_id + + + +media_type_format_link:media_format_id->media_format:id + + + + + +media_type_format_link:media_type_id->media_type:id + + + + + diff --git a/design/media-collection-tree.svg b/design/media-collection-tree.svg new file mode 100644 index 0000000..62164ec --- /dev/null +++ b/design/media-collection-tree.svg @@ -0,0 +1,61 @@ + + + + + + +objectTree + + + +media_type + +media_type + + + +media + +media + + + +media_type->media + + + + + +media_format + +media_format + + + +media_type->media_format + + + + + +media_name + +media_name + + + +media->media_name + + + + + +media_format->media + + + + +