graph AmarokTables {
  ranksep = 2.5;
  node [shape=record];
  
  admin [label="{admin | <key> key : textColumnType() | <version> version : INTEGER }"];
  
  devices [label="{devices | <id> id : idType() | <type> type : textColumnType() | <label> label : textColumnType() | <lastmountpoint> lastmountpoint : textColumnType() | <uuid> uuid : textColumnType() | <servername> servername : textColumnType() | <sharename> sharename : textColumnType() | INDEX ON type, uuid, (servername, sharename)}"];
  
  urls [label="{urls | <id> id : idType() | <deviceid> deviceid : INTEGER | <rpath> rpath : exactTextColumnType() | UNIQUE (deviceid, rpath)}"];
  urls:deviceid -- devices:id;
  
  artists [label="{artists | <id> id : idType() | <name> name : textColumnType() NOT NULL | UNIQUE name}"];
  
  albums [label="{albums | <id> id : idType() | <name> name : textColumnType() NOT NULL | <artist> artist : INTEGER | UNIQUE (name, artist) | INDEX ON name, artist}"];
  albums:artist -- artists:id;
  
  genres [label="{genres | <id> id : idType() | <name> name : textColumnType() NOT NULL | UNIQUE name}"];
  
  composers [label="{composers | <id> id : idType() | <name> name : textColumnType() NOT NULL | UNIQUE name}"];
  
  years [label="{years | <id> id : idType() | <name> name : textColumnType() NOT NULL | UNIQUE name}"];
  
  tracks [label="{tracks | <id> id : idType() | <url> url : INTEGER | <artist> artist : INTEGER | <album> album : INTEGER | <genre> genre : INTEGER | <composer> composer : INTEGER | <year> year : INTEGER | <title> title : textColumnType() | <comment> comment : textColumnType() | <track> track : INTEGER | <discnumber> discnumber : INTEGER | <bitrate> bitrate : INTEGER | <length> length : INTEGER | <samplerate> samplerate : INTEGER | <filesize> filesize : INTEGER | <filetype> filetype : INTEGER | <bpm> bpm : FLOAT | <createdate> createdate : INTEGER | <modifydate> modifydate : INTEGER | UNIQUE url}"];
  tracks:url -- urls:id;
  tracks:artist -- artists:id;
  tracks:album -- albums:id;
  tracks:genre -- genres:id;
  tracks:composer -- composers:id;
  tracks:year -- years:id;
  
  statistics [label="{statistics | <id> id : idType() | <url> url : INTEGER | <createdate> createdate : INTEGER | <accessdate> accessdate : INTEGER | <score> score : FLOAT | <rating> rating : INTEGER DEFAULT 0 | <playcount> playcount : INTEGER | INDEX ON url}"];
  statistics:url -- urls:id;
  
  labels [label="{labels | <id> id : INTEGER | <label> label : textColumnType() | UNIQUE label}"];
  
  urls_labels [label="{urls_labels | <url> url : INTEGER | <label> label : INTEGER | INDEX ON url, label}"];
  urls_labels:url -- urls:id;
  urls_labels:label -- labels:id;
}