Skip to content
Snippets Groups Projects
DatabaseSchema.xml 209 KiB
Newer Older
Prasad's avatar
Prasad committed
<?xml version="1.0"?>
<schema version="0.2">

	<table name="vtiger_users">
		<field name="id" type="I" >
			<key />
			<autoincrement />
		</field>
		<field name="user_name" type="C" size="255" />
		<field name="user_password" type="C" size="200" />
		<field name="cal_color" type="C" size="25">
			<default value="#E6FAD8" />
		</field>
		<field name="first_name" type="C" size="30" />
		<field name="last_name" type="C" size="30" />
		<field name="reports_to_id" type="C" size="36" />
		<field name="is_admin" type="C" size="3">
			<default value="0" />
		</field>
		<field name="currency_id" type="I" size="19">
			<default value="1" />
			<notnull />
		</field>
		<field name="description" type="X" />
		<field name="date_entered" type="T">
			<notnull />
			<deftimestamp />
		</field>
		<field name="date_modified" type="T">
			<!-- Troublesome with STRICT_TRANS_TABLE mode depends on MySQL 5.5 or 5.6+ -->
			<!--
Prasad's avatar
Prasad committed
			<notnull />
			<deftimestamp />
Prasad's avatar
Prasad committed
		</field>
		<field name="modified_user_id" type="C" size="36" />
		<field name="title" type="C" size="50" />
		<field name="department" type="C" size="50" />
		<field name="phone_home" type="C" size="50" />
		<field name="phone_mobile" type="C" size="50" />
		<field name="phone_work" type="C" size="50" />
		<field name="phone_other" type="C" size="50" />
		<field name="phone_fax" type="C" size="50" />
		<field name="email1" type="C" size="100" />
		<field name="email2" type="C" size="100" />
		<field name="secondaryemail" type="C" size="100" />
		<field name="status" type="C" size="25" />
		<field name="signature" type="C" size="1000" />
		<field name="address_street" type="C" size="150" />
		<field name="address_city" type="C" size="100" />
		<field name="address_state" type="C" size="100" />
		<field name="address_country" type="C" size="25" />
		<field name="address_postalcode" type="C" size="9" />
		<field name="user_preferences" type="X" />
		<field name="tz" type="C" size="30" />
		<field name="holidays" type="C" size="60" />
		<field name="namedays" type="C" size="60" />
		<field name="workdays" type="C" size="30" />
		<field name="weekstart" type="I" size="11" />
		<field name="date_format" type="C" size="200" />
		<field name="hour_format" type="C" size="30">
			<default value="am/pm" />
		</field>
		<field name="start_hour" type="C" size="30">
			<default value="10:00" />
		</field>
		<field name="end_hour" type="C" size="30">
			<default value="23:00" />
		</field>
Prasad's avatar
Prasad committed
		<field name="is_owner" type="C" size="100">
			<default value="0" />
		</field>
Prasad's avatar
Prasad committed
		<field name="activity_view" type="C" size="200">
			<default value="Today" />
		</field>
		<field name="lead_view" type="C" size="200">
			<default value="Today" />
		</field>
		<field name="imagename" type="C" size="250" />
		<field name="deleted" type="I" size="1">
			<notnull />
			<default value="0" />
		</field>
		<field name="confirm_password" type="C" size="300" />

		<field name="internal_mailer" type="C" size="3">
			<notnull />
			<default value="1" />
		</field>
		<field name="reminder_interval" type="C" size="100" />
		<field name="reminder_next_time" type="C" size="100" />
		<field name="crypt_type" type="C" size="20">
			<notnull />
			<default value="MD5" />
		</field>
		<field name="accesskey" type="C" size="36" />
		<field name="theme" type="C" size="100" />
		<field name="language" type="C" size="36" />
		<field name="time_zone" type="C" size="200" />
		<field name="currency_grouping_pattern" type="C" size="100" />
		<field name="currency_decimal_separator" type="C" size="2" />
		<field name="currency_grouping_separator" type="C" size="2" />
		<field name="currency_symbol_placement" type="C" size="20" />
                <field name="userlabel" type="C" size="255" />
		<field name="defaultlandingpage" type="C" size="200" />
