dev/core#230 : set mapping id null on delete action
[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 <add>1.1</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>false</autoincrement>
20 </primaryKey>
21 <field>
22 <name>query</name>
23 <title>SQL Query</title>
24 <type>text</type>
25 <import>true</import>
26 <comment>SQL query for this search</comment>
27 <add>1.1</add>
28 <drop>1.5</drop>
29 </field>
30 <field>
31 <name>form_values</name>
32 <title>Submitted Form Values</title>
33 <type>text</type>
34 <import>true</import>
35 <comment>Submitted form values for this search</comment>
36 <serialize>PHP</serialize>
37 <add>1.1</add>
38 </field>
39 <field>
40 <name>is_active</name>
41 <type>boolean</type>
42 <title>Saved Search Enabled</title>
43 <comment>Is this entry active?</comment>
44 <add>1.1</add>
45 <drop>1.5</drop>
46 </field>
47 <field>
48 <name>mapping_id</name>
49 <type>int unsigned</type>
50 <title>Mapping ID</title>
51 <comment>Foreign key to civicrm_mapping used for saved search-builder searches.</comment>
52 <add>1.5</add>
53 </field>
54 <foreignKey>
55 <name>mapping_id</name>
56 <table>civicrm_mapping</table>
57 <key>id</key>
58 <onDelete>SET NULL</onDelete>
59 <add>1.5</add>
60 </foreignKey>
61 <field>
62 <name>search_custom_id</name>
63 <type>int unsigned</type>
64 <title>Option Value ID</title>
65 <comment>Foreign key to civicrm_option value table used for saved custom searches.</comment>
66 <add>2.0</add>
67 </field>
68 <field>
69 <name>where_clause</name>
70 <type>text</type>
71 <title>Where Clause</title>
72 <comment>the sql where clause if a saved search acl</comment>
73 <add>1.6</add>
74 </field>
75 <field>
76 <name>select_tables</name>
77 <type>text</type>
78 <title>Select Tables</title>
79 <comment>the tables to be included in a select data</comment>
80 <serialize>PHP</serialize>
81 <add>1.6</add>
82 </field>
83 <field>
84 <name>where_tables</name>
85 <type>text</type>
86 <title>Where Tables</title>
87 <comment>the tables to be included in the count statement</comment>
88 <serialize>PHP</serialize>
89 <add>1.6</add>
90 </field>
91 </table>