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