Prasad's avatar
Prasad committed
		<index name="user_user_name_idx">
			<col>user_name</col>
		</index>
		<index name="user_user_password_idx">
			<col>user_password</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_crmentity">
		<field name="crmid" type="I" size="19">
			<key />
		</field>
		<field name="smcreatorid" type="I" size="19">
			<notnull/>
			<default value="0" />
		</field>
		<field name="smownerid" type="I" size="19">
			<notnull />
			<default value="0" />
		</field>
		<field name="modifiedby" type="I" size="19">
			<notnull />
			<default value="0" />
		</field>
		<field name="setype" type="C" size="30">
			<notnull />
		</field>
		<field name="description" type="X" />
		<field name="createdtime" type="T">
			<notnull />
		</field>
		<field name="modifiedtime" type="T">
			<notnull />
		</field>
		<field name="viewedtime" type="T" />
		<field name="status" type="C" size="50" />
		<field name="version" type="I" size="19">
			<notnull />
			<default value="0" />
		</field>
		<field name="presence" type="I" size="1">
			<default value="1" />
		</field>

		<field name="deleted" type="I" size="1">
			<notnull />
			<default value="0" />
		</field>
		<field name="smgroupid" type="I" size="19" />
Prasad's avatar
Prasad committed

		<index name="crmentity_smcreatorid_idx">
			<col>smcreatorid</col>
		</index>
		<index name="crmentity_modifiedby_idx">
			<col>modifiedby</col>
		</index>
		<index name="crmentity_deleted_idx">
			<col>deleted</col>
		</index>
		<index name="crm_ownerid_del_setype_idx">
			<col>smownerid</col>
			<col>deleted</col>
			<col>setype</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_sharedcalendar">
		<field name="userid" type="I" size="19">
			<key />
		</field>
		<field name="sharedid" type="I" size="19">
			<key />
		</field>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_tab">
		<field name="tabid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="name" type="C" size="25">
			<notnull />
		</field>
		<field name="presence" type="I" size="19">
			<notnull />
			<default value="1" />
		</field>
		<field name="tabsequence" type="I" size="10" />
		<field name="tablabel" type="C" size="25">
			<notnull />
		</field>
		<field name="modifiedby" type="I" size="19" />
		<field name="modifiedtime" type="I" size="19" />
		<field name="customized" type="I" size="19" />
		<field name="ownedby" type="I" size="19" />
		<field name="isentitytype" type="I">
			<notnull />
			<default value="1" />
		</field>
Prasad's avatar
Prasad committed
		<field name="trial" type="I"  size="1">
Prasad's avatar
Prasad committed
			<notnull />
			<default value="0" />
		</field>
		<field name="version" type="C" size="10" />
		<field name="parent" type="C" size="30"/>
		<field name="source" type="C" size="255">
			<default value="custom" />
		</field>
