Merge pull request #3649 from colemanw/totten-colemanw-validate
[civicrm-core.git] / xml / schema / Core / Phone.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Core</base>
5 <class>Phone</class>
6 <name>civicrm_phone</name>
7 <comment>Phone information for a specific location.</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Unique Phone ID</comment>
15 <add>1.1</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>contact_id</name>
23 <type>int unsigned</type>
24 <comment>FK to Contact ID</comment>
25 <add>2.0</add>
26 </field>
27 <foreignKey>
28 <name>contact_id</name>
29 <table>civicrm_contact</table>
30 <key>id</key>
31 <add>2.0</add>
32 <onDelete>CASCADE</onDelete>
33 </foreignKey>
34 <field>
35 <name>location_type_id</name>
36 <title>Phone Location Type</title>
37 <type>int unsigned</type>
38 <comment>Which Location does this phone belong to.</comment>
39 <pseudoconstant>
6a488035
TO
40 <table>civicrm_location_type</table>
41 <keyColumn>id</keyColumn>
a38a89fc 42 <labelColumn>display_name</labelColumn>
6a488035 43 </pseudoconstant>
614d72ec 44 <html>
e0991796 45 <type>Select</type>
614d72ec 46 </html>
6a488035
TO
47 <add>2.0</add>
48 </field>
49 <index>
50 <name>index_location_type</name>
51 <fieldName>location_type_id</fieldName>
52 <add>2.0</add>
53 </index>
54 <field>
55 <name>is_primary</name>
56 <title>Is Phone Primary?</title>
57 <type>boolean</type>
58 <default>0</default>
59 <comment>Is this the primary phone for this contact and location.</comment>
60 <add>1.1</add>
61 </field>
62 <index>
63 <name>index_is_primary</name>
64 <fieldName>is_primary</fieldName>
65 <add>2.0</add>
66 </index>
67 <field>
68 <name>is_billing</name>
69 <type>boolean</type>
70 <default>0</default>
71 <comment>Is this the billing?</comment>
72 <add>2.0</add>
73 </field>
74 <index>
75 <name>index_is_billing</name>
76 <fieldName>is_billing</fieldName>
77 <add>2.0</add>
78 </index>
79 <field>
80 <name>mobile_provider_id</name>
81 <type>int unsigned</type>
82 <comment>Which Mobile Provider does this phone belong to.</comment>
83 <add>1.1</add>
84 </field>
85 <index>
86 <name>UI_mobile_provider_id</name>
3c7d2158 87 <fieldName>mobile_provider_id</fieldName>
6a488035
TO
88 <add>1.6</add>
89 </index>
90 <field>
91 <name>phone</name>
92 <type>varchar</type>
93 <length>32</length>
94 <import>true</import>
95 <headerPattern>/phone/i</headerPattern>
96 <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
97 <comment>Complete phone number.</comment>
98 <add>1.1</add>
99 </field>
100 <field>
101 <name>phone_ext</name>
102 <title>Phone Extension</title>
103 <type>varchar</type>
104 <length>16</length>
614d72ec 105 <html>
106 <type>Text</type>
107 <size>FOUR</size>
108 </html>
6a488035
TO
109 <import>true</import>
110 <export>true</export>
111 <headerPattern>/extension/i</headerPattern>
112 <dataPattern>/^\d+$/</dataPattern>
113 <comment>Optional extension for a phone number.</comment>
114 <add>3.3</add>
115 </field>
116 <field>
117 <name>phone_numeric</name>
118 <type>varchar</type>
119 <length>32</length>
120 <comment>Phone number stripped of all whitespace, letters, and punctuation.</comment>
121 <add>4.3</add>
122 </field>
123 <index>
124 <name>index_phone_numeric</name>
125 <fieldName>phone_numeric</fieldName>
126 <add>4.3</add>
127 </index>
128 <field>
129 <name>phone_type</name>
130 <type>enum</type>
131 <values>Phone, Mobile, Fax, Pager</values>
132 <headerPattern>/phone\s+type/i</headerPattern>
133 <dataPattern>/phone|mobile|fax|pager/i</dataPattern>
134 <comment>What type of telecom device is this.</comment>
135 <add>1.1</add>
136 <drop>2.2</drop>
137 </field>
138 <field>
139 <name>phone_type_id</name>
140 <title>Phone Type</title>
141 <type>int unsigned</type>
142 <comment>Which type of phone does this number belongs.</comment>
143 <pseudoconstant>
398f49ab 144 <optionGroupName>phone_type</optionGroupName>
6a488035 145 </pseudoconstant>
614d72ec 146 <html>
e0991796 147 <type>Select</type>
614d72ec 148 </html>
6a488035 149 <add>2.2</add>
3c7d2158 150 </field>
6a488035 151</table>