Merge pull request #4124 from tohojo/adv-search-fix
[civicrm-core.git] / xml / schema / Contribute / ContributionProduct.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contribute</base>
5 <class>ContributionProduct</class>
6 <name>civicrm_contribution_product</name>
7 <add>1.4</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <required>true</required>
13 <add>1.4</add>
14 </field>
15 <primaryKey>
16 <name>id</name>
17 <autoincrement>true</autoincrement>
18 </primaryKey>
19 <field>
20 <name>product_id</name>
21 <type>int unsigned</type>
22 <required>true</required>
23 <add>1.4</add>
24 </field>
25 <field>
26 <name>contribution_id</name>
27 <type>int unsigned</type>
28 <required>true</required>
29 <add>1.4</add>
30 </field>
31 <foreignKey>
32 <name>contribution_id</name>
33 <table>civicrm_contribution</table>
34 <key>id</key>
35 <add>1.4</add>
36 <onDelete>CASCADE</onDelete>
37 </foreignKey>
38 <field>
39 <name>product_option</name>
40 <title>Product Option</title>
41 <type>varchar</type>
42 <length>255</length>
43 <export>true</export>
44 <comment>Option value selected if applicable - e.g. color, size etc.</comment>
45 <add>1.4</add>
46 </field>
47 <field>
48 <name>quantity</name>
49 <title>Quantity</title>
50 <type>int</type>
51 <value>1</value>
52 <export>true</export>
53 <comment></comment>
54 <add>1.4</add>
55 </field>
56 <field>
57 <name>total_cost</name>
58 <type>decimal</type>
59 <required>true</required>
60 <import>true</import>
61 <headerPattern>/^total|(.?^am(ou)?nt)/i</headerPattern>
62 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
63 <comment>quantity X civicrm_product.cost.</comment>
64 <add>1.3</add>
65 <drop>4.1</drop>
66 </field>
67 <field>
68 <name>fulfilled_date</name>
69 <type>date</type>
70 <export>true</export>
71 <comment>Optional. Can be used to record the date this product was fulfilled or shipped.</comment>
72 <add>1.4</add>
73 </field>
74 <field>
75 <name>start_date</name>
76 <uniqueName>contribution_start_date</uniqueName>
77 <type>date</type>
78 <export>true</export>
79 <comment>Actual start date for a time-delimited premium (subscription, service or membership)</comment>
80 <add>1.4</add>
81 </field>
82 <field>
83 <name>end_date</name>
84 <uniqueName>contribution_end_date</uniqueName>
85 <type>date</type>
86 <export>true</export>
87 <comment>Actual end date for a time-delimited premium (subscription, service or membership)</comment>
88 <add>1.4</add>
89 </field>
90 <field>
91 <name>comment</name>
92 <type>text</type>
93 <add>1.4</add>
94 </field>
95 <field>
96 <name>financial_type_id</name>
97 <title>Financial Type</title>
98 <type>int unsigned</type>
99 <default>NULL</default>
100 <pseudoconstant>
101 <table>civicrm_financial_type</table>
102 <keyColumn>id</keyColumn>
103 <labelColumn>name</labelColumn>
104 </pseudoconstant>
105 <comment>FK to Financial Type(for membership price sets only).</comment>
106 <add>4.3</add>
107 </field>
108 <foreignKey>
109 <name>financial_type_id</name>
110 <table>civicrm_financial_type</table>
111 <key>id</key>
112 <onDelete>SET NULL</onDelete>
113 <add>4.3</add>
114 </foreignKey>
115 </table>