{"id":1703,"date":"2012-08-02T18:41:24","date_gmt":"2012-08-02T18:41:24","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=1703"},"modified":"2015-09-16T06:52:27","modified_gmt":"2015-09-16T06:52:27","slug":"socrates-the-only-online-mysql-schema-diagram-generator","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2012\/08\/02\/socrates-the-only-online-mysql-schema-diagram-generator\/","title":{"rendered":"Socrates &#8211; web based MySQL schema diagram generator (now version 1.0)"},"content":{"rendered":"<h3>WHAT IS SOCRATES<\/h3>\n<p><a href=\"https:\/\/truelogic.org\/wordpress\/2012\/08\/02\/socrates-the-only-online-mysql-schema-diagram-generator\/socrates\/\" rel=\"attachment wp-att-1713\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1713\" title=\"socrates\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/socrates.jpeg\" alt=\"\" width=\"172\" height=\"230\" \/><\/a>Socrates is a web based application which generates a database schema diagram. It is written in PHP and uses JQuery in the front end.<\/p>\n<p>All it requires as an input is your Mysql dump sql script. Just paste the sql and it generates a schema diagram. Simple and fast. Please note that this is a work in progress and I am in the process of adding in more features.<\/p>\n<h3>WHY SOCRATES WAS MADE<\/h3>\n<p>As part of our documentation of projects, we are often needed to create database schema diagrams of our existing MySQL databases. Now the only way to do that is :<\/p>\n<ul>\n<li>Use a commercial application\/tool which automatically creates a schema diagram<\/li>\n<li>Create a schema diagram by hand by entering everything manually<\/li>\n<\/ul>\n<p>I did a lot of searching over the web to look for a free online tool which could immediately show me a schema diagram of my MySQL database, but there is nothing like that available. As a result I decided I would make an online application for this purpose.<\/p>\n<h3>FEATURES IN VERSION 1.0 (Feb 19th, 2015)<\/h3>\n<ol>\n<li>Ability to handle &#8220;CREATE IF NOT&#8221; table clause<\/li>\n<li>Display foreign keys<\/li>\n<li>Show relations between tables<\/li>\n<\/ol>\n<p>1.0 Screenshot:<\/p>\n<p><a href=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-2117 aligncenter\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59-620x453.png\" alt=\"2015-02-19 15-24-59\" width=\"620\" height=\"453\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59-620x453.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59-300x219.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59-940x687.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59-900x657.png 900w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2015-02-19-15-24-59.png 1154w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>FEATURES IN VERSION 0.5 (Aug 2nd, 2012)<\/h3>\n<ol>\n<li>Takes in a maximum of 750k characters for the sql dump input.<\/li>\n<li>Parses the sql file to generate information about tables,fields and primary keys<\/li>\n<li>Ability to extract table name, field info, default values and primary key info.<\/li>\n<li>Shows the parsed information as a diagram.<\/li>\n<li>The boxes in the diagram are draggable so that you can achieve your desired layout<\/li>\n<\/ol>\n<p>A sample screenshot of a Joomla CMS database schema is shown below:<\/p>\n<p><a href=\"https:\/\/truelogic.org\/wordpress\/2012\/08\/02\/socrates-the-only-online-mysql-schema-diagram-generator\/2012-08-02-23-49-47\/\" rel=\"attachment wp-att-1705\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1705\" title=\"2012-08-02 23-49-47\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2012-08-02-23-49-47.png\" alt=\"\" width=\"1106\" height=\"844\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2012-08-02-23-49-47.png 1106w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2012-08-02-23-49-47-300x228.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2012\/08\/2012-08-02-23-49-47-1024x781.png 1024w\" sizes=\"auto, (max-width: 1106px) 100vw, 1106px\" \/><\/a><\/p>\n<h3>EXPLANATION OF THE SCHEMA DIAGRAM<\/h3>\n<p>Each table is shown as a block. Within each table it shows<\/p>\n<ul>\n<li>The table name<\/li>\n<li>The field list. For each field it shows the name, field type and default value if any<\/li>\n<li>If a field is part of a primary key it is marked as (P)<\/li>\n<li>If a field is allowed to have a null value is marked with an N<\/li>\n<li>If a field is defined as a foreign key from another table , it is marked with (F)<\/li>\n<\/ul>\n<h3>SAVE THE DIAGRAM AS A SCREENSHOT<\/h3>\n<p>Since its not possible for any server-side language to save a web page as an image, without using external server hosted applications, I would recommend that you install any of the several free browser-addons which lets you save the current page in the browser as an image. Any of these add-ons would save the entire diagram as an image.<\/p>\n<h3>WHAT NEXT<\/h3>\n<p>As mentioned before, this is a work in progress, so I will be continually adding more features. I am particularly aiming to automatically show foreign key linkages using connectors between the blocks as thats something which is very useful.<\/p>\n<p>I would be very interested in your feedback and comments on any bugs or ideas that you want to convey.<\/p>\n<h2 style=\"text-align: center;\"><a href=\"http:\/\/truelogic.org\/mysqlparser\/test.php\" target=\"_blank\">Click Here To Use Socrates<\/a><\/h2>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>WHAT IS SOCRATES Socrates is a web based application which generates a database schema diagram. It is written in PHP and uses JQuery in the <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2012\/08\/02\/socrates-the-only-online-mysql-schema-diagram-generator\/\" title=\"Socrates &#8211; web based MySQL schema diagram generator (now version 1.0)\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":1713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[278],"tags":[],"class_list":["post-1703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql-2"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=1703"}],"version-history":[{"count":18,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1703\/revisions"}],"predecessor-version":[{"id":2122,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1703\/revisions\/2122"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/1713"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=1703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=1703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=1703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}