CRM-13497 - getting there on main tables
[civicrm-core.git] / xml / schema / Contribute / ContributionRecur.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Contribute</base>
4 <class>ContributionRecur</class>
5 <name>civicrm_contribution_recur</name>
6 <add>1.6</add>
7 <log>true</log>
8 <field>
9 <name>id</name>
797b807e 10 <title>Recurring Contribution ID</title>
6a488035
TO
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>Contribution Recur ID</comment>
14 <add>1.6</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>contact_id</name>
797b807e 22 <title>Contact ID</title>
6a488035
TO
23 <type>int unsigned</type>
24 <required>true</required>
25 <comment>Foreign key to civicrm_contact.id .</comment>
26 <add>1.6</add>
27 </field>
28 <foreignKey>
29 <name>contact_id</name>
30 <table>civicrm_contact</table>
31 <key>id</key>
32 <add>1.6</add>
33 <onDelete>CASCADE</onDelete>
34 </foreignKey>
35 <field>
36 <name>amount</name>
797b807e 37 <title>Amount</title>
6a488035
TO
38 <type>decimal</type>
39 <required>true</required>
40 <comment>Amount to be contributed or charged each recurrence.</comment>
41 <add>1.6</add>
42 </field>
43 <field>
44 <name>currency</name>
797b807e 45 <title>Currency</title>
6a488035
TO
46 <type>varchar</type>
47 <length>3</length>
48 <default>NULL</default>
49 <comment>3 character string, value from config setting or input via user.</comment>
50 <add>3.2</add>
bd44e0df
AS
51 <pseudoconstant>
52 <table>civicrm_currency</table>
53 <keyColumn>name</keyColumn>
a38a89fc
CW
54 <labelColumn>full_name</labelColumn>
55 <nameColumn>numeric_code</nameColumn>
bd44e0df 56 </pseudoconstant>
614d72ec 57 <html>
58 <type>Select></type>
59 </html>
6a488035
TO
60 </field>
61 <field>
62 <name>frequency_unit</name>
797b807e 63 <title>Frequency Unit</title>
6d68a4cb 64 <type>enum</type>
6a488035
TO
65 <values>day,week,month,year</values>
66 <default>'month'</default>
67 <comment>Time units for recurrence of payment.</comment>
68 <add>1.6</add>
614d72ec 69 <html>
70 <type>Select</type>
71 </html>
6a488035
TO
72 </field>
73 <field>
74 <name>frequency_interval</name>
797b807e 75 <title>Interval (number of units)</title>
6a488035
TO
76 <type>int unsigned</type>
77 <required>true</required>
78 <comment>Number of time units for recurrence of payment.</comment>
79 <add>1.6</add>
80 </field>
81 <field>
82 <name>installments</name>
797b807e 83 <title>Number of Installments</title>
6a488035
TO
84 <type>int unsigned</type>
85 <comment>Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.</comment>
86 <add>1.6</add>
87 </field>
88 <field>
89 <name>start_date</name>
797b807e 90 <title>Recurring Contribution Started Date</title>
6a488035
TO
91 <type>datetime</type>
92 <required>true</required>
93 <comment>The date the first scheduled recurring contribution occurs.</comment>
94 <add>1.6</add>
95 </field>
96 <field>
97 <name>create_date</name>
797b807e 98 <title>Recurring Contribution Created Date</title>
6a488035
TO
99 <type>datetime</type>
100 <required>true</required>
101 <comment>When this recurring contribution record was created.</comment>
102 <add>1.6</add>
103 </field>
104 <field>
105 <name>modified_date</name>
797b807e 106 <title>Recurring Contribution Modified Date</title>
6a488035
TO
107 <type>datetime</type>
108 <comment>Last updated date for this record. mostly the last time a payment was received</comment>
109 <add>1.6</add>
110 </field>
111 <field>
112 <name>cancel_date</name>
797b807e 113 <title>Recurring Contribution Cancel Date</title>
6a488035
TO
114 <type>datetime</type>
115 <comment>Date this recurring contribution was cancelled by contributor- if we can get access to it</comment>
116 <add>1.6</add>
117 </field>
118 <field>
119 <name>end_date</name>
797b807e 120 <title>Recurring Contribution End Date</title>
6a488035
TO
121 <type>datetime</type>
122 <comment>Date this recurring contribution finished successfully</comment>
123 <add>1.6</add>
124 </field>
6d68a4cb 125 <field>
6a488035 126 <name>processor_id</name>
797b807e 127 <title>Payment Processor</title>
6d68a4cb 128 <type>varchar</type>
6a488035 129 <length>255</length>
6d68a4cb
CW
130 <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
131 <add>1.6</add>
132 </field>
133 <field>
134 <name>trxn_id</name>
6a488035 135 <title>Transaction ID</title>
6d68a4cb
CW
136 <type>varchar</type>
137 <length>255</length>
6a488035 138 <comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
6d68a4cb
CW
139 <add>1.6</add>
140 </field>
141 <field>
142 <name>invoice_id</name>
6a488035 143 <title>Invoice ID</title>
6d68a4cb
CW
144 <type>varchar</type>
145 <length>255</length>
6a488035 146 <comment>unique invoice id, system generated or passed in</comment>
6d68a4cb
CW
147 <add>1.6</add>
148 </field>
6a488035
TO
149 <index>
150 <name>UI_contrib_trxn_id</name>
151 <fieldName>trxn_id</fieldName>
152 <unique>true</unique>
153 <add>2.1</add>
154 </index>
155 <index>
156 <name>UI_contrib_invoice_id</name>
157 <fieldName>invoice_id</fieldName>
158 <unique>true</unique>
159 <add>2.1</add>
160 </index>
161 <field>
162 <name>contribution_status_id</name>
163 <title>Recurring Contribution Status</title>
164 <type>int unsigned</type>
165 <default>1</default>
166 <import>true</import>
167 <add>1.6</add>
168 </field>
169 <index>
170 <name>index_contribution_status</name>
171 <fieldName>contribution_status_id</fieldName>
172 <add>1.6</add>
173 </index>
6d68a4cb
CW
174 <field>
175 <name>is_test</name>
6a488035
TO
176 <title>Test</title>
177 <type>boolean</type>
178 <default>0</default>
179 <import>true</import>
180 </field>
181 <field>
182 <name>cycle_day</name>
797b807e 183 <title>Number of Cycle Day</title>
6a488035
TO
184 <type>int unsigned</type>
185 <default>1</default>
186 <required>true</required>
187 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
188 <add>1.6</add>
189 </field>
190 <field>
191 <name>next_sched_contribution</name>
192 <type>datetime</type>
5beb1de0 193 <comment>At Groundspring this was used by the cron job which triggered payments. If we''re not doing that but we know about payments, it might still be useful to store for display to org andor contributors.</comment>
6a488035 194 <add>1.6</add>
797b807e 195 <drop>4.4</drop>
196 </field>
197 <field>
198 <name>next_sched_contribution_date</name>
199 <title>Next Scheduled Contribution Date</title>
200 <type>datetime</type>
201 <comment>Next scheduled date</comment>
202 <add>4.4</add>
6a488035
TO
203 </field>
204 <field>
205 <name>failure_count</name>
797b807e 206 <title>Number of Failures</title>
6a488035
TO
207 <type>int unsigned</type>
208 <default>0</default>
209 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
210 <add>1.6</add>
211 </field>
212 <field>
213 <name>failure_retry_date</name>
214 <type>datetime</type>
797b807e 215 <title>Retry Failed Attempt Date</title>
216 <comment>Date to retry failed attempt</comment>
6a488035
TO
217 <add>1.6</add>
218 </field>
6d68a4cb 219 <field>
6a488035 220 <name>auto_renew</name>
797b807e 221 <title>Auto Renew</title>
6d68a4cb
CW
222 <type>boolean</type>
223 <required>true</required>
6a488035 224 <default>0</default>
6d68a4cb
CW
225 <comment>Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.</comment>
226 <add>1.6</add>
6a488035
TO
227 </field>
228 <field>
229 <name>payment_processor_id</name>
797b807e 230 <title>Payment Processor</title>
6a488035
TO
231 <type>int unsigned</type>
232 <comment>Foreign key to civicrm_payment_processor.id</comment>
233 <add>3.3</add>
234 </field>
6d68a4cb
CW
235 <foreignKey>
236 <name>payment_processor_id</name>
237 <table>civicrm_payment_processor</table>
238 <key>id</key>
239 <add>3.3</add>
6a488035
TO
240 <onDelete>SET NULL</onDelete>
241 </foreignKey>
242 <field>
243 <name>contribution_type_id</name>
244 <title>Contribution Type</title>
245 <export>false</export>
246 <type>int unsigned</type>
247 <comment>FK to Contribution Type</comment>
248 <add>4.1</add>
249 <drop>4.3</drop>
250 </field>
251 <foreignKey>
252 <name>contribution_type_id</name>
253 <table>civicrm_contribution_type</table>
254 <key>id</key>
255 <add>4.1</add>
256 <drop>4.3</drop>
257 <onDelete>SET NULL</onDelete>
258 </foreignKey>
259 <field>
260 <name>financial_type_id</name>
261 <title>Financial Type</title>
262 <export>false</export>
263 <type>int unsigned</type>
264 <comment>FK to Financial Type</comment>
265 <add>4.3</add>
266 </field>
267 <foreignKey>
268 <name>financial_type_id</name>
269 <table>civicrm_financial_type</table>
270 <key>id</key>
271 <add>4.3</add>
272 <onDelete>SET NULL</onDelete>
273 </foreignKey>
274 <field>
275 <name>payment_instrument_id</name>
276 <title>Payment Instrument</title>
277 <type>int unsigned</type>
278 <comment>FK to Payment Instrument</comment>
6d68a4cb
CW
279 <pseudoconstant>
280 <optionGroupName>payment_instrument</optionGroupName>
281 </pseudoconstant>
614d72ec 282 <html>
283 <type>Select></type>
284 </html>
6a488035
TO
285 <add>4.1</add>
286 </field>
287 <index>
5beb1de0 288 <name>UI_contribution_recur_payment_instrument_id</name>
6a488035
TO
289 <fieldName>payment_instrument_id</fieldName>
290 <add>4.1</add>
291 </index>
292 <field>
293 <name>campaign_id</name>
294 <uniqueName>contribution_campaign_id</uniqueName>
295 <type>int unsigned</type>
296 <title>Campaign ID</title>
297 <import>true</import>
298 <comment>The campaign for which this contribution has been triggered.</comment>
299 <add>4.1</add>
300 </field>
301 <foreignKey>
302 <name>campaign_id</name>
303 <table>civicrm_campaign</table>
304 <key>id</key>
305 <onDelete>SET NULL</onDelete>
306 </foreignKey>
6d68a4cb
CW
307 <field>
308 <name>is_email_receipt</name>
797b807e 309 <title>Send email Receipt?</title>
6d68a4cb
CW
310 <type>boolean</type>
311 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
6a488035 312 <default>1</default>
6d68a4cb
CW
313 <add>4.1</add>
314 </field>
6a488035 315</table>