Revert "Schema - Fix boolean fields in various tables"
[civicrm-core.git] / xml / schema / Contact / SavedSearch.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>SavedSearch</class>
6 <name>civicrm_saved_search</name>
7 <comment>Users can save their complex SQL queries and use them later.</comment>
8 <add>1.1</add>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <title>Saved Search ID</title>
13 <required>true</required>
14 <comment>Saved Search ID</comment>
15 <html>
16 <type>Number</type>
17 </html>
18 <add>1.1</add>
19 </field>
20 <primaryKey>
21 <name>id</name>
22 <autoincrement>false</autoincrement>
23 </primaryKey>
24
25 <field>
26 <name>name</name>
27 <title>Saved Search Name</title>
28 <type>varchar</type>
29 <length>255</length>
30 <default>NULL</default>
31 <comment>Unique name of saved search</comment>
32 <html>
33 <type>Text</type>
34 </html>
35 <add>1.0</add>
36 </field>
37 <index>
38 <name>UI_name</name>
39 <fieldName>name</fieldName>
40 <unique>true</unique>
41 <add>5.32</add>
42 </index>
43
44 <field>
45 <name>label</name>
46 <title>Saved Search Label</title>
47 <type>varchar</type>
48 <length>255</length>
49 <default>NULL</default>
50 <comment>Administrative label for search</comment>
51 <html>
52 <label>Label</label>
53 <type>Text</type>
54 </html>
55 <add>5.32</add>
56 </field>
57
58 <field>
59 <name>form_values</name>
60 <title>Submitted Form Values</title>
61 <type>text</type>
62 <import>true</import>
63 <comment>Submitted form values for this search</comment>
64 <serialize>PHP</serialize>
65 <add>1.1</add>
66 </field>
67
68 <field>
69 <name>mapping_id</name>
70 <type>int unsigned</type>
71 <title>Mapping ID</title>
72 <comment>Foreign key to civicrm_mapping used for saved search-builder searches.</comment>
73 <html>
74 <label>Mapping</label>
75 </html>
76 <add>1.5</add>
77 </field>
78 <foreignKey>
79 <name>mapping_id</name>
80 <table>civicrm_mapping</table>
81 <key>id</key>
82 <onDelete>SET NULL</onDelete>
83 <add>1.5</add>
84 </foreignKey>
85
86 <field>
87 <name>search_custom_id</name>
88 <type>int unsigned</type>
89 <title>Option Value ID</title>
90 <comment>Foreign key to civicrm_option value table used for saved custom searches.</comment>
91 <add>2.0</add>
92 </field>
93
94 <field>
95 <name>where_clause</name>
96 <type>text</type>
97 <title>Where Clause</title>
98 <comment>the sql where clause if a saved search acl</comment>
99 <add>1.6</add>
100 <drop>5.24</drop>
101 </field>
102
103 <field>
104 <name>select_tables</name>
105 <type>text</type>
106 <title>Select Tables</title>
107 <comment>the tables to be included in a select data</comment>
108 <serialize>PHP</serialize>
109 <add>1.6</add>
110 <drop>5.24</drop>
111 </field>
112
113 <field>
114 <name>where_tables</name>
115 <type>text</type>
116 <title>Where Tables</title>
117 <comment>the tables to be included in the count statement</comment>
118 <serialize>PHP</serialize>
119 <add>1.6</add>
120 <drop>5.24</drop>
121 </field>
122
123 <field>
124 <name>api_entity</name>
125 <type>varchar</type>
126 <title>Entity Name</title>
127 <length>255</length>
128 <comment>Entity name for API based search</comment>
129 <add>5.24</add>
130 <pseudoconstant>
131 <callback>CRM_Contact_BAO_SavedSearch::getApiEntityOptions</callback>
132 </pseudoconstant>
133 </field>
134
135 <field>
136 <name>api_params</name>
137 <type>text</type>
138 <title>API Parameters</title>
139 <comment>Parameters for API based search</comment>
140 <serialize>JSON</serialize>
141 <add>5.24</add>
142 </field>
143 <field>
144 <name>created_id</name>
145 <type>int unsigned</type>
146 <title>Created By Contact ID</title>
147 <comment>FK to contact table.</comment>
148 <html>
149 <label>Created By</label>
150 </html>
151 <readonly>true</readonly>
152 <add>5.36</add>
153 </field>
154 <foreignKey>
155 <name>created_id</name>
156 <table>civicrm_contact</table>
157 <key>id</key>
158 <add>5.36</add>
159 <onDelete>SET NULL</onDelete>
160 </foreignKey>
161 <field>
162 <name>modified_id</name>
163 <type>int unsigned</type>
164 <title>Modified By Contact ID</title>
165 <comment>FK to contact table.</comment>
166 <html>
167 <label>Modified By</label>
168 </html>
169 <readonly>true</readonly>
170 <add>5.36</add>
171 </field>
172 <foreignKey>
173 <name>modified_id</name>
174 <table>civicrm_contact</table>
175 <key>id</key>
176 <add>5.36</add>
177 <onDelete>SET NULL</onDelete>
178 </foreignKey>
179 <field>
180 <name>expires_date</name>
181 <type>timestamp</type>
182 <title>Search Expiry Date</title>
183 <required>false</required>
184 <comment>Optional date after which the search is not needed</comment>
185 <add>5.36</add>
186 </field>
187 <field>
188 <name>created_date</name>
189 <type>timestamp</type>
190 <comment>When the search was created.</comment>
191 <required>true</required>
192 <default>CURRENT_TIMESTAMP</default>
193 <readonly>true</readonly>
194 <add>5.36</add>
195 </field>
196 <field>
197 <name>modified_date</name>
198 <type>timestamp</type>
199 <comment>When the search was last modified.</comment>
200 <required>true</required>
201 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
202 <add>5.36</add>
203 <readonly>true</readonly>
204 </field>
205 <field>
206 <name>description</name>
207 <type>text</type>
208 <title>Saved Search Description</title>
209 <html>
210 <type>TextArea</type>
211 <rows>2</rows>
212 <cols>60</cols>
213 </html>
214 <add>5.36</add>
215 </field>
216 </table>