<?xml version='1.0' encoding='UTF-8'?>
<tables>
	<!-- queries table -->
	<table>
		<name>queries</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>64</length>
			</options>
		</column>
		<column>
			<name>description</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>query</name>
			<type>string</type>
			<options>
				<length>2048</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>params</name>
			<type>string</type>
			<options>
				<length>2048</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>sortindex</name>
			<type>integer</type>
			<options>
				<default>0</default>
				<notnull>false</notnull>
			</options>
		</column>
		<column>
			<name>qicon</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>gear.png</default>
				<notnull>false</notnull>
			</options>
		</column>
		
		<keys>
			<primary>id</primary>
			<unique>name</unique>
			<index>sortindex</index>
		</keys>
		<init>
		SQL:<![CDATA[
		name,description,query,params||
		"All Domains", NULL, "",""||
		"Unknown Domains (No Whois Lookup Yet)", NULL, "(d.primary_whois_checked_at IS NULL)",""||
		"Domains with Empty Status", NULL, "(d.status IS NULL)",""||
		"Different Registrar/Registry Expiry", NULL, "(d.registry_expiry != d.registrar_expiry)",""||
		"Registry Expiry Date Not Set", NULL, "(d.registry_expiry IS NULL)",""||
		"Registrar Expiry Date Not Set", NULL, "(d.registrar_expiry IS NULL)",""||
		"COM or NET domains with Empty Registrar Expiry Date", NULL, "((d.domain LIKE ? OR d.domain LIKE ?) AND (d.registrar_expiry IS NULL AND d.registry_expiry IS NOT NULL))","%.com,%.net"||
		"About to Expire (Registrar) in 30 Days", NULL, "(d.registrar_expiry LT [TODAY+30] AND d.registrar_expiry IS NOT NULL)",""||
		"About To Expire (Registry) in 30 Days", NULL, "(d.registry_expiry LT [TODAY+30] AND  d.registry_expiry IS NOT NULL)",""||
		"Past Registry Expiry Date", NULL, "d.registry_expiry LT [TODAY]",""||
		"Past Registrar Expiry Date", NULL, "d.registrar_expiry LT [TODAY]",""||
		"Added within the last day", NULL, "d.added_on GT [TODAY-1]",""||
		"Added within the last 5 days", NULL, "d.added_on GT [TODAY-5]",""||
		"Added within the last 30 days", NULL, "d.added_on GT [TODAY-30]",""||
		"Domains with a Hyphen", NULL, "d.domain LIKE ?","%-%"||
		"International Domains", NULL, "d.ascii_domain LIKE ?","xn--%"||
		"Domains with an IP", NULL, "(d.ip IS NOT NULL AND d.ip NOT LIKE ?)","%error%"||
		"Domains with No IP", NULL, "(d.ip IS  NULL OR d.ip = ? OR d.ip = ?)","-,error"||
		"Available Domains", NULL, "(d.status LIKE ? OR d.status = ?)","%available%,Not Registered"||
		"Domains with HTTP/1.1 200 Home Page", NULL, "d.home_page_status LIKE ?","HTTP/1.1 200%"||
		"Domains with HTTP/1.1 301 Home Page", NULL, "d.home_page_status LIKE ?","%/1.1 301%"||
		"Domains with HTTP/1.1 302 Home Page", NULL, "d.home_page_status LIKE ?","%/1.1 302%"||
		"Domains with HTTP/1.1 403 Home Page", NULL, "d.home_page_status LIKE ?","%/1.1 403%"||
		"Domains with HTTP/1.1 404 Home Page", NULL, "d.home_page_status LIKE ?","%/1.1 404%"||
		"Domains with HTTP/1.1 500 Home Page", NULL, "d.home_page_status LIKE ?","%/1.1 500%"||
		"Domains not in Any category",NULL,"d.sid NOT IN (SELECT did FROM [CATCONNTABLE])",""
		]]>
		</init>
	</table>
</tables>
