Merge pull request #12647 from compucorp/fix-case-type-issues
[civicrm-core.git] / xml / schema / Case / Case.xml
CommitLineData
6a488035
TO
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>
8f069c03
EM
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>
6a488035
TO
18 </field>
19 <primaryKey>
8f069c03
EM
20 <name>id</name>
21 <autoincrement>true</autoincrement>
6a488035
TO
22 </primaryKey>
23 <field>
8f069c03
EM
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>
6a488035
TO
31 </field>
32 <foreignKey>
8f069c03
EM
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>
3c7d2158 39 </foreignKey>
6a488035 40 <field>
8f069c03
EM
41 <name>case_type_id</name>
42 <type>int unsigned</type>
43 <import>true</import>
44 <export>false</export>
45 <title>Case Type</title>
60a5e820 46 <required>true</required>
8f069c03
EM
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>
6a488035
TO
57 </field>
58 <index>
8f069c03
EM
59 <name>index_case_type_id</name>
60 <fieldName>case_type_id</fieldName>
61 <add>2.0</add>
6a488035 62 </index>
fc9e7e51 63 <foreignKey>
8f069c03
EM
64 <name>case_type_id</name>
65 <table>civicrm_case_type</table>
66 <key>id</key>
67 <add>4.5</add>
fc9e7e51 68 </foreignKey>
6a488035 69 <field>
8f069c03
EM
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>
6a488035
TO
77 </field>
78 <index>
8f069c03
EM
79 <name>index_casetag1_id</name>
80 <fieldName>casetag1_id</fieldName>
81 <add>1.8</add>
82 <drop>2.0</drop>
6a488035
TO
83 </index>
84 <field>
8f069c03
EM
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>
6a488035
TO
92 </field>
93 <index>
8f069c03
EM
94 <name>index_casetag2_id</name>
95 <fieldName>casetag2_id</fieldName>
96 <add>1.8</add>
97 <drop>2.0</drop>
6a488035
TO
98 </index>
99 <field>
8f069c03
EM
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>
6a488035
TO
107 </field>
108 <index>
8f069c03
EM
109 <name>index_casetag3_id</name>
110 <fieldName>casetag3_id</fieldName>
111 <add>1.8</add>
112 <drop>2.0</drop>
6a488035
TO
113 </index>
114 <field>
8f069c03
EM
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>
6a488035 126 </field>
8f069c03
EM
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>
e0d4ddde 136 <formatType>activityDateTime</formatType>
8f069c03
EM
137 </html>
138 <add>1.8</add>
6a488035
TO
139 </field>
140 <field>
8f069c03
EM
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>
e0d4ddde 149 <formatType>activityDateTime</formatType>
8f069c03
EM
150 </html>
151 <add>1.8</add>
6a488035
TO
152 </field>
153 <field>
8f069c03
EM
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>
6a488035
TO
163 </field>
164 <field>
8f069c03
EM
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>
6a488035
TO
180 </field>
181 <field>
8f069c03
EM
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>
6a488035
TO
190 </field>
191 <index>
8f069c03
EM
192 <name>index_is_deleted</name>
193 <fieldName>is_deleted</fieldName>
194 <add>2.2</add>
3c7d2158 195 </index>
3ed77291
TO
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>
6a488035 216</table>