Skip to content

Instantly share code, notes, and snippets.

@shutdown57
Last active February 26, 2018 19:28
Show Gist options
  • Save shutdown57/93fee72a0a11baed9a8251e1bfe75604 to your computer and use it in GitHub Desktop.
Save shutdown57/93fee72a0a11baed9a8251e1bfe75604 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
<!-- Active URL: http://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" quote=""/>
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>
<type label="BIGINT" length="0" sql="BIGINT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
</group>
<group label="Character" color="rgb(255,200,200)">
<type label="Char" length="1" sql="CHAR" quote="'"/>
<type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
<type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
<type label="Binary" length="1" sql="BINARY" quote="'"/>
<type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
<type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
</group>
<group label="Date &amp; Time" color="rgb(200,255,200)">
<type label="Date" length="0" sql="DATE" quote="'"/>
<type label="Time" length="0" sql="TIME" quote="'"/>
<type label="Datetime" length="0" sql="DATETIME" quote="'"/>
<type label="Year" length="0" sql="YEAR" quote=""/>
<type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
</group>
<group label="Miscellaneous" color="rgb(200,200,255)">
<type label="ENUM" length="1" sql="ENUM" quote=""/>
<type label="SET" length="1" sql="SET" quote=""/>
<type label="Bit" length="0" sql="bit" quote=""/>
</group>
</datatypes><table x="435" y="142" name="User">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="email" null="0" autoincrement="0">
<datatype>VARCHAR(32)</datatype>
</row>
<row name="password_hash" null="0" autoincrement="0">
<datatype>VARCHAR(256)</datatype>
</row>
<row name="token" null="1" autoincrement="0">
<datatype>VARCHAR(64)</datatype>
<default>NULL</default></row>
<row name="active" null="1" autoincrement="0">
<datatype>INTEGER(1)</datatype>
<default>1</default></row>
<row name="role_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="Role" row="id" />
</row>
<row name="info_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="Info" row="id" />
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>User table</comment>
</table>
<table x="215" y="141" name="Role">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="name" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>'uesr'</default></row>
<row name="permission" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>0x02</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>role for user permission</comment>
</table>
<table x="202" y="287" name="Info">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="created_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="updated_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="last_seen_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="first_name" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<row name="last_name" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<row name="birthday" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="bio" null="1" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
<default>NULL</default></row>
<row name="country" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<row name="city" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<row name="phone_number" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<row name="job" null="1" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>User information table</comment>
</table>
<table x="652" y="31" name="Link">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="link_tag" row="link_id" />
</row>
<row name="url" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="description" null="0" autoincrement="0">
<datatype>MEDIUMTEXT</datatype>
</row>
<row name="active" null="0" autoincrement="0">
<datatype>INTEGER(1)</datatype>
<default>1</default></row>
<row name="user_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="User" row="id" />
</row>
<row name="created_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="updated_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Link table</comment>
</table>
<table x="789" y="30" name="link_tag">
<row name="link_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="tag_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="TagLink" row="id" />
</row>
<key type="PRIMARY" name="">
<part>link_id</part>
</key>
<comment>Associate table between link and tag</comment>
</table>
<table x="943" y="54" name="TagLink">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="created_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="updated_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="name" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
<comment>Tag table</comment>
</table>
<table x="885" y="418" name="Videos">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="name" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
<default>'NULL'</default></row>
<row name="tag_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="user_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="url" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
</row>
<row name="status" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="description" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
</row>
<row name="created_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="updated_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
</table>
<table x="1083" y="419" name="video_tag">
<row name="video_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="Videos" row="id" />
</row>
<row name="tag_video_id" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
<relation table="TagVideo" row="id" />
</row>
<key type="PRIMARY" name="">
</key>
</table>
<table x="652" y="300" name="My_video">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="user_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="User" row="id" />
</row>
<row name="fav" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="bought" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="uploaded" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="video_id" null="1" autoincrement="0">
<datatype>INTEGER</datatype>
<default>NULL</default><relation table="Videos" row="id" />
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
</table>
<table x="1287" y="443" name="TagVideo">
<row name="id" null="1" autoincrement="1">
<datatype>INTEGER</datatype>
<default>NULL</default></row>
<row name="created_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="updated_at" null="0" autoincrement="0">
<datatype>INTEGER</datatype>
</row>
<row name="name" null="0" autoincrement="0">
<datatype>VARCHAR</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
</table>
</sql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment