<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_2.dtd">
<!-- Autogenerated by JDBCToXMLSchema! -->
<database name="workstyle" defaultIdMethod="idbroker">

    <table name="TAG_TYPE">
        <column name="TAG_TYPE_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="NAME" 		type="VARCHAR" size="20" 	required="true"/>
        <column name="STYLE_CLASS" 	type="VARCHAR" size="10" 	required="true"/>
        <column name="SORT_ORDER" 	type="INTEGER"/>
    </table>
    <table name="STATUS">
        <column name="STATUS_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="NAME" 		type="VARCHAR" size="20" 	required="true"/>
        <column name="SORT_ORDER" 	type="INTEGER" 				required="true" default="0"/>
        <column name="IMAGE" 		type="VARCHAR" size="256" 	required="true"/>
    </table>
    <table name="TASK">
        <column name="TASK_ID" 		type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="CONTENTS" 	type="VARCHAR" size="7000" 	required="true"/>
        <column name="ESTIMATED_MAN_HOUR" type="DOUBLE"							default="0"/>
        <column name="TAG_LIST" type="VARCHAR" size="200"/>
        <column name="UPDATE_DATE" type="TIMESTAMP"/>
        <column name="PRIORITY" type="INTEGER"							default="0"/>
        <column name="CREATE_DATE" type="TIMESTAMP"/>
        <column name="DEAD_END_DATE" type="TIMESTAMP"/>
        <column name="STATUS_ID" type="INTEGER" 				required="true"/>
		<foreign-key foreignTable="STATUS">
			<reference foreign="STATUS_ID" local="STATUS_ID"/>
		</foreign-key>
    </table>
    <table name="TASK_COMMENT">
        <column name="COMMENT_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="CONTENTS" 	type="VARCHAR" size="1000"/>
        <column name="COMMENTATOR" 	type="VARCHAR" size="50"/>
        <column name="UPDATE_DATE" 	type="TIMESTAMP"/>
        <column name="TASK_ID" 		type="INTEGER" 				required="true"/>
		<foreign-key foreignTable="TASK">
			<reference foreign="TASK_ID" local="TASK_ID"/>
		</foreign-key>
    </table>
    <table name="FILE_INFO">
        <column name="FILE_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="NAME" 	type="VARCHAR" size="256" 	required="true"/>
        <column name="PATH" 	type="VARCHAR" size="256"/>
    </table>
    <table name="TASK_FILE_RELATION" idMethod="none">
        <column name="TASK_ID" 	type="INTEGER"				required="true" primaryKey="true"/>
        <column name="FILE_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
		<foreign-key foreignTable="TASK">
			<reference foreign="TASK_ID" local="TASK_ID"/>
		</foreign-key>
		<foreign-key foreignTable="FILE_INFO">
			<reference foreign="FILE_ID" local="FILE_ID"/>
		</foreign-key>
    </table>
    <table name="TASK_RELATION" idMethod="none">
        <column name="SRC_TASK_ID" 	type="INTEGER"				required="true" primaryKey="true"/>
        <column name="DEST_TASK_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
		<foreign-key foreignTable="TASK">
			<reference foreign="TASK_ID" local="SRC_TASK_ID"/>
		</foreign-key>
    </table>
    <table name="ATTACHED_FILE">
        <column name="FILE_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="NAME" 	type="VARCHAR" size="256" 	required="true"/>
        <column name="PATH" 	type="VARCHAR" size="256"/>
        <column name="TASK_ID" 	type="INTEGER"				required="true"/>
		<foreign-key foreignTable="TASK">
			<reference foreign="TASK_ID" local="TASK_ID"/>
		</foreign-key>
    </table>
    <table name="TAG">
        <column name="TAG_ID" 	type="INTEGER" 				required="true" primaryKey="true"/>
        <column name="NAME" 	type="VARCHAR" size="256" 	required="true"/>
        <column name="ACTIVE" 	type="INTEGER"				required="true" default="1"/>
        <column name="TAG_TYPE_ID" type="INTEGER" 			required="true"/>
		<foreign-key foreignTable="TAG_TYPE">
			<reference foreign="TAG_TYPE_ID" local="TAG_TYPE_ID"/>
		</foreign-key>
    </table>
</database>
