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