Introduce 'context' param to CRM.api CRM-12029
[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>
40 <name>locationType</name>
41 <table>civicrm_location_type</table>
42 <keyColumn>id</keyColumn>
43 <labelColumn>name</labelColumn>
44 </pseudoconstant>
45 <add>2.0</add>
46 </field>
47 <index>
48 <name>index_location_type</name>
49 <fieldName>location_type_id</fieldName>
50 <add>2.0</add>
51 </index>
52 <field>
53 <name>is_primary</name>
54 <title>Is Phone Primary?</title>
55 <type>boolean</type>
56 <default>0</default>
57 <comment>Is this the primary phone for this contact and location.</comment>
58 <add>1.1</add>
59 </field>
60 <index>
61 <name>index_is_primary</name>
62 <fieldName>is_primary</fieldName>
63 <add>2.0</add>
64 </index>
65 <field>
66 <name>is_billing</name>
67 <type>boolean</type>
68 <default>0</default>
69 <comment>Is this the billing?</comment>
70 <add>2.0</add>
71 </field>
72 <index>
73 <name>index_is_billing</name>
74 <fieldName>is_billing</fieldName>
75 <add>2.0</add>
76 </index>
77 <field>
78 <name>mobile_provider_id</name>
79 <type>int unsigned</type>
80 <comment>Which Mobile Provider does this phone belong to.</comment>
81 <add>1.1</add>
82 </field>
83 <index>
84 <name>UI_mobile_provider_id</name>
85 <fieldName>mobile_provider_id</fieldName>
86 <add>1.6</add>
87 </index>
88 <field>
89 <name>phone</name>
90 <type>varchar</type>
91 <length>32</length>
92 <import>true</import>
93 <headerPattern>/phone/i</headerPattern>
94 <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
95 <comment>Complete phone number.</comment>
96 <add>1.1</add>
97 </field>
98 <field>
99 <name>phone_ext</name>
100 <title>Phone Extension</title>
101 <type>varchar</type>
102 <length>16</length>
103 <size>FOUR</size>
104 <import>true</import>
105 <export>true</export>
106 <headerPattern>/extension/i</headerPattern>
107 <dataPattern>/^\d+$/</dataPattern>
108 <comment>Optional extension for a phone number.</comment>
109 <add>3.3</add>
110 </field>
111 <field>
112 <name>phone_numeric</name>
113 <type>varchar</type>
114 <length>32</length>
115 <comment>Phone number stripped of all whitespace, letters, and punctuation.</comment>
116 <add>4.3</add>
117 </field>
118 <index>
119 <name>index_phone_numeric</name>
120 <fieldName>phone_numeric</fieldName>
121 <add>4.3</add>
122 </index>
123 <field>
124 <name>phone_type</name>
125 <type>enum</type>
126 <values>Phone, Mobile, Fax, Pager</values>
127 <headerPattern>/phone\s+type/i</headerPattern>
128 <dataPattern>/phone|mobile|fax|pager/i</dataPattern>
129 <comment>What type of telecom device is this.</comment>
130 <add>1.1</add>
131 <drop>2.2</drop>
132 </field>
133 <field>
134 <name>phone_type_id</name>
135 <title>Phone Type</title>
136 <type>int unsigned</type>
137 <comment>Which type of phone does this number belongs.</comment>
138 <pseudoconstant>
139 <name>phoneType</name>
140 <optionGroupName>phoneType</optionGroupName>
141 </pseudoconstant>
142 <add>2.2</add>
143 </field>
144</table>