Merge pull request #1 from civicrm/master
[civicrm-core.git] / xml / schema / Contribute / Product.xml
CommitLineData
3c7d2158 1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Contribute</base>
6a488035
TO
5 <class>Product</class>
6 <comment>able - stores "product info" for premiums and can be used for non-incentive products </comment>
3c7d2158 7 <name>civicrm_product</name>
8 <add>1.4</add>
6a488035 9 <log>true</log>
3c7d2158 10 <field>
455cfd16 11 <name>id</name>
0d94665e 12 <title>Product ID</title>
455cfd16
EM
13 <type>int unsigned</type>
14 <required>true</required>
15 <add>1.4</add>
3c7d2158 16 </field>
17 <primaryKey>
455cfd16
EM
18 <name>id</name>
19 <autoincrement>true</autoincrement>
6a488035
TO
20 </primaryKey>
21 <field>
455cfd16
EM
22 <name>name</name>
23 <uniqueName>product_name</uniqueName>
24 <title>Product Name</title>
25 <type>varchar</type>
26 <length>255</length>
27 <required>true</required>
28 <export>true</export>
29 <localizable>true</localizable>
30 <comment>Required product/premium name</comment>
31 <add>1.4</add>
32 </field>
33 <field>
34 <name>description</name>
35 <title>Description</title>
36 <type>text</type>
37 <localizable>true</localizable>
38 <comment>Optional description of the product/premium.</comment>
39 <add>1.4</add>
40 </field>
41 <field>
42 <name>sku</name>
43 <title>SKU</title>
44 <type>varchar</type>
45 <length>50</length>
46 <export>true</export>
47 <comment>Optional product sku or code.</comment>
48 <add>1.4</add>
49 </field>
50 <field>
51 <name>options</name>
52 <title>Options</title>
53 <type>text</type>
54 <localizable>true</localizable>
55 <comment>Store comma-delimited list of color, size, etc. options for the product.</comment>
56 <add>1.4</add>
57 </field>
58 <field>
59 <name>image</name>
60 <title>Image</title>
61 <type>varchar</type>
62 <length>255</length>
63 <comment>Full or relative URL to uploaded image - fullsize.</comment>
64 <add>1.4</add>
65 </field>
66 <field>
67 <name>thumbnail</name>
68 <title>Thumbnail</title>
69 <type>varchar</type>
70 <length>255</length>
71 <comment>Full or relative URL to image thumbnail.</comment>
72 <add>1.4</add>
73 </field>
74 <field>
75 <name>price</name>
76 <title>Price</title>
77 <type>decimal</type>
78 <comment>Sell price or market value for premiums. For tax-deductible contributions, this will be stored as non_deductible_amount in the contribution record.</comment>
79 <add>1.4</add>
80 </field>
81 <field>
82 <name>currency</name>
83 <type>varchar</type>
84 <length>3</length>
85 <default>NULL</default>
86 <comment>3 character string, value from config setting or input via user.</comment>
87 <add>3.2</add>
88 <pseudoconstant>
89 <table>civicrm_currency</table>
90 <keyColumn>name</keyColumn>
91 <labelColumn>full_name</labelColumn>
c3de5c5a 92 <nameColumn>name</nameColumn>
a8fdb24e 93 <abbrColumn>symbol</abbrColumn>
455cfd16
EM
94 </pseudoconstant>
95 <html>
96 <type>Select</type>
97 </html>
98 </field>
99 <field>
100 <name>financial_type_id</name>
101 <title>Financial Type</title>
102 <type>int unsigned</type>
103 <default>NULL</default>
104 <pseudoconstant>
105 <table>civicrm_financial_type</table>
106 <keyColumn>id</keyColumn>
107 <labelColumn>name</labelColumn>
108 </pseudoconstant>
109 <comment>FK to Financial Type.</comment>
110 <add>4.3</add>
3c7d2158 111 </field>
112 <foreignKey>
455cfd16
EM
113 <name>financial_type_id</name>
114 <table>civicrm_financial_type</table>
115 <key>id</key>
116 <onDelete>SET NULL</onDelete>
117 <add>4.3</add>
3c7d2158 118 </foreignKey>
119
120 <field>
455cfd16
EM
121 <name>min_contribution</name>
122 <title>Minimum Contribution</title>
123 <type>decimal</type>
124 <comment>Minimum contribution required to be eligible to select this premium.</comment>
125 <add>1.4</add>
126 </field>
127 <field>
128 <name>cost</name>
129 <title>Cost</title>
130 <type>decimal</type>
131 <comment>Actual cost of this product. Useful to determine net return from sale or using this as an incentive.</comment>
132 <add>1.4</add>
133 </field>
134 <field>
135 <name>is_active</name>
136 <title>Is Active</title>
137 <type>boolean</type>
138 <required>true</required>
139 <comment>Disabling premium removes it from the premiums_premium join table below.</comment>
140 <add>1.4</add>
141 </field>
142 <field>
143 <name>period_type</name>
144 <title>Period Type</title>
145 <type>varchar</type>
146 <length>8</length>
147 <default>'rolling'</default>
148 <comment>Rolling means we set start/end based on current day, fixed means we set start/end for current year or month
149 (e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) </comment>
150 <pseudoconstant>
151 <callback>CRM_Core_SelectValues::periodType</callback>
152 </pseudoconstant>
153 <add>1.4</add>
154 <html>
155 <type>Select</type>
156 </html>
157 </field>
158 <field>
159 <name>fixed_period_start_day</name>
160 <title>Fixed Period Start Day</title>
161 <type>int</type>
162 <default>0101</default>
163 <comment>Month and day (MMDD) that fixed period type subscription or membership starts.</comment>
164 <add>1.4</add>
165 </field>
166 <field>
167 <name>duration_unit</name>
168 <title>Duration Unit</title>
169 <type>varchar</type>
170 <length>8</length>
171 <default>'year'</default>
172 <pseudoconstant>
173 <callback>CRM_Core_SelectValues::getPremiumUnits</callback>
174 </pseudoconstant>
175 <add>1.4</add>
176 <html>
177 <type>Select</type>
178 </html>
179 </field>
180 <field>
181 <name>duration_interval</name>
182 <title>Duration Interval</title>
183 <type>int</type>
184 <comment>Number of units for total duration of subscription, service, membership (e.g. 12 Months).</comment>
185 <add>1.4</add>
186 </field>
187 <field>
188 <name>frequency_unit</name>
189 <title>Frequency Unit</title>
190 <type>varchar</type>
191 <length>8</length>
192 <default>'month'</default>
193 <comment>Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.</comment>
194 <pseudoconstant>
195 <callback>CRM_Core_SelectValues::getPremiumUnits</callback>
196 </pseudoconstant>
197 <add>1.4</add>
198 <html>
199 <type>Select</type>
200 </html>
201 </field>
202 <field>
203 <name>frequency_interval</name>
204 <title>Frequency Interval</title>
205 <type>int</type>
206 <comment>Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).</comment>
207 <add>1.4</add>
6a488035
TO
208 </field>
209</table>