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