<?xml version='1.0' encoding='UTF-8'?>
<tables>
	<!-- scheduler table -->
	<table>
		<name>lu_scheduler</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>lutype</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>lunits</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>frequency</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>last_runat</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>enabled</name>
			<type>boolean</type>
			<options>
				<notnull>false</notnull>
				<default>0</default>
			</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>
		
		<keys>
			<primary>id</primary>
			<unique>name</unique>
			<index>last_runat</index>
			<index>enabled</index>
		</keys>
		<init>
		SQL:<![CDATA[
		name,lutype,frequency,lunits,enabled,query,params||
		Whois,1,90,2,1,NULL,NULL||
		Default Monthly Lookups,758,30,2,1,NULL,NULL||
		Domains Nearing Expiry,1,24,1,1,d.registrar_expiry LE ? OR d.registry_expiry LE ?,"[TODAY+30],[TODAY+30]"||
		SSLs Nearing Expiry,64,24,1,1,s.ssl_valid_to LE ?,"[TODAY+30]"||
		SSL for Newly Added Subdomains,64,30,5,1,s.auto_added=0 AND s.added_on > d.ssl_checked_at AND d.ssl_checked_at IS NOT NULL,NULL||
		Extended DNS for Newly Added Subdomains,512,30,5,1,(s.auto_added=0 OR s.auto_added=3) AND s.added_on > d.subdomains_checked_at AND d.subdomains_checked_at IS NOT NULL,NULL||
		COM or NET domains with Empty Registrar Expiry Date,1,1,2,0,((d.domain LIKE ? OR d.domain LIKE ?) AND (d.registrar_expiry IS NULL AND d.registry_expiry IS NOT NULL)),"%.com,%.net"||
		DNS Lookups For Monitoring,514,12,1,0,NULL,NULL
		]]>
		</init>
	</table>
	
	<!-- Report Scheduler table -->
	<table>
		<name>report_scheduler</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>runits</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>frequency</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>last_runat</name>
			<type>datetime</type>
			<options>
				<notnull>false</notnull>
				<default>NULL</default>
			</options>
		</column>
		<column>
			<name>autorun</name>
			<type>integer</type>
			<options>
				<notnull>true</notnull>
				<default>0</default>
			</options>
		</column>
		<column>
			<name>columns</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>20</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>sortcolumn</name>
			<type>string</type>
			<options>
				<length>255</length>
				<default>empty</default>
			</options>
		</column>
		<column>
			<name>descending</name>
			<type>boolean</type>
			<options>
				<default>0</default>
				<notnull>true</notnull>
			</options>
		</column>
		<column>
			<name>emails</name>
			<type>string</type>
			<options>
				<length>2048</length>
				<default>empty</default>
				<notnull>false</notnull>
			</options>
		</column>
		
		<keys>
			<primary>id</primary>
			<unique>name</unique>
			<index>last_runat</index>
			<index>autorun</index>
			<index>sortindex</index>
		</keys>
		<init>
		SQL:<![CDATA[
		name,sortindex,autorun,columns,sortcolumn,descending,query,params||
		Subdomain Records,1,0,hostname;d.domain;subdomain;s.ip;record_type;record_value;ptr,d.domain,0,s.auto_added GE 1 AND s.auto_added LE 3 AND (record_type is NOT NULL AND record_type NE ?),EMPTY||
		Domain Expiry Report,2,1,domain;d.registry_expiry;d.registrar_expiry;created_on;last_update;d.ip;days_to_expiry;primary_whois_checked_at;secondary_whois_checked_at;status,d.registry_expiry,0,registry_expiry LE ? OR registrar_expiry LE ? OR status LIKE ? OR status LIKE ? OR status LIKE ?,"[TODAY+45],[TODAY+45],%pendingdelete%,%autorenew%,%nameserverdiscrepancy%"||
		SSL Expiry Report,3,1,hostname;s.ip;ssl_valid_from;s.ssl_valid_to;ssl_issued_to;ssl_issued_by;days_to_expiry;ssl_checked_at;subject_alt_name,s.ssl_valid_to,0,s.auto_added=2 AND ssl_valid_to LE ?,[TODAY+45]||
		Valid SSL Report,4,0,hostname;s.ip;ssl_valid_from;s.ssl_valid_to;ssl_issued_to;ssl_issued_by;days_to_expiry;ssl_checked_at;subject_alt_name,s.ssl_valid_to,0,s.auto_added=2 AND ssl_valid_from is NOT NULL,NULL||
		Missing Domain Expiry Dates,5,0,domain;registrar;status;ns1;ns2;ip;primary_whois_checked_at,d.domain,0,registry_expiry is NULL OR registry_expiry=?,EMPTY||
		Valid Hostnames,1,0,hostname;d.domain;subdomain,d.domain,0,s.auto_added EQ 0,NULL||
		Valid Cookies,1000,0,hostname;s.cookie_name;s.cookie_value;s.cookie_domain;subdomain;s.cookie_thirdparty;s.cookie_type;s.cookie_expiry;s.added_on;d.domain,d.domain,0,s.auto_added EQ 7,NULL||
		Non LE SSL Records,1001,0,s.hostname;d.domain;s.ssl_issued_by;s.ssl_issued_to;s.ssl_valid_from;s.ssl_valid_to;s.ip,s.ssl_valid_to,0,s.auto_added=2 AND ssl_valid_from is NOT NULL AND ssl_issued_by != ?,R3
		]]>
		</init>
	</table>
</tables>
