<?xml version="1.0" encoding="utf-8"?>
<!--
 *	CFCrm
 *
 *	Copyright (c) 2014-2017 Mark Sobkow
 *	
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *	
 *	    http://www.apache.org/licenses/LICENSE-2.0
 *	
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 *-->
<MSSBam
		xmlns="uri://msscodefactory/mssbam"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:xs="http://www.w3.org/2001/XMLSchema"
		xsi:schemaLocation="uri://msscodefactory/mssbam file:../bin/xsd/mssbam-2.9.xsd"
		Name="CFCrm"
		Revision="2.10"
		Description="CFCrm"
		ProjectRoot="net.sourceforge.MSSCodeFactory.CFCrm.2.10" >
	<Tld Name="org" >
		<TopDomain Name="apache" >
			<License Name="ApacheV2"
					Description="Apache Version 2 License">
Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
    http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</License>
		</TopDomain>
		<TopDomain Name="gnu" >
			<License Name="GplV2"
					Description="GNU GPL v2+ License">
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this project.  If not, see http://www.gnu.org/licenses/.</License>
			<License Name="GplV3"
					Description="GNU GPL v3+ License">
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this project.  If not, see http://www.gnu.org/licenses/.</License>
			<License Name="LGplV2"
					Description="GNU Lesser/Library GPL v2+ License">
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.
.
You should have received a copy of the GNU Lesser Public License
along with this project.  If not, see http://www.gnu.org/licenses/.</License>
			<License Name="LGplV3"
					Description="GNU Lesser/Library GPL v3+ License">
This project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.
.
You should have received a copy of the GNU Lesser Public License
along with this project.  If not, see http://www.gnu.org/licenses/.</License>
		</TopDomain>
	</Tld>
	<Tld Name="net" >
		<TopDomain Name="sourceforge" >
			<TopProject Name="MSSCodeFactory" >
				<SubProject Name="CFCrm" >
					<MajorVersion Name="2" >
						<MinorVersion Name="10" >
