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