Prasad's avatar
Prasad committed

		<index name="tab_name_idx">
			<col>name</col>
			<unique />
		</index>
		<index name="tab_modifiedby_idx">
			<col>modifiedby</col>
		</index>
		<index name="tab_tabid_idx">
			<col>tabid</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_blocks">
		<field name="blockid" type="I" size="19">
			<key />
			<notnull />
		</field>
		<field name="tabid" type="I" size="19">
			<notnull />
		</field>
		<field name="blocklabel" type="C" size="100">
			<notnull />
		</field>
		<field name="sequence" type="I" size="10" />
		<field name="show_title" type="I" size="2" />
		<field name="visible" type="I" size="2">
			<notnull />
			<default value="0" />
		</field>
		<field name="create_view" type="I" size="2">
			<notnull />
			<default value="0" />
		</field>
		<field name="edit_view" type="I" size="2">
			<notnull />
			<default value="0" />
		</field>
		<field name="detail_view" type="I" size="2">
			<notnull />
			<default value="0" />
		</field>
		<field name="display_status" type="I" size="1">
			<notnull />
			<default value="1" />
		</field>
		<field name="iscustom" type="I" size="1">
			<notnull />
			<default value="0" />
		</field>
		<index name="block_tabid_idx">
			<col>tabid</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_blocks" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_blocks FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_field">
		<field name="tabid" type="I" size="19">
			<notnull />
		</field>
		<field name="fieldid" type="I" size="19">
			<key />
			<autoincrement />
		</field>
		<field name="columnname" type="C" size="30">
			<notnull />
		</field>
		<field name="tablename" type="C" size="50">
			<notnull />
		</field>
		<field name="generatedtype" type="I" size="19">
			<notnull />
			<default value="0" />
		</field>
		<field name="uitype" type="C" size="30">
			<notnull />
		</field>
		<field name="fieldname" type="C" size="50">
			<notnull />
		</field>
		<field name="fieldlabel" type="C" size="50">
			<notnull />
		</field>
		<field name="readonly" type="I" size="1">
			<notnull />
		</field>
		<field name="presence" type="I" size="19">
			<notnull />
			<default value="1" />
		</field>
		<field name="defaultvalue" type="X">
		</field>
		<field name="maximumlength" type="I" size="19" />
		<field name="sequence" type="I" size="19" />
		<field name="block" type="I" size="19" />
		<field name="displaytype" type="I" size="19" />
		<field name="typeofdata" type="C" size="100" />
		<field name="quickcreate" type="I" size="10">
			<notnull />
			<default value="1" />
		</field>
		<field name="quickcreatesequence" type="I" size="19" />
		<field name="info_type" type="C" size="20" />
		<field name="masseditable" type="I" size="10">
			<notnull />
			<default value="1" />
		</field>

		<index name="field_tabid_idx">
			<col>tabid</col>
		</index>
		<index name="field_fieldname_idx">
			<col>fieldname</col>
		</index>
		<index name="field_block_idx">
			<col>block</col>
		</index>
		<index name="field_displaytype_idx">
			<col>displaytype</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_field" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_field FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_account">
		<field name="accountid" type="I" size="19">
			<key />
			<notnull />
			<default value="0" />
		</field>
		<field name="account_no" type="C" size="100">
			<notnull />
			<unique />
		</field>
		<field name="accountname" type="C" size="100">
			<unique />
			<notnull />
		</field>
		<field name="parentid" type="I" size="19">
			<default value="0" />
		</field>
		<field name="account_type" type="C" size="200" />
		<field name="industry" type="C" size="200" />
		<field name="annualrevenue" type="I" size="19">
			<default value="0" />
		</field>
		<field name="rating" type="C" size="200" />
		<field name="ownership" type="C" size="50" />
		<field name="siccode" type="C" size="50" />
		<field name="tickersymbol" type="C" size="30" />
		<field name="phone" type="C" size="30" />
		<field name="otherphone" type="C" size="30" />
		<field name="email1" type="C" size="100" />
		<field name="email2" type="C" size="100" />
		<field name="website" type="C" size="100" />
		<field name="fax" type="C" size="30" />
		<field name="employees" type="I" size="10">
			<default value="0" />
		</field>
		<field name="emailoptout" type="C" size="3">
			<default value="0" />
		</field>
		<field name="notify_owner" type="C" size="3">
			<default value="0" />
		</field>

		<index name="account_account_type_idx">
			<col>account_type</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_account" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_account FOREIGN KEY (accountid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_accountbillads">
		<field name="accountaddressid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="bill_city" type="C" size="30" />
		<field name="bill_code" type="C" size="30" />
		<field name="bill_country" type="C" size="30" />
		<field name="bill_state" type="C" size="30" />
		<field name="bill_street" type="C" size="250" />
		<field name="bill_pobox" type="C" size="30" />

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_accountbillads" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_accountbillads FOREIGN KEY (accountaddressid) REFERENCES vtiger_account(accountid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_accountshipads">
		<field name="accountaddressid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="ship_city" type="C" size="30" />
		<field name="ship_code" type="C" size="30" />
		<field name="ship_country" type="C" size="30" />
		<field name="ship_state" type="C" size="30" />
		<field name="ship_pobox" type="C" size="30" />
		<field name="ship_street" type="C" size="250" />

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_accountshipads" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_accountshipads FOREIGN KEY (accountaddressid) REFERENCES vtiger_account(accountid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_accountscf">
		<field name="accountid" type="I" size="19">
			<key />
			<default value="0" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_accountscf" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_accountscf FOREIGN KEY (accountid) REFERENCES vtiger_account(accountid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_contactdetails">
		<field name="contactid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="contact_no" type="C" size="100">
			<notnull />
			<unique />
		</field>
		<field name="accountid" type="I" size="19" />
		<field name="salutation" type="C" size="200">
		</field>
		<field name="firstname" type="C" size="40" />
		<field name="lastname" type="C" size="80">
			<notnull />
		</field>
		<field name="email" type="C" size="100" />
		<field name="phone" type="C" size="50" />
		<field name="mobile" type="C" size="50" />
		<field name="title" type="C" size="50" />
		<field name="department" type="C" size="30" />
		<field name="fax" type="C" size="50" />
		<field name="reportsto" type="C" size="30" />
		<field name="training" type="C" size="50" />
		<field name="usertype" type="C" size="50" />
		<field name="contacttype" type="C" size="50" />
		<field name="otheremail" type="C" size="100" />
		<field name="secondaryemail" type="C" size="100" />
		<field name="donotcall" type="C" size="3" />
		<field name="emailoptout" type="C" size="3">
			<default value="0" />
		</field>
		<field name="imagename" type="C" size="150" />
		<field name="reference" type="C" size="3" />
		<field name="notify_owner" type="C" size="3">
			<default value="0"/>
		</field>

		<index name="contactdetails_accountid_idx">
			<col>accountid</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_contactdetails" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_contactdetails FOREIGN KEY (contactid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_contactsubdetails">
		<field name="contactsubscriptionid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="homephone" type="C" size="50" />
		<field name="otherphone" type="C" size="50" />
		<field name="assistant" type="C" size="30" />
		<field name="assistantphone" type="C" size="50" />
		<field name="birthday" type="D" />
		<field name="laststayintouchrequest" type="I" size="30">
			<default value="0" />
		</field>
		<field name="laststayintouchsavedate" type="I" size="19">
			<default value="0" />
		</field>
		<field name="leadsource" type="C" size="200" />

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_contactsubdetails" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_contactsubdetails FOREIGN KEY (contactsubscriptionid) REFERENCES vtiger_contactdetails(contactid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_contactaddress">
		<field name="contactaddressid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="mailingcity" type="C" size="40" />
		<field name="mailingstreet" type="C" size="250" />
		<field name="mailingcountry" type="C" size="40" />
		<field name="othercountry" type="C" size="30" />
		<field name="mailingstate" type="C" size="30" />
		<field name="mailingpobox" type="C" size="30" />
		<field name="othercity" type="C" size="40" />
		<field name="otherstate" type="C" size="50" />
		<field name="mailingzip" type="C" size="30" />
		<field name="otherzip" type="C" size="30" />
		<field name="otherstreet" type="C" size="250" />
		<field name="otherpobox" type="C" size="30" />

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_contactaddress" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_contactaddress FOREIGN KEY (contactaddressid) REFERENCES vtiger_contactdetails(contactid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_contactscf">
		<field name="contactid" type="I" size="19">
			<key />
			<default value="0" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_contactscf" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_contactscf FOREIGN KEY (contactid) REFERENCES vtiger_contactdetails(contactid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_portalinfo">
		<field name="id" type="I" size="11">
			<key />
		</field>
		<field name="user_name" type="C" size="50" />
		<field name="user_password" type="C" size="255" />