<SchemaDef Name="CFCrm"
		DbName="CFCrm210"
		Description=""
		DefaultLicense="org.apache.ApacheV2"
		ExtendCFCore="true"
		CopyrightHolder="Mark Sobkow"
		CopyrightPeriod="2014-2017"
		AuthorEMail="msobkow@sasktel.net"
		ProjectURL="http://msscodefactory.sourceforge.net/"
		PublishURI="http://msscodefactory.sourceforge.net/model-2.9/net-sourceforge-MSSCodeFactory-CFCrm-2-10-CFCrm.xml" >

	<SchemaRef Name="CFSecurity"
			RefModelName="net-sourceforge-MSSCodeFactory-CFSecurity-2-10-CFSecurity"
			IncludeRoot="net.sourceforge.MSSCodeFactory.CFSecurity.2.10.CFSecurity" />

	<Id64Gen Name="AddressIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="300"
			BlockSize="1" />

	<Id64Gen Name="AttachmentIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="301"
			BlockSize="1" />

	<Id64Gen Name="ContactIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="302"
			BlockSize="1" />

	<Id64Gen Name="ContactListIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="303"
			BlockSize="1" />

	<Id64Gen Name="ContactURLIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="304"
			BlockSize="1" />

	<Id64Gen Name="MemoIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="305"
			BlockSize="1" />

	<Id64Gen Name="PhoneIdGen"
			IsNullable="false"
			DefaultVisibility="true"
			MinValue="0"
			InitValue="0"
			NullValue="0"
			Dispenser="Tenant"
			Slice="306"
			BlockSize="1" />

	<Table Name="Address"
			TableClassCode="ADR"
			DbName="Address"
			Label="Address"
			Description="Addresses are details of a Contact"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="AddressUDescrIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="AddressId"
				Label="Address Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="AddressIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<StringCol Name="Description"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1"
				InitValue="" />
		<StringCol Name="AddrLine1"
				Label="Address Line 1"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1" />
		<StringCol Name="AddrLine2"
				Label="Address Line 2"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1" />
		<StringCol Name="City"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1" />
		<StringCol Name="State"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="5"
				ShowLines="1" />
		<TableCol Name="CountryId"
				Label="Country Id"
				IsNullable="true"
				DefaultVisibility="true"
				DataType="ISOCountryIdGen" />
		<StringCol Name="Zip"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="15"
				ShowLines="1" />
		<PrimaryIndex Name="AddressIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Address_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="AddressId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="AddressTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Address_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AddressContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Address_xctc"
				ShortName="Contact"
				Suffix="ContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AddressUDescrIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Address_xudsc"
				ShortName="UDescr"
				Suffix="UDescrIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="Description" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AddressCountryIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Address_xcntry"
				ShortName="CountryIdx"
				Suffix="CountryIdx" >
			<IndexCol Name="CountryId" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="Attachment"
			TableClassCode="ATTC"
			DbName="Attchmnt"
			Label="Attachment"
			Description="Attachments are details of a Contact"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="AttachmentUNameIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="AttachmentId"
				Label="Attachment Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="AttachmentIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<StringCol Name="AttachmentName"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="128"
				ShowLines="1"
				InitValue="" />
		<StringCol Name="Description"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="512"
				ShowLines="1"
				InitValue="" />
		<PrimaryIndex Name="AttachmentIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Attachment_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="false" DefaultVisibility="true" />
			<IndexCol Name="AttachmentId" IsAscending="false" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="AttachmentTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Attachment_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AttachmentContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Attachment_xcontact"
				ShortName="Contact"
				Suffix="ContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AttachmentUNameIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Attachment_xuname"
				ShortName="UName"
				Suffix="UNameIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="AttachmentName" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="AttachmentData"
			TableClassCode="ATTD"
			DbName="AttchmntData"
			Label="Attachment Data"
			Description="Attachment data contains the attached file"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="AttachmentId"
				Label="Attachment Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="AttachmentIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<BlobCol Name="Attach"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="1073741824" />
		<PrimaryIndex Name="AttachmentDataIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="AttData_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="false" DefaultVisibility="true" />
			<IndexCol Name="AttachmentId" IsAscending="false" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="AttachmentDataTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="AttData_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="AttachmentDataContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="AttData_xcontact"
				ShortName="Contact"
				Suffix="ContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="Contact"
			TableClassCode="CTC"
			DbName="Contact"
			Label="Contact"
			Description="Contacts are components of ContactList"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="ContactUFullNameIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				Label="Tenant Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="ContactIdGen" />
		<TableCol Name="ContactListId"
				Label="Contact List Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactListIdGen" />
		<TableCol Name="ISOTimezoneId"
				Label="ISO Timezone Id"
				IsNullable="true"
				DefaultVisibility="true"
				DataType="ISOTimezoneIdGen" />
		<StringCol Name="FullName"
				Label="Full Name"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="127"
				ShowLines="1"
				InitValue="" />
		<StringCol Name="LastName"
				Label="Last Name"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1" />
		<StringCol Name="FirstName"
				Label="First Name"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1" />
		<StringCol Name="Custom"
				Label="Custom 1"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="254"
				ShowLines="1" />
		<StringCol Name="Custom2"
				Label="Custom 2"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="254"
				ShowLines="1" />
		<StringCol Name="Custom3"
				Label="Custom 3"
				IsNullable="true"
				DefaultVisibility="true"
				MaxLen="254"
				ShowLines="1" />
		<PrimaryIndex Name="ContactIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Contact_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="ContactTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Contact_xtenant"
				ShortName="Tenant"
				Suffix="ContTentIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactContactListIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Contact_xctl"
				ShortName="CtcList"
				Suffix="ContListIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactListId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactUFullNameIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Contact_xufullname"
				ShortName="FullName"
				Suffix="FullNameIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactListId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="FullName" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactTimezoneIdx"
				DefaultVisibility="true"
				IsDbMapped="false"
				IsUnique="false"
				DbName="Contact_xtz"
				ShortName="Timezone"
				Suffix="TimezoneIdx" >
			<IndexCol Name="ISOTimezoneId" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="ContactList"
			TableClassCode="CTL"
			DbName="CtcLst"
			ShortName="CtctLst"
			Label="Contact List"
			Description="ContactLists are details of a Tenant"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="ContactListUDescrIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="ContactListId"
				Label="Contact List Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="ContactListIdGen" />
		<TableCol Name="TenantId"
				Label="Tenant Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<StringCol Name="Description"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1"
				InitValue="" />
		<PrimaryIndex Name="ContactListIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="ContactList_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactListId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="ContactListTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="ContactList_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactListUDescrIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="ContactList_xudsc"
				ShortName="UDescr"
				Suffix="UDescrIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="Description" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="ContactURL"
			TableClassCode="CURL"
			DbName="CtcURL"
			Label="Contact URL"
			Description="Contact URLs are details of a Contact"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="ContactURLUNameIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="ContactURLId"
				Label="Contact URL Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="ContactURLIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<StringCol Name="Name"
				IsNullable="false"
				DefaultVisibility="true"
				DbName="safe_name"
				MaxLen="64"
				ShowLines="1"
				InitValue="" />
		<StringCol Name="URL"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="2000"
				ShowLines="1"
				InitValue="" />
		<PrimaryIndex Name="ContactURLIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="CtcURL_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactURLId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="ContactURLTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="CtcURL_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactURLContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="CtcURL_xcontact"
				ShortName="Contact"
				Suffix="ContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="ContactURLUNameIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="CtcURL_xunam"
				ShortName="UName"
				Suffix="UNameIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="Name" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="Memo"
			TableClassCode="MMO"
			DbName="Memo"
			Label="Memo"
			Description="Memos are details of a Contact"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="MemoUDescrIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="MemoId"
				Label="Memo Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="MemoIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<StringCol Name="Description"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1"
				InitValue="" />
		<PrimaryIndex Name="MemoIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Memo_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="MemoId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="MemoTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Memo_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="MemoContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Memo_xcontact"
				ShortName="Contact"
				Suffix="MemoContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="MemoUDescrIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Memo_xudsc"
				ShortName="UDescr"
				Suffix="UDescrIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="Description" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="MemoData"
			TableClassCode="MMOD"
			DbName="MemoData"
			Label="Memo Data"
			Description="Memo data contains the actual memo text"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="MemoId"
				Label="Memo Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="MemoIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<TextCol Name="MemoText"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="1073741824"
				ShowLines="40"
				InitValue="" />
		<PrimaryIndex Name="MemoDataIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="MemoData_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="MemoId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="MemoDataTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="MemoData_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="MemoDataContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="MemoData_xcontact"
				ShortName="Contact"
				Suffix="MemoDataCtcIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<Table Name="Phone"
			TableClassCode="PH"
			DbName="Phone"
			ShortName="Phn"
			Label="Phone"
			Description="Phones are details of a Contact"
			DefaultVisibility="true"
			IsInstantiable="true"
			HasHistory="true"
			HasAuditColumns="true"
			LookupIndex="PhoneUPhoneNumberIdx"
			LoaderBehaviour="Update"
			SecScope="Tenant" >
		<TableCol Name="TenantId"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="TenantIdGen" />
		<TableCol Name="PhoneId"
				Label="Phone Id"
				IsNullable="false"
				DefaultVisibility="true"
				GenerateId="true"
				DataType="PhoneIdGen" />
		<TableCol Name="ContactId"
				Label="Contact Id"
				IsNullable="false"
				DefaultVisibility="true"
				DataType="ContactIdGen" />
		<StringCol Name="Description"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="50"
				ShowLines="1"
				InitValue="" />
		<StringCol Name="PhoneNumber"
				Label="Phone Number"
				IsNullable="false"
				DefaultVisibility="true"
				MaxLen="20"
				ShowLines="1"
				InitValue="" />
		<PrimaryIndex Name="PhoneIdIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Phone_pidx"
				ShortName="PIdx"
				Suffix="IdIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="PhoneId" IsAscending="true" DefaultVisibility="true" />
		</PrimaryIndex>
		<Index Name="PhoneTenantIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Phone_xtenant"
				ShortName="Tenant"
				Suffix="TenantIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="PhoneContactIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="false"
				DbName="Phone_xphdt"
				ShortName="Contact"
				Suffix="ContactIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="PhoneUDescrIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Phone_xudsc"
				ShortName="UDescr"
				Suffix="UDescrIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="Description" IsAscending="true" DefaultVisibility="true" />
		</Index>
		<Index Name="PhoneUPhoneNumberIdx"
				DefaultVisibility="true"
				IsDbMapped="true"
				IsUnique="true"
				DbName="Phone_xuphn"
				ShortName="UPhNum"
				Suffix="UPhoneNumberIdx" >
			<IndexCol Name="TenantId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="ContactId" IsAscending="true" DefaultVisibility="true" />
			<IndexCol Name="PhoneNumber" IsAscending="true" DefaultVisibility="true" />
		</Index>
	</Table>

	<TableAddendum FromTable="Address">
		<Relation Name="AddressTenant"
				RelationType="Owner"
				DbName="addr_addrtenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="AddressTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="AddressContact"
				RelationType="Container"
				DbName="addr_addrctc"
				Label="Contact"
				Suffix="Contact"
				FromIndex="AddressContactIdx"
				ToIndex="Contact.ContactIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Country"
				RelationType="Lookup"
				DbName="addr_cntry"
				Label="Country"
				Suffix="Country"
				FromIndex="AddressCountryIdx"
				ToIndex="ISOCountry.ISOCountryIdIdx"
				IsRequired="false"
				DefaultVisibility="true" >
			<RelationCol Name="CountryId" ToCol="ISOCountryId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Attachment">
		<Relation Name="AttachmentTenant"
				RelationType="Owner"
				DbName="attach_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="AttachmentTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="AttachmentContact"
				RelationType="Container"
				DbName="attach_ctct"
				Label="Contact"
				Suffix="Contact"
				FromIndex="AttachmentContactIdx"
				ToIndex="Contact.ContactIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Data"
				RelationType="Components"
				DbName="attach_data"
				Label="Data"
				Suffix="Data"
				FromIndex="AttachmentIdIdx"
				ToIndex="AttachmentData.AttachmentDataIdIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="AttachmentId" ToCol="AttachmentId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="AttachmentData">
		<Relation Name="AttachmentDataTenant"
				RelationType="Owner"
				DbName="attdata_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="AttachmentDataTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="AttachmentDataAttachment"
				RelationType="Container"
				DbName="attdata_att"
				Label="Attachment"
				Suffix="Attachment"
				FromIndex="AttachmentDataIdIdx"
				ToIndex="Attachment.AttachmentIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="AttachmentId" ToCol="AttachmentId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Contact">
		<Relation Name="ContactTenant"
				RelationType="Owner"
				DbName="ctct_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="ContactTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="ContactList"
				RelationType="Container"
				DbName="ctct_ctctlst"
				Label="Contact List"
				Suffix="ContactList"
				FromIndex="ContactContactListIdx"
				ToIndex="ContactList.ContactListIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactListId" ToCol="ContactListId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Address"
				RelationType="Components"
				DbName="ctct_addr"
				Label="Address"
				Suffix="Address"
				FromIndex="ContactIdIdx"
				ToIndex="Address.AddressContactIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Phone"
				RelationType="Components"
				DbName="ctct_ph"
				Label="Phone"
				Suffix="Phone"
				FromIndex="ContactIdIdx"
				ToIndex="Phone.PhoneContactIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="ContactURL"
				RelationType="Components"
				DbName="ctct_url"
				Label="Contact URL"
				Suffix="ContactURL"
				FromIndex="ContactIdIdx"
				ToIndex="ContactURL.ContactURLContactIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="ContactTimezone"
				RelationType="Lookup"
				DbName="ctct_tz"
				Label="Contact Timezone"
				Suffix="ContactTimezone"
				FromIndex="ContactTimezoneIdx"
				ToIndex="ISOTimezone.ISOTimezoneIdIdx"
				IsRequired="false"
				DefaultVisibility="true" >
			<RelationCol Name="ISOTimezoneId" ToCol="ISOTimezoneId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Memo"
				RelationType="Components"
				DbName="ctct_memo"
				Label="Memo"
				Suffix="Memo"
				FromIndex="ContactIdIdx"
				ToIndex="Memo.MemoContactIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Attachment"
				RelationType="Components"
				DbName="ctct_att"
				Label="Attachment"
				Suffix="Attachment"
				FromIndex="ContactIdIdx"
				ToIndex="Attachment.AttachmentContactIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="ContactList">
		<Relation Name="ContactListTenant"
				RelationType="Container"
				DbName="ctclst_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="ContactListTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="ContactListContact"
				RelationType="Components"
				DbName="ctclst_ctct"
				Label="Contact"
				Suffix="Contact"
				FromIndex="ContactListIdIdx"
				ToIndex="Contact.ContactContactListIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactListId" ToCol="ContactListId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="ContactURL">
		<Relation Name="ContactURLTenant"
				RelationType="Owner"
				DbName="ctcurl_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="ContactURLTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Contact"
				RelationType="Container"
				DbName="ctcurl_ctct"
				Label="Contact"
				Suffix="Contact"
				FromIndex="ContactURLContactIdx"
				ToIndex="Contact.ContactIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Memo">
		<Relation Name="MemoTenant"
				RelationType="Owner"
				DbName="memo_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="MemoTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="MemoContact"
				RelationType="Container"
				DbName="memo_ctct"
				Label="Contact"
				Suffix="Contact"
				FromIndex="MemoContactIdx"
				ToIndex="Contact.ContactIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
		<Relation Name="MemoData"
				RelationType="Components"
				DbName="memo_data"
				Label="Memo Data"
				Suffix="MemoData"
				FromIndex="MemoIdIdx"
				ToIndex="MemoData.MemoDataIdIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="MemoId" ToCol="MemoId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="MemoData">
		<Relation Name="MemoDataTenant"
				RelationType="Owner"
				DbName="memodata_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="MemoDataTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="MemoDataMemo"
				RelationType="Container"
				DbName="memodata_memo"
				Label="Memo"
				Suffix="Memo"
				FromIndex="MemoDataIdIdx"
				ToIndex="Memo.MemoIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="MemoId" ToCol="MemoId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Phone">
		<Relation Name="PhoneTenant"
				RelationType="Owner"
				DbName="phn_tenant"
				Label="Tenant"
				Suffix="Tenant"
				FromIndex="PhoneTenantIdx"
				ToIndex="Tenant.TenantIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="Id" DefaultVisibility="true" />
		</Relation>
		<Relation Name="Contact"
				RelationType="Container"
				DbName="phn_ctct"
				Label="Contact"
				Suffix="Contact"
				FromIndex="PhoneContactIdx"
				ToIndex="Contact.ContactIdIdx"
				IsRequired="true"
				DefaultVisibility="true" >
			<RelationCol Name="TenantId" ToCol="TenantId" DefaultVisibility="true" />
			<RelationCol Name="ContactId" ToCol="ContactId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Tenant">
		<Relation Name="ContactList"
				RelationType="Components"
				DbName="tenant_ctclst"
				Label="Contact List"
				Suffix="CtcList"
				FromIndex="TenantIdIdx"
				ToIndex="ContactList.ContactListTenantIdx"
				IsRequired="false"
				IsXsdContainer="true"
				DefaultVisibility="true" >
			<RelationCol Name="Id" ToCol="TenantId" DefaultVisibility="true" />
		</Relation>
	</TableAddendum>

	<TableAddendum FromTable="Attachment">
		<DelDep Name="DelData" DelDepChain="Data" />
	</TableAddendum>

	<TableAddendum FromTable="Contact">
		<DelDep Name="DelAddresses" DelDepChain="Address" />
		<DelDep Name="DelPhones" DelDepChain="Phone" />
		<DelDep Name="DelURLs" DelDepChain="ContactURL" />
		<DelDep Name="DelMemos" DelDepChain="Memo" />
	</TableAddendum>

	<TableAddendum FromTable="ContactList">
		<DelDep Name="DelContacts" DelDepChain="ContactListContact" />
		<DelDep Name="DelAddresses" DelDepChain="ContactListContact.Address" />
		<DelDep Name="DelPhones" DelDepChain="ContactListContact.Phone" />
		<DelDep Name="DelURLs" DelDepChain="ContactListContact.ContactURL" />
		<DelDep Name="DelMemos" DelDepChain="ContactListContact.Memo" />
	</TableAddendum>

	<TableAddendum FromTable="Memo">
		<DelDep Name="DelData" DelDepChain="MemoData" />
	</TableAddendum>

	<TableAddendum FromTable="Tenant">
		<DelDep Name="DelContactLists" DelDepChain="ContactList" />
	</TableAddendum>
</SchemaDef>
						</MinorVersion>
					</MajorVersion>
				</SubProject>
			</TopProject>
		</TopDomain>
	</Tld>
</MSSBam>
