<?xml version='1.0' encoding='UTF-8'?>
<tables>
	<!-- users table -->
	<table>
		<name>auth_users</name>
		<column>
			<name>id</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
				<autoincrement>true</autoincrement>
			</options>
		</column>
		<column>
			<name>name</name>
			<type>string</type>
			<options>
				<length>255</length>
			</options>
		</column>
		<column>
			<name>display_name</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>full_name</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>email</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>password</name>
			<type>string</type>
			<options>
				<length>255</length>
			</options>
		</column>
		<column>
			<name>added_on</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>last_sign_in_stamp</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>active</name>
			<type>boolean</type>
			<options>
				<notnull>false</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>rights</name>
			<type>integer</type>
			<options>
				<notnull>false</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>acslevel</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
				<default>0</default>
			</options>
		</column>
		
		<keys>
			<primary>id</primary>
			<unique>name</unique>
		</keys>
	</table>
	
	<!-- user groups -->
	<table>
		<name>auth_groups</name>
		<column>
			<name>id</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
				<autoincrement>true</autoincrement>
			</options>
		</column>
		<column>
			<name>name</name>
			<type>string</type>
			<options>
				<length>255</length>
			</options>
		</column>
		<keys>
			<primary>id</primary>
		</keys>
		<init>
			SQL:<![CDATA[
			name||
			admin||
			standard
			]]>
		</init>
	</table>
	
	<!-- auth log  -->
	<table>
		<name>auth_logs</name>
		<column>
			<name>ip</name>
			<type>string</type>
			<options>
				<length>128</length>
			</options>
		</column>
		<column>
			<name>login_last_failed_at</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>login_last_succeeded_at</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>login_fail_count</name>
			<type>integer</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<keys>
			<primary>ip</primary>
		</keys>
	</table>
	
	<!-- category access log  -->
	<table>
		<name>auth_catconn</name>
		<column>
			<name>id</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
				<autoincrement>true</autoincrement>
			</options>
		</column>
		<column>
			<name>userid</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
			</options>
		</column>
		<column>
			<name>cid</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
			</options>
		</column>
		
		<keys>
			<primary>id</primary>
			<unique>cid|userid</unique>
		</keys>
	</table>
	
	<!-- group access log  -->
	<table>
		<name>auth_groupconn</name>
		<column>
			<name>id</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
				<autoincrement>true</autoincrement>
			</options>
		</column>
		<column>
			<name>userid</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
			</options>
		</column>
		<column>
			<name>gid</name>
			<type>integer</type>
			<options>
				<unsigned>true</unsigned>
			</options>
		</column>
		
		<keys>
			<primary>id</primary>
			<unique>gid|userid</unique>
		</keys>
	</table>
</tables>

