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