Merge pull request #3330 from monishdeb/CRM-14724
[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 <comment>FK to civicrm_case_type.id</comment>
47 <html>
48 <type>Select</type>
49 </html>
50 <add>2.0</add>
51 </field>
52 <index>
53 <name>index_case_type_id</name>
54 <fieldName>case_type_id</fieldName>
55 <add>2.0</add>
56 </index>
57 <foreignKey>
58 <name>case_type_id</name>
59 <table>civicrm_case_type</table>
60 <key>id</key>
61 <add>4.5</add>
62 <onDelete>SET NULL</onDelete>
63 </foreignKey>
64 <field>
65 <name>casetag1_id</name>
66 <type>varchar</type>
67 <length>128</length>
68 <required>true</required>
69 <comment>Id of first case category.</comment>
70 <add>1.8</add>
71 <drop>2.0</drop>
72 </field>
73 <index>
74 <name>index_casetag1_id</name>
75 <fieldName>casetag1_id</fieldName>
76 <add>1.8</add>
77 <drop>2.0</drop>
78 </index>
79 <field>
80 <name>casetag2_id</name>
81 <type>varchar</type>
82 <length>128</length>
83 <required>true</required>
84 <comment>Id of second case category.</comment>
85 <add>1.8</add>
86 <drop>2.0</drop>
87 </field>
88 <index>
89 <name>index_casetag2_id</name>
90 <fieldName>casetag2_id</fieldName>
91 <add>1.8</add>
92 <drop>2.0</drop>
93 </index>
94 <field>
95 <name>casetag3_id</name>
96 <type>varchar</type>
97 <length>128</length>
98 <required>true</required>
99 <comment>Id of third case category.</comment>
100 <add>1.8</add>
101 <drop>2.0</drop>
102 </field>
103 <index>
104 <name>index_casetag3_id</name>
105 <fieldName>casetag3_id</fieldName>
106 <add>1.8</add>
107 <drop>2.0</drop>
108 </index>
109 <field>
110 <name>subject</name>
111 <type>varchar</type>
112 <length>128</length>
113 <title>Case Subject</title>
114 <import>true</import>
115 <uniqueName>case_subject</uniqueName>
116 <comment>Short name of the case.</comment>
117 <html>
118 <type>Text</type>
119 </html>
120 <add>1.8</add>
121 </field>
122 <field>
123 <name>start_date</name>
124 <uniqueName>case_start_date</uniqueName>
125 <title>Case Start Date</title>
126 <import>true</import>
127 <type>date</type>
128 <comment>Date on which given case starts.</comment>
129 <html>
130 <type>Select Date</type>
131 </html>
132 <add>1.8</add>
133 </field>
134 <field>
135 <name>end_date</name>
136 <uniqueName>case_end_date</uniqueName>
137 <title>Case End Date</title>
138 <import>true</import>
139 <type>date</type>
140 <comment>Date on which given case ends.</comment>
141 <html>
142 <type>Select Date</type>
143 </html>
144 <add>1.8</add>
145 </field>
146 <field>
147 <name>details</name>
148 <type>text</type>
149 <html>
150 <type>TextArea</type>
151 <rows>8</rows>
152 <cols>60</cols>
153 </html>
154 <comment>Details about the meeting (agenda, notes, etc).</comment>
155 <add>1.8</add>
156 </field>
157 <field>
158 <name>status_id</name>
159 <type>int unsigned</type>
160 <uniqueName>case_status_id</uniqueName>
161 <required>true</required>
162 <import>true</import>
163 <export>false</export>
164 <title>Case Status</title>
165 <comment>Id of case status.</comment>
166 <pseudoconstant>
167 <optionGroupName>case_status</optionGroupName>
168 </pseudoconstant>
169 <html>
170 <type>Select</type>
171 </html>
172 <add>1.8</add>
173 </field>
174 <field>
175 <name>is_deleted</name>
176 <title>Case is in the Trash</title>
177 <uniqueName>case_deleted</uniqueName>
178 <type>boolean</type>
179 <default>0</default>
180 <import>true</import>
181 <title>Case Deleted</title>
182 <add>2.2</add>
183 </field>
184 <index>
185 <name>index_is_deleted</name>
186 <fieldName>is_deleted</fieldName>
187 <add>2.2</add>
188 </index>
189 </table>