Merge pull request #15415 from ixiam/dev_issue#1297
[civicrm-core.git] / xml / schema / Case / Case.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2 <table>
3 <base>CRM/Case</base>
4 <class>Case</class>
5 <name>civicrm_case</name>
6 <comment>This table stores information about cases grouping activities.</comment>
7 <add>1.8</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <uniqueName>case_id</uniqueName>
13 <required>true</required>
14 <import>true</import>
15 <title>Case ID</title>
16 <comment>Unique Case ID</comment>
17 <html>
18 <type>Text</type>
19 </html>
20 <add>1.8</add>
21 </field>
22 <primaryKey>
23 <name>id</name>
24 <autoincrement>true</autoincrement>
25 </primaryKey>
26 <field>
27 <name>contact_id</name>
28 <type>int unsigned</type>
29 <uniqueName>case_contact_id</uniqueName>
30 <required>true</required>
31 <comment>Contact ID of contact record given case belongs to.</comment>
32 <add>1.8</add>
33 <drop>2.1</drop>
34 </field>
35 <foreignKey>
36 <name>contact_id</name>
37 <table>civicrm_contact</table>
38 <key>id</key>
39 <add>1.8</add>
40 <drop>2.1</drop>
41 <onDelete>CASCADE</onDelete>
42 </foreignKey>
43 <field>
44 <name>case_type_id</name>
45 <type>int unsigned</type>
46 <import>true</import>
47 <export>false</export>
48 <title>Case Type</title>
49 <required>true</required>
50 <comment>FK to civicrm_case_type.id</comment>
51 <html>
52 <type>Select</type>
53 </html>
54 <pseudoconstant>
55 <table>civicrm_case_type</table>
56 <keyColumn>id</keyColumn>
57 <labelColumn>title</labelColumn>
58 </pseudoconstant>
59 <add>2.0</add>
60 </field>
61 <index>
62 <name>index_case_type_id</name>
63 <fieldName>case_type_id</fieldName>
64 <add>2.0</add>
65 </index>
66 <foreignKey>
67 <name>case_type_id</name>
68 <table>civicrm_case_type</table>
69 <key>id</key>
70 <add>4.5</add>
71 </foreignKey>
72 <field>
73 <name>casetag1_id</name>
74 <type>varchar</type>
75 <length>128</length>
76 <required>true</required>
77 <comment>Id of first case category.</comment>
78 <add>1.8</add>
79 <drop>2.0</drop>
80 </field>
81 <index>
82 <name>index_casetag1_id</name>
83 <fieldName>casetag1_id</fieldName>
84 <add>1.8</add>
85 <drop>2.0</drop>
86 </index>
87 <field>
88 <name>casetag2_id</name>
89 <type>varchar</type>
90 <length>128</length>
91 <required>true</required>
92 <comment>Id of second case category.</comment>
93 <add>1.8</add>
94 <drop>2.0</drop>
95 </field>
96 <index>
97 <name>index_casetag2_id</name>
98 <fieldName>casetag2_id</fieldName>
99 <add>1.8</add>
100 <drop>2.0</drop>
101 </index>
102 <field>
103 <name>casetag3_id</name>
104 <type>varchar</type>
105 <length>128</length>
106 <required>true</required>
107 <comment>Id of third case category.</comment>
108 <add>1.8</add>
109 <drop>2.0</drop>
110 </field>
111 <index>
112 <name>index_casetag3_id</name>
113 <fieldName>casetag3_id</fieldName>
114 <add>1.8</add>
115 <drop>2.0</drop>
116 </index>
117 <field>
118 <name>subject</name>
119 <type>varchar</type>
120 <length>128</length>
121 <title>Case Subject</title>
122 <import>true</import>
123 <uniqueName>case_subject</uniqueName>
124 <comment>Short name of the case.</comment>
125 <html>
126 <type>Text</type>
127 </html>
128 <add>1.8</add>
129 </field>
130 <field>
131 <name>start_date</name>
132 <uniqueName>case_start_date</uniqueName>
133 <title>Case Start Date</title>
134 <import>true</import>
135 <type>date</type>
136 <comment>Date on which given case starts.</comment>
137 <html>
138 <type>Select Date</type>
139 <formatType>activityDateTime</formatType>
140 </html>
141 <add>1.8</add>
142 </field>
143 <field>
144 <name>end_date</name>
145 <uniqueName>case_end_date</uniqueName>
146 <title>Case End Date</title>
147 <import>true</import>
148 <type>date</type>
149 <comment>Date on which given case ends.</comment>
150 <html>
151 <type>Select Date</type>
152 <formatType>activityDateTime</formatType>
153 </html>
154 <add>1.8</add>
155 </field>
156 <field>
157 <name>details</name>
158 <type>text</type>
159 <html>
160 <type>TextArea</type>
161 <rows>8</rows>
162 <cols>60</cols>
163 </html>
164 <comment>Details about the meeting (agenda, notes, etc).</comment>
165 <add>1.8</add>
166 </field>
167 <field>
168 <name>status_id</name>
169 <type>int unsigned</type>
170 <uniqueName>case_status_id</uniqueName>
171 <required>true</required>
172 <import>true</import>
173 <export>false</export>
174 <title>Case Status</title>
175 <comment>Id of case status.</comment>
176 <pseudoconstant>
177 <optionGroupName>case_status</optionGroupName>
178 </pseudoconstant>
179 <html>
180 <type>Select</type>
181 </html>
182 <add>1.8</add>
183 </field>
184 <field>
185 <name>is_deleted</name>
186 <title>Case is in the Trash</title>
187 <uniqueName>case_deleted</uniqueName>
188 <type>boolean</type>
189 <default>0</default>
190 <import>true</import>
191 <title>Case Deleted</title>
192 <html>
193 <type>CheckBox</type>
194 </html>
195 <add>2.2</add>
196 </field>
197 <index>
198 <name>index_is_deleted</name>
199 <fieldName>is_deleted</fieldName>
200 <add>2.2</add>
201 </index>
202 <field>
203 <name>created_date</name>
204 <uniqueName>case_created_date</uniqueName>
205 <type>timestamp</type>
206 <comment>When was the case was created.</comment>
207 <required>false</required>
208 <export>true</export>
209 <default>NULL</default>
210 <add>4.7</add>
211 </field>
212 <field>
213 <name>modified_date</name>
214 <uniqueName>case_modified_date</uniqueName>
215 <type>timestamp</type>
216 <comment>When was the case (or closely related entity) was created or modified or deleted.</comment>
217 <required>false</required>
218 <export>true</export>
219 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
220 <add>4.7</add>
221 </field>
222 </table>