Merge pull request #23296 from colemanw/afformRelationships
[civicrm-core.git] / xml / schema / Core / Phone.xml
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 <icon>fa-phone</icon>
11 <labelField>phone</labelField>
12 <field>
13 <name>id</name>
14 <title>Phone ID</title>
15 <type>int unsigned</type>
16 <required>true</required>
17 <comment>Unique Phone ID</comment>
18 <html>
19 <type>Number</type>
20 </html>
21 <add>1.1</add>
22 </field>
23 <primaryKey>
24 <name>id</name>
25 <autoincrement>true</autoincrement>
26 </primaryKey>
27 <field>
28 <name>contact_id</name>
29 <title>Contact ID</title>
30 <type>int unsigned</type>
31 <comment>FK to Contact ID</comment>
32 <html>
33 <label>Contact</label>
34 </html>
35 <add>2.0</add>
36 </field>
37 <foreignKey>
38 <name>contact_id</name>
39 <table>civicrm_contact</table>
40 <key>id</key>
41 <add>2.0</add>
42 <onDelete>CASCADE</onDelete>
43 </foreignKey>
44 <field>
45 <name>location_type_id</name>
46 <title>Location Type ID</title>
47 <type>int unsigned</type>
48 <comment>Which Location does this phone belong to.</comment>
49 <pseudoconstant>
50 <table>civicrm_location_type</table>
51 <keyColumn>id</keyColumn>
52 <labelColumn>display_name</labelColumn>
53 </pseudoconstant>
54 <html>
55 <type>Select</type>
56 <label>Location Type</label>
57 </html>
58 <add>2.0</add>
59 </field>
60 <index>
61 <name>index_location_type</name>
62 <fieldName>location_type_id</fieldName>
63 <add>2.0</add>
64 </index>
65 <field>
66 <name>is_primary</name>
67 <title>Primary phone</title>
68 <type>boolean</type>
69 <default>0</default>
70 <required>true</required>
71 <html>
72 <type>Radio</type>
73 </html>
74 <comment>Is this the primary phone for this contact and location.</comment>
75 <add>1.1</add>
76 </field>
77 <index>
78 <name>index_is_primary</name>
79 <fieldName>is_primary</fieldName>
80 <add>2.0</add>
81 </index>
82 <field>
83 <name>is_billing</name>
84 <title>Is Billing Phone</title>
85 <type>boolean</type>
86 <default>0</default>
87 <required>true</required>
88 <comment>Is this the billing?</comment>
89 <add>2.0</add>
90 </field>
91 <index>
92 <name>index_is_billing</name>
93 <fieldName>is_billing</fieldName>
94 <add>2.0</add>
95 </index>
96 <field>
97 <name>mobile_provider_id</name>
98 <title>Mobile Provider</title>
99 <type>int unsigned</type>
100 <comment>Which Mobile Provider does this phone belong to.</comment>
101 <add>1.1</add>
102 </field>
103 <index>
104 <name>UI_mobile_provider_id</name>
105 <fieldName>mobile_provider_id</fieldName>
106 <add>1.6</add>
107 </index>
108 <field>
109 <name>phone</name>
110 <type>varchar</type>
111 <length>32</length>
112 <import>true</import>
113 <headerPattern>/phone/i</headerPattern>
114 <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
115 <comment>Complete phone number.</comment>
116 <add>1.1</add>
117 <html>
118 <type>Text</type>
119 <label>Phone</label>
120 </html>
121 </field>
122 <field>
123 <name>phone_ext</name>
124 <title>Phone Extension</title>
125 <type>varchar</type>
126 <length>16</length>
127 <html>
128 <type>Text</type>
129 <size>4</size>
130 </html>
131 <import>true</import>
132 <export>true</export>
133 <headerPattern>/extension/i</headerPattern>
134 <dataPattern>/^\d+$/</dataPattern>
135 <comment>Optional extension for a phone number.</comment>
136 <add>3.3</add>
137 </field>
138 <field>
139 <name>phone_numeric</name>
140 <type>varchar</type>
141 <length>32</length>
142 <comment>Phone number stripped of all whitespace, letters, and punctuation.</comment>
143 <html>
144 <label>Numeric</label>
145 </html>
146 <add>4.3</add>
147 </field>
148 <index>
149 <name>index_phone_numeric</name>
150 <fieldName>phone_numeric</fieldName>
151 <add>4.3</add>
152 </index>
153 <field>
154 <name>phone_type_id</name>
155 <title>Phone Type ID</title>
156 <type>int unsigned</type>
157 <export>true</export>
158 <comment>Which type of phone does this number belongs.</comment>
159 <pseudoconstant>
160 <optionGroupName>phone_type</optionGroupName>
161 </pseudoconstant>
162 <html>
163 <type>Select</type>
164 <label>Phone Type</label>
165 </html>
166 <add>2.2</add>
167 </field>
168 </table>