Skip to content

Instantly share code, notes, and snippets.

@afomi
Last active September 10, 2015 23:41
Show Gist options
  • Save afomi/62925e8c7fe01fca4aa7 to your computer and use it in GitHub Desktop.
Save afomi/62925e8c7fe01fca4aa7 to your computer and use it in GitHub Desktop.
Tahi Data Model
<script type="text/vnd.graphviz" id="graphviz">
digraph G {
graph[overlap=false, splines=true, bgcolor="none"]
"Activity" [shape=Mrecord, label="{Activity|id :integer\lfeed_name :string\lsubject_id :integer\lsubject_type :string\lactivity_key :string\lmessage :string\luser_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Affiliation" [shape=Mrecord, label="{Affiliation|id :integer\luser_id :integer\lname :string\lstart_date :date\lend_date :date\lcreated_at :datetime\lupdated_at :datetime\lemail :string\ldepartment :string\ltitle :string\lcountry :string\lringgold_id :string\l}"]
"ApiKey" [shape=Mrecord, label="{ApiKey|id :integer\laccess_token :string\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Attachment" [shape=Mrecord, label="{Attachment|id :integer\lfile :string\ltask_id :integer\lcreated_at :datetime\lupdated_at :datetime\ltitle :string\lcaption :string\lstatus :string\lkind :string\l}"]
"Author" [shape=Mrecord, label="{Author|id :integer\lfirst_name :string\llast_name :string\lcreated_at :datetime\lupdated_at :datetime\lposition :integer\lpaper_id :integer\lactable_id :integer\lactable_type :string\l}"]
"Bibitem" [shape=Mrecord, label="{Bibitem|id :integer\lpaper_id :integer\lformat :string\lcontent :text\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Comment" [shape=Mrecord, label="{Comment|id :integer\lbody :text\lcreated_at :datetime\lupdated_at :datetime\lcommenter_id :integer\ltask_id :integer\lentities :json\l}"]
"CommentLook" [shape=Mrecord, label="{CommentLook|id :integer\luser_id :integer\lcomment_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Credential" [shape=Mrecord, label="{Credential|id :integer\lprovider :string\luid :string\luser_id :integer\l}"]
"Decision" [shape=Mrecord, label="{Decision|id :integer\lpaper_id :integer\lrevision_number :integer\lletter :text\lverdict :string\lcreated_at :datetime\lupdated_at :datetime\lauthor_response :text\l}"]
"DiscussionParticipant" [shape=Mrecord, label="{DiscussionParticipant|id :integer\ldiscussion_topic_id :integer\luser_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"DiscussionReply" [shape=Mrecord, label="{DiscussionReply|id :integer\lbody :text\ldiscussion_topic_id :integer\lreplier_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"DiscussionTopic" [shape=Mrecord, label="{DiscussionTopic|id :integer\ltitle :string\lpaper_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Figure" [shape=Mrecord, label="{Figure|id :integer\lattachment :string\lpaper_id :integer\lcreated_at :datetime\lupdated_at :datetime\ltitle :string\lcaption :text\lstatus :string\l}"]
"Flow" [shape=Mrecord, label="{Flow|id :integer\ltitle :string\lrole_id :integer\lposition :integer\lquery :text\l}"]
"Invitation" [shape=Mrecord, label="{Invitation|id :integer\lemail :string\lcode :string\ltask_id :integer\linvitee_id :integer\lactor_id :integer\lstate :string\lcreated_at :datetime\lupdated_at :datetime\ldecision_id :integer\linformation :string\lbody :text\l}"]
"Journal" [shape=Mrecord, label="{Journal|id :integer\lname :string\lcreated_at :datetime\lupdated_at :datetime\llogo :string\lepub_cover :string\lepub_css :text\lpdf_css :text\lmanuscript_css :text\ldescription :text\ldoi_publisher_prefix :string\ldoi_journal_prefix :string\llast_doi_issued :string\l}"]
"JournalTaskType" [shape=Mrecord, label="{JournalTaskType|id :integer\ljournal_id :integer\ltitle :string\lrole :string\lkind :string\l}"]
"Manuscript" [shape=Mrecord, label="{Manuscript|id :integer\lsource :string\lpaper_id :integer\lcreated_at :datetime\lupdated_at :datetime\lstatus :string\l}"]
"ManuscriptManagerTemplate" [shape=Mrecord, label="{ManuscriptManagerTemplate|id :integer\lpaper_type :string\ljournal_id :integer\l}"]
"Paper" [shape=Mrecord, label="{Paper|id :integer\lshort_title :string\ltitle :string\labstract :text\lcreated_at :datetime\lupdated_at :datetime\luser_id :integer\lpaper_type :string\ljournal_id :integer\ldecision_letter :text\lpublished_at :datetime\llocked_by_id :integer\lstriking_image_id :integer\llast_heartbeat_at :datetime\leditable :boolean\ldoi :text\leditor_mode :string\lpublishing_state :string\lsubmitted_at :datetime\lsalesforce_manuscript_id :string\lwithdrawal_reasons :text\l}"]
"PaperRole" [shape=Mrecord, label="{PaperRole|id :integer\luser_id :integer\lpaper_id :integer\lcreated_at :datetime\lupdated_at :datetime\lrole :string\l}"]
"Participation" [shape=Mrecord, label="{Participation|id :integer\ltask_id :integer\luser_id :integer\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Phase" [shape=Mrecord, label="{Phase|id :integer\lname :string\lcreated_at :datetime\lupdated_at :datetime\lposition :integer\lpaper_id :integer\l}"]
"PhaseTemplate" [shape=Mrecord, label="{PhaseTemplate|id :integer\lname :string\lmanuscript_manager_template_id :integer\lcreated_at :datetime\lupdated_at :datetime\lposition :integer\l}"]
"Question" [shape=Mrecord, label="{Question|id :integer\lquestion :text\lanswer :text\lident :string\ltask_id :integer\ladditional_data :json\lcreated_at :datetime\lupdated_at :datetime\ldecision_id :integer\l}"]
"QuestionAttachment" [shape=Mrecord, label="{QuestionAttachment|id :integer\lquestion_id :integer\lattachment :string\ltitle :string\lstatus :string\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Role" [shape=Mrecord, label="{Role|id :integer\lname :string\ljournal_id :integer\lcreated_at :datetime\lupdated_at :datetime\lcan_administer_journal :boolean\lcan_view_assigned_manuscript_managers :boolean\lcan_view_all_manuscript_managers :boolean\lkind :string\lcan_view_flow_manager :boolean\l}"]
"SupportingInformationFile" [shape=Mrecord, label="{SupportingInformationFile|id :integer\lpaper_id :integer\ltitle :string\lcaption :string\lattachment :string\lcreated_at :datetime\lupdated_at :datetime\lstatus :string\lpublishable :boolean\l}"]
"Table" [shape=Mrecord, label="{Table|id :integer\lpaper_id :integer\ltitle :string\lcaption :string\lbody :text\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Task" [shape=Mrecord, label="{Task|id :integer\ltitle :string\ltype :string\lphase_id :integer\lcompleted :boolean\lcreated_at :datetime\lupdated_at :datetime\lrole :string\lbody :json\lposition :integer\l}"]
"TaskTemplate" [shape=Mrecord, label="{TaskTemplate|id :integer\ljournal_task_type_id :integer\lphase_template_id :integer\ltemplate :json\ltitle :string\lposition :integer\l}"]
"User" [shape=Mrecord, label="{User|id :integer\lfirst_name :string\llast_name :string\lemail :string\lencrypted_password :string\lreset_password_token :string\lreset_password_sent_at :datetime\lremember_created_at :datetime\lsign_in_count :integer\lcurrent_sign_in_at :datetime\llast_sign_in_at :datetime\lcurrent_sign_in_ip :string\llast_sign_in_ip :string\lcreated_at :datetime\lupdated_at :datetime\lusername :string\lavatar :string\lsite_admin :boolean\l}"]
"UserFlow" [shape=Mrecord, label="{UserFlow|id :integer\lcreated_at :datetime\lupdated_at :datetime\luser_id :integer\lflow_id :integer\l}"]
"UserRole" [shape=Mrecord, label="{UserRole|id :integer\luser_id :integer\lcreated_at :datetime\lupdated_at :datetime\lrole_id :integer\l}"]
"VersionedText" [shape=Mrecord, label="{VersionedText|id :integer\lsubmitting_user_id :integer\lpaper_id :integer\lmajor_version :integer\lminor_version :integer\ltext :text\lcreated_at :datetime\lupdated_at :datetime\l}"]
"Attachment" -> "Paper" [arrowtail=odot, arrowhead=dot, dir=both color="#E2487E"]
"Comment" -> "CommentLook" [arrowtail=odot, arrowhead=crow, dir=both color="#0731FC"]
"Comment" -> "User" [label="participants", arrowtail=crow, arrowhead=crow, dir=both color="#4D42BE"]
"CommentLook" -> "Task" [arrowtail=odot, arrowhead=dot, dir=both color="#4A2972"]
"CommentLook" -> "Phase" [arrowtail=odot, arrowhead=dot, dir=both color="#780C38"]
"CommentLook" -> "Paper" [arrowtail=odot, arrowhead=dot, dir=both color="#97B4DD"]
"Decision" -> "Invitation" [arrowtail=odot, arrowhead=crow, dir=both color="#8355EA"]
"Decision" -> "Question" [arrowtail=odot, arrowhead=crow, dir=both color="#C5E934"]
"DiscussionTopic" -> "DiscussionParticipant" [arrowtail=odot, arrowhead=crow, dir=both color="#52A872"]
"DiscussionTopic" -> "User" [label="participants", arrowtail=crow, arrowhead=crow, dir=both color="#7121EB"]
"DiscussionTopic" -> "DiscussionReply" [arrowtail=odot, arrowhead=crow, dir=both color="#50494D"]
"Flow" -> "Journal" [arrowtail=odot, arrowhead=dot, dir=both color="#511AAD"]
"Flow" -> "UserFlow" [arrowtail=odot, arrowhead=crow, dir=both color="#11B6B7"]
"Flow" -> "User" [arrowtail=crow, arrowhead=crow, dir=both color="#94F00F"]
"Invitation" -> "Paper" [arrowtail=odot, arrowhead=dot, dir=both color="#BED73E"]
"Journal" -> "Paper" [arrowtail=odot, arrowhead=crow, dir=both color="#FD3CF4"]
"Journal" -> "Role" [arrowtail=odot, arrowhead=crow, dir=both color="#FDCB81"]
"Journal" -> "UserRole" [arrowtail=crow, arrowhead=crow, dir=both color="#7B03FC"]
"Journal" -> "User" [arrowtail=crow, arrowhead=crow, dir=both color="#931CB4"]
"Journal" -> "ManuscriptManagerTemplate" [arrowtail=odot, arrowhead=crow, dir=both color="#7F042A"]
"Journal" -> "JournalTaskType" [arrowtail=odot, arrowhead=crow, dir=both color="#3043CE"]
"ManuscriptManagerTemplate" -> "PhaseTemplate" [arrowtail=odot, arrowhead=crow, dir=both color="#933978"]
"Paper" -> "Manuscript" [arrowtail=odot, arrowhead=dot, dir=both color="#DECA2B"]
"Paper" -> "Figure" [arrowtail=odot, arrowhead=crow, dir=both color="#DF5648"]
"Paper" -> "VersionedText" [arrowtail=odot, arrowhead=crow, dir=both color="#0D34AD"]
"Paper" -> "Table" [arrowtail=odot, arrowhead=crow, dir=both color="#11854D"]
"Paper" -> "Bibitem" [arrowtail=odot, arrowhead=crow, dir=both color="#59B693"]
"Paper" -> "SupportingInformationFile" [arrowtail=odot, arrowhead=crow, dir=both color="#728253"]
"Paper" -> "PaperRole" [arrowtail=odot, arrowhead=crow, dir=both color="#A9E59E"]
"Paper" -> "User" [label="assigned_users", arrowtail=crow, arrowhead=crow, dir=both color="#331113"]
"Paper" -> "Phase" [arrowtail=odot, arrowhead=crow, dir=both color="#3F161C"]
"Paper" -> "Task" [arrowtail=crow, arrowhead=crow, dir=both color="#E0ADC3"]
"Paper" -> "Comment" [arrowtail=crow, arrowhead=crow, dir=both color="#150722"]
"Paper" -> "CommentLook" [arrowtail=crow, arrowhead=crow, dir=both color="#279203"]
"Paper" -> "User" [label="participants", arrowtail=crow, arrowhead=crow, dir=both color="#1A2F02"]
"Paper" -> "JournalRole" [arrowtail=crow, arrowhead=crow, dir=both color="#88A686"]
"Paper" -> "Author" [arrowtail=odot, arrowhead=crow, dir=both color="#423D65"]
"Paper" -> "Activity" [arrowtail=odot, arrowhead=crow, dir=both color="#2BC2C4"]
"Paper" -> "Decision" [arrowtail=odot, arrowhead=crow, dir=both color="#0F4A3B"]
"Paper" -> "DiscussionTopic" [arrowtail=odot, arrowhead=crow, dir=both color="#534536"]
"Participation" -> "Paper" [arrowtail=odot, arrowhead=dot, dir=both color="#271818"]
"Phase" -> "Task" [arrowtail=odot, arrowhead=crow, dir=both color="#E4743E"]
"Phase" -> "Journal" [arrowtail=odot, arrowhead=dot, dir=both color="#CE15E6"]
"PhaseTemplate" -> "TaskTemplate" [arrowtail=odot, arrowhead=crow, dir=both color="#F46B64"]
"PhaseTemplate" -> "Journal" [arrowtail=odot, arrowhead=dot, dir=both color="#FB9DE0"]
"Question" -> "QuestionAttachment" [arrowtail=odot, arrowhead=dot, dir=both color="#4CDE27"]
"Role" -> "UserRole" [arrowtail=odot, arrowhead=crow, dir=both color="#F7EB10"]
"Role" -> "User" [arrowtail=crow, arrowhead=crow, dir=both color="#DD38E7"]
"Role" -> "Flow" [arrowtail=odot, arrowhead=crow, dir=both color="#C52D2E"]
"Task" -> "Comment" [arrowtail=odot, arrowhead=crow, dir=both color="#5AF397"]
"Task" -> "Paper" [arrowtail=odot, arrowhead=dot, dir=both color="#BE1CCC"]
"Task" -> "Journal" [arrowtail=odot, arrowhead=dot, dir=both color="#5CE572"]
"Task" -> "Attachment" [arrowtail=odot, arrowhead=crow, dir=both color="#2161BE"]
"Task" -> "Question" [arrowtail=odot, arrowhead=crow, dir=both color="#F14F12"]
"Task" -> "Participation" [arrowtail=odot, arrowhead=crow, dir=both color="#F48662"]
"Task" -> "User" [label="participants", arrowtail=crow, arrowhead=crow, dir=both color="#30C146"]
"TaskTemplate" -> "ManuscriptManagerTemplate" [arrowtail=odot, arrowhead=dot, dir=both color="#2272E7"]
"TaskTemplate" -> "Journal" [arrowtail=odot, arrowhead=dot, dir=both color="#CBFA41"]
"User" -> "Affiliation" [arrowtail=odot, arrowhead=crow, dir=both color="#92B40E"]
"User" -> "Paper" [label="submitted_papers", arrowtail=odot, arrowhead=crow, dir=both color="#4B4C06"]
"User" -> "PaperRole" [arrowtail=odot, arrowhead=crow, dir=both color="#6A66D6"]
"User" -> "UserRole" [arrowtail=odot, arrowhead=crow, dir=both color="#895B1F"]
"User" -> "UserFlow" [arrowtail=odot, arrowhead=crow, dir=both color="#92948F"]
"User" -> "Comment" [arrowtail=odot, arrowhead=crow, dir=both color="#52C102"]
"User" -> "Participation" [arrowtail=odot, arrowhead=crow, dir=both color="#7D1119"]
"User" -> "Task" [arrowtail=crow, arrowhead=crow, dir=both color="#4C964B"]
"User" -> "CommentLook" [arrowtail=odot, arrowhead=crow, dir=both color="#904A2B"]
"User" -> "Credential" [arrowtail=odot, arrowhead=crow, dir=both color="#009233"]
"User" -> "Paper" [label="assigned_papers", arrowtail=crow, arrowhead=crow, dir=both color="#7BABBC"]
"User" -> "Invitation" [arrowtail=odot, arrowhead=crow, dir=both color="#BD4CA6"]
"User" -> "DiscussionReply" [arrowtail=odot, arrowhead=crow, dir=both color="#B1A097"]
"User" -> "DiscussionParticipant" [arrowtail=odot, arrowhead=crow, dir=both color="#6E89DB"]
"User" -> "DiscussionTopic" [arrowtail=crow, arrowhead=crow, dir=both color="#A99107"]
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment