Guest User

Personal library project ER-diagram

a guest
Mar 12th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
DOT 1.52 KB | None | 0 0
  1. digraph ERDiagram {
  2.     // This is the ER-diagram for a personal library management app project. It'll end up on github one day!
  3.  
  4.     rankdir=BT;
  5.  
  6.     // The different entities in our data set.
  7.     books [shape=box, color=blue];
  8.     user [shape=box, color=red];
  9.     acquaintance [shape=box, color=red];
  10.  
  11.     // The different attributes in our data set.
  12.     metadata [shape=oval, color=blue];
  13.     "config data" [shape=oval, color=red];
  14.  
  15.     // The different relationships we have;
  16.     owns [shape=diamond, color=blue];
  17.     wants [shape=diamond, color=blue];
  18.     lends [shape=diamond, color=red];
  19.     borrows [shape=diamond, color=red];
  20.     "exchanges\nwith" [shape=diamond, color=red];
  21.    
  22.     // The main component in our case is, ofc, books. So here they are!
  23.         metadata -> books;
  24.  
  25.         // Things can happen to books.
  26.         owns -> books ;
  27.         wants -> books;
  28.         lends -> books;
  29.         borrows -> books;
  30.  
  31.     // We also have user of our app. He's the chief librarian in a sense.
  32.         // He has a password, a username, etc...
  33.         "config data" -> user;
  34.         // He interacts with his books...
  35.         user -> owns; // Our user owns books.
  36.         user -> wants; // Or sometimes wants them in a wishlist.
  37.  
  38.         // ...and with other people.
  39.         user -> "exchanges\nwith"; // He also knows other people that read books.
  40.         user -> lends;
  41.    
  42.     // And so we have the aforementioned other people.
  43.         // They also interact with books, but we don't care about their books, only ours.
  44.         acquaintance -> borrows;
  45.  
  46.         // But they mostly interact with user.
  47.         acquaintance -> "exchanges\nwith";
  48.  
  49.     {rank=max; metadata}
  50. }
Add Comment
Please, Sign In to add comment