Prasad's avatar
Prasad committed
		<field name="type" type="C" size="5" />
		<field name="cryptmode" type="C" size="20" />
Prasad's avatar
Prasad committed
		<field name="last_login_time" type="T" />
		<field name="login_time" type="T" />
		<field name="logout_time" type="T" />
		<field name="isactive" type="I" size="1" />
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_portalinfo" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_portalinfo FOREIGN KEY (id) REFERENCES vtiger_contactdetails(contactid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_customerdetails">
		<field name="customerid" type="I" size="19">
			<key />
		</field>
		<field name="portal" type="C" size="3" />
		<field name="support_start_date" type="D" />
		<field name="support_end_date" type="D" />
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_customerdetails" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_customerdetails FOREIGN KEY (customerid) REFERENCES vtiger_contactdetails(contactid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_leaddetails">
		<field name="leadid" type="I" size="19">
			<key />
		</field>
		<field name="lead_no" type="C" size="100">
			<notnull />
			<unique />
		</field>
		<field name="email" type="C" size="100" />
		<field name="interest" type="C" size="50" />
		<field name="firstname" type="C" size="40" />
		<field name="salutation" type="C" size="200" />
		<field name="lastname" type="C" size="80">
			<notnull />
		</field>
		<field name="company" type="C" size="100">
			<notnull />
		</field>
		<field name="annualrevenue" type="I" size="19">
			<default value="0" />
		</field>
		<field name="industry" type="C" size="200" />
		<field name="campaign" type="C" size="30" />
		<field name="rating" type="C" size="200" />
		<field name="leadstatus" type="C" size="50" />
		<field name="leadsource" type="C" size="200" />
		<field name="converted" type="I" size="1">
			<default value="0" />
		</field>
		<field name="designation" type="C" size="50">
			<default value="SalesMan" />
		</field>
		<field name="licencekeystatus" type="C" size="50" />
		<field name="space" type="C" size="250" />
		<field name="comments" type="X" />
		<field name="priority" type="C" size="50" />
		<field name="demorequest" type="C" size="50" />
		<field name="partnercontact" type="C" size="50" />
		<field name="productversion" type="C" size="20" />
		<field name="product" type="C" size="50" />
		<field name="maildate" type="D" />
		<field name="nextstepdate" type="D" />
		<field name="fundingsituation" type="C" size="50" />
		<field name="purpose" type="C" size="50" />
		<field name="evaluationstatus" type="C" size="50" />
		<field name="transferdate" type="D" />
		<field name="revenuetype" type="C" size="50" />
		<field name="noofemployees" type="I" size="50" />
		<field name="secondaryemail" type="C" size="100" />
		<field name="assignleadchk" type="I" size="1">
			<default value="0" />
		</field>

		<index name="leaddetails_converted_leadstatus_idx">
			<col>converted</col>
			<col>leadstatus</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_leaddetails" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_leaddetails FOREIGN KEY (leadid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_leadsubdetails">
		<field name="leadsubscriptionid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="website" type="C" size="255" />
		<field name="callornot" type="I" size="1">
			<default value="0" />
		</field>
		<field name="readornot" type="I" size="1">
			<default value="0" />
		</field>
		<field name="empct" type="I" size="10">
			<default value="0" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_leadsubdetails" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_leadsubdetails FOREIGN KEY (leadsubscriptionid) REFERENCES vtiger_leaddetails(leadid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_leadaddress">
		<field name="leadaddressid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="city" type="C" size="30" />
		<field name="code" type="C" size="30" />
		<field name="state" type="C" size="30" />
		<field name="pobox" type="C" size="30" />
		<field name="country" type="C" size="30" />
		<field name="phone" type="C" size="50" />
		<field name="mobile" type="C" size="50" />
		<field name="fax" type="C" size="50" />
		<field name="lane" type="C" size="250" />
		<field name="leadaddresstype" type="C" size="30">
			<default value="Billing" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_leadaddress" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_leadaddress FOREIGN KEY (leadaddressid) REFERENCES vtiger_leaddetails(leadid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_leadscf">
		<field name="leadid" type="I" size="19">
			<key />
			<default value="0" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_leadscf" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_leadscf FOREIGN KEY (leadid) REFERENCES vtiger_leaddetails(leadid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_notes">
		<field name="notesid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="note_no" type="C" size="100">
			<notnull />
			<unique />
		</field>
		<field name="title" type="C" size="50">
			<notnull />
		</field>
		<field name="filename" type="C" size="200" />
		<field name="notecontent" type="X" />
		<field name="folderid" type="I" size="19">
			<default value="1" />
			<notnull />
		</field>
		<field name="filetype" type="C" size="50">
			<default value="NULL" />
		</field>
		<field name="filelocationtype" type="C" size="5">
			<default value="NULL" />
		</field>
		<field name="filedownloadcount" type="I" size="19">
			<default value="NULL" />
		</field>
		<field name="filestatus" type="I" size="19">
			<default value="NULL" />
		</field>
		<field name="filesize" type="I" size="19">
			<default value="0" />
			<notnull />
		</field>
		<field name="fileversion" type="C" size="50">
			<default value="NULL" />
		</field>
		<index name="notes_title_idx">
			<col>title</col>
		</index>
		<index name="notes_notesid_idx">
			<col>notesid</col>
		</index>
		<index name="notes_crmid_idx">
			<col>crmid</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_notes" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_notes FOREIGN KEY (notesid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_potential">
		<field name="potentialid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="potential_no" type="C" size="100">
			<notnull />
			<unique />
		</field>
		<field name="related_to" type="I" size="19" />
		<field name="potentialname" type="C" size="120">
			<notnull />
		</field>
		<field name="amount" type="N" size="14.2">
			<default value="0" />
		</field>
		<field name="currency" type="C" size="20" />
		<field name="closingdate" type="D" />
		<field name="typeofrevenue" type="C" size="50" />
		<field name="nextstep" type="C" size="100" />
		<field name="private" type="I" size="1">
			<default value="0" />
		</field>
		<field name="probability" type="N" size="7.3">
			<default value="0" />
		</field>
		<field name="campaignid" type="I" size="19" />
		<field name="sales_stage" type="C" size="200" />
		<field name="potentialtype" type="C" size="200" />
		<field name="leadsource" type="C" size="200" />
		<field name="productid" type="I" size="50" />
		<field name="productversion" type="C" size="50" />
		<field name="quotationref" type="C" size="50" />
		<field name="partnercontact" type="C" size="50" />
		<field name="remarks" type="C" size="50" />
		<field name="runtimefee" type="I" size="19">
			<default value="0" />
		</field>
		<field name="followupdate" type="D" />
		<field name="evaluationstatus" type="C" size="50" />
		<field name="description" type="X" />
		<field name="forecastcategory" type="I" size="19">
			<default value="0" />
		</field>
		<field name="outcomeanalysis" type="I" size="19">
			<default value="0" />
		</field>

		<index name="potential_relatedto_idx">
			<col>related_to</col>
		</index>
		<index name="potentail_sales_stage_idx">
			<col>sales_stage</col>
		</index>
		<index name="potentail_sales_stage_amount_idx">
			<col>amount</col>
			<col>sales_stage</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_potential" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_potential FOREIGN KEY (potentialid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_potstagehistory">
		<field name="historyid" type="I" size="19">
			<key />
			<autoincrement />
		</field>
		<field name="potentialid" type="I" size="19">
			<notnull />
		</field>
		<field name="amount" type="N" />
		<field name="stage" type="C" size="100" />
		<field name="probability" type="N" size="7.3" />
		<field name="expectedrevenue" type="N" />
		<field name="closedate" type="D" />
		<field name="lastmodified" type="T" />

		<index name="potstagehistory_potentialid_idx">
			<col>potentialid</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_potstagehistory" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_potstagehistory FOREIGN KEY (potentialid) REFERENCES vtiger_potential(potentialid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_potentialscf">
		<field name="potentialid" type="I" size="19">
			<key />
			<default value="0" />
		</field>

		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>

	<table name="vtiger_potentialscf" alter="true">
		<constraint>ADD CONSTRAINT fk_1_vtiger_potentialscf FOREIGN KEY (potentialid) REFERENCES vtiger_potential(potentialid) ON DELETE CASCADE</constraint>
		<opt>Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
		<data>
		</data>
	</table>

	<table name="vtiger_activity">
		<field name="activityid" type="I" size="19">
			<key />
			<default value="0" />
		</field>
		<field name="subject" type="C" size="100">
			<notnull />
		</field>
		<field name="semodule" type="C" size="20" />
		<field name="activitytype" type="C" size="200">
			<notnull />
		</field>

		<field name="date_start" type="D">
			<notnull />
		</field>
		<field name="due_date" type="D" />
		<field name="time_start" type="C" size="50" />
		<field name="time_end" type="C" size="50" />
		<field name="sendnotification" type="C" size="3">
			<notnull />
			<default value="0"/>
		</field>
		<field name="duration_hours" type="C" size="200" />
		<field name="duration_minutes" type="C" size="200" />
		<field name="status" type="C" size="200" />
		<field name="eventstatus" type="C" size="200" />
		<field name="priority" type="C" size="200" />
		<field name="location" type="C" size="150" />
		<field name="notime" type="C" size="3">
			<notnull />
			<default value="0" />
		</field>
		<field name="visibility" type="C" size="50">
			<notnull />
			<default value="all" />
		</field>
		<field name="recurringtype" type="C" size="200" />

		<index name="activity_activityid_subject_idx">
			<col>activityid</col>
			<col>subject</col>
		</index>
		<index name="activity_activitytype_date_start_idx">
			<col>activitytype</col>
			<col>date_start</col>
		</index>
		<index name="activity_date_start_due_date_idx">
			<col>date_start</col>
			<col>due_date</col>
		</index>
		<index name="activity_date_start_time_start_idx">
			<col>date_start</col>
			<col>time_start</col>
		</index>
		<index name="activity_eventstatus_idx">
			<col>eventstatus</col>
		</index>
		<index name="activity_status_idx">
			<col>status</col>
		</index>
		<opt platform="mysql">Engine=InnoDB DEFAULT CHARSET utf8</opt>
Prasad's avatar
Prasad committed
	</table>