CRM-14078 - 'Payment Instrument' -> 'Payment Method'
[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>
e0991796 58 <type>Select</type>
614d72ec 59 </html>
6a488035
TO
60 </field>
61 <field>
62 <name>frequency_unit</name>
797b807e 63 <title>Frequency Unit</title>
dc73c80d 64 <type>varchar</type>
65 <length>8</length>
6a488035
TO
66 <default>'month'</default>
67 <comment>Time units for recurrence of payment.</comment>
f80ce889 68 <pseudoconstant>
69 <optionGroupName>recur_frequency_units</optionGroupName>
70 <keyColumn>name</keyColumn>
71 </pseudoconstant>
6a488035 72 <add>1.6</add>
614d72ec 73 <html>
74 <type>Select</type>
75 </html>
6a488035
TO
76 </field>
77 <field>
78 <name>frequency_interval</name>
797b807e 79 <title>Interval (number of units)</title>
6a488035
TO
80 <type>int unsigned</type>
81 <required>true</required>
82 <comment>Number of time units for recurrence of payment.</comment>
83 <add>1.6</add>
84 </field>
85 <field>
86 <name>installments</name>
797b807e 87 <title>Number of Installments</title>
6a488035
TO
88 <type>int unsigned</type>
89 <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>
90 <add>1.6</add>
91 </field>
92 <field>
93 <name>start_date</name>
797b807e 94 <title>Recurring Contribution Started Date</title>
6a488035
TO
95 <type>datetime</type>
96 <required>true</required>
97 <comment>The date the first scheduled recurring contribution occurs.</comment>
98 <add>1.6</add>
99 </field>
100 <field>
101 <name>create_date</name>
797b807e 102 <title>Recurring Contribution Created Date</title>
6a488035
TO
103 <type>datetime</type>
104 <required>true</required>
105 <comment>When this recurring contribution record was created.</comment>
106 <add>1.6</add>
107 </field>
108 <field>
109 <name>modified_date</name>
797b807e 110 <title>Recurring Contribution Modified Date</title>
6a488035
TO
111 <type>datetime</type>
112 <comment>Last updated date for this record. mostly the last time a payment was received</comment>
113 <add>1.6</add>
114 </field>
115 <field>
116 <name>cancel_date</name>
797b807e 117 <title>Recurring Contribution Cancel Date</title>
6a488035
TO
118 <type>datetime</type>
119 <comment>Date this recurring contribution was cancelled by contributor- if we can get access to it</comment>
120 <add>1.6</add>
121 </field>
122 <field>
123 <name>end_date</name>
797b807e 124 <title>Recurring Contribution End Date</title>
6a488035
TO
125 <type>datetime</type>
126 <comment>Date this recurring contribution finished successfully</comment>
127 <add>1.6</add>
128 </field>
6d68a4cb 129 <field>
6a488035 130 <name>processor_id</name>
799e1e59 131 <title>Processor ID</title>
6d68a4cb 132 <type>varchar</type>
6a488035 133 <length>255</length>
6d68a4cb
CW
134 <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
135 <add>1.6</add>
136 </field>
011293bb
RT
137 <field>
138 <name>payment_token_id</name>
139 <title>Payment Token ID</title>
140 <type>int unsigned</type>
141 <comment>Optionally used to store a link to a payment token used for this recurring contribution.</comment>
142 <add>4.6</add>
143 </field>
144 <foreignKey>
145 <name>payment_token_id</name>
146 <table>civicrm_payment_token</table>
147 <key>id</key>
148 <add>4.6</add>
149 <onDelete>SET NULL</onDelete>
150 </foreignKey>
6d68a4cb
CW
151 <field>
152 <name>trxn_id</name>
6a488035 153 <title>Transaction ID</title>
6d68a4cb
CW
154 <type>varchar</type>
155 <length>255</length>
6a488035 156 <comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
6d68a4cb
CW
157 <add>1.6</add>
158 </field>
159 <field>
160 <name>invoice_id</name>
6a488035 161 <title>Invoice ID</title>
6d68a4cb
CW
162 <type>varchar</type>
163 <length>255</length>
6a488035 164 <comment>unique invoice id, system generated or passed in</comment>
6d68a4cb
CW
165 <add>1.6</add>
166 </field>
6a488035
TO
167 <index>
168 <name>UI_contrib_trxn_id</name>
169 <fieldName>trxn_id</fieldName>
170 <unique>true</unique>
171 <add>2.1</add>
172 </index>
173 <index>
174 <name>UI_contrib_invoice_id</name>
175 <fieldName>invoice_id</fieldName>
176 <unique>true</unique>
177 <add>2.1</add>
178 </index>
179 <field>
180 <name>contribution_status_id</name>
181 <title>Recurring Contribution Status</title>
182 <type>int unsigned</type>
183 <default>1</default>
184 <import>true</import>
185 <add>1.6</add>
f389e500
E
186 <pseudoconstant>
187 <optionGroupName>contribution_status</optionGroupName>
188 </pseudoconstant>
6a488035
TO
189 </field>
190 <index>
191 <name>index_contribution_status</name>
192 <fieldName>contribution_status_id</fieldName>
193 <add>1.6</add>
194 </index>
6d68a4cb
CW
195 <field>
196 <name>is_test</name>
6a488035
TO
197 <title>Test</title>
198 <type>boolean</type>
199 <default>0</default>
200 <import>true</import>
201 </field>
202 <field>
203 <name>cycle_day</name>
797b807e 204 <title>Number of Cycle Day</title>
6a488035
TO
205 <type>int unsigned</type>
206 <default>1</default>
207 <required>true</required>
208 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
209 <add>1.6</add>
210 </field>
211 <field>
212 <name>next_sched_contribution</name>
213 <type>datetime</type>
5beb1de0 214 <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 215 <add>1.6</add>
797b807e 216 <drop>4.4</drop>
217 </field>
218 <field>
219 <name>next_sched_contribution_date</name>
220 <title>Next Scheduled Contribution Date</title>
221 <type>datetime</type>
222 <comment>Next scheduled date</comment>
223 <add>4.4</add>
6a488035
TO
224 </field>
225 <field>
226 <name>failure_count</name>
797b807e 227 <title>Number of Failures</title>
6a488035
TO
228 <type>int unsigned</type>
229 <default>0</default>
230 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
231 <add>1.6</add>
232 </field>
233 <field>
234 <name>failure_retry_date</name>
235 <type>datetime</type>
797b807e 236 <title>Retry Failed Attempt Date</title>
237 <comment>Date to retry failed attempt</comment>
6a488035
TO
238 <add>1.6</add>
239 </field>
6d68a4cb 240 <field>
6a488035 241 <name>auto_renew</name>
797b807e 242 <title>Auto Renew</title>
6d68a4cb
CW
243 <type>boolean</type>
244 <required>true</required>
6a488035 245 <default>0</default>
6d68a4cb
CW
246 <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>
247 <add>1.6</add>
6a488035
TO
248 </field>
249 <field>
250 <name>payment_processor_id</name>
797b807e 251 <title>Payment Processor</title>
6a488035
TO
252 <type>int unsigned</type>
253 <comment>Foreign key to civicrm_payment_processor.id</comment>
254 <add>3.3</add>
255 </field>
6d68a4cb
CW
256 <foreignKey>
257 <name>payment_processor_id</name>
258 <table>civicrm_payment_processor</table>
259 <key>id</key>
260 <add>3.3</add>
6a488035
TO
261 <onDelete>SET NULL</onDelete>
262 </foreignKey>
263 <field>
264 <name>contribution_type_id</name>
265 <title>Contribution Type</title>
266 <export>false</export>
267 <type>int unsigned</type>
268 <comment>FK to Contribution Type</comment>
269 <add>4.1</add>
270 <drop>4.3</drop>
271 </field>
272 <foreignKey>
273 <name>contribution_type_id</name>
274 <table>civicrm_contribution_type</table>
275 <key>id</key>
276 <add>4.1</add>
277 <drop>4.3</drop>
278 <onDelete>SET NULL</onDelete>
279 </foreignKey>
280 <field>
281 <name>financial_type_id</name>
282 <title>Financial Type</title>
283 <export>false</export>
284 <type>int unsigned</type>
285 <comment>FK to Financial Type</comment>
286 <add>4.3</add>
f389e500
E
287 <pseudoconstant>
288 <table>civicrm_financial_type</table>
289 <keyColumn>id</keyColumn>
290 <labelColumn>name</labelColumn>
291 </pseudoconstant>
6a488035
TO
292 </field>
293 <foreignKey>
294 <name>financial_type_id</name>
295 <table>civicrm_financial_type</table>
296 <key>id</key>
297 <add>4.3</add>
298 <onDelete>SET NULL</onDelete>
299 </foreignKey>
300 <field>
301 <name>payment_instrument_id</name>
536f0e02 302 <title>Payment Method</title>
6a488035
TO
303 <type>int unsigned</type>
304 <comment>FK to Payment Instrument</comment>
6d68a4cb
CW
305 <pseudoconstant>
306 <optionGroupName>payment_instrument</optionGroupName>
307 </pseudoconstant>
614d72ec 308 <html>
e0991796 309 <type>Select</type>
614d72ec 310 </html>
6a488035
TO
311 <add>4.1</add>
312 </field>
313 <index>
5beb1de0 314 <name>UI_contribution_recur_payment_instrument_id</name>
6a488035
TO
315 <fieldName>payment_instrument_id</fieldName>
316 <add>4.1</add>
317 </index>
318 <field>
319 <name>campaign_id</name>
320 <uniqueName>contribution_campaign_id</uniqueName>
321 <type>int unsigned</type>
e1ab2e91 322 <title>Campaign</title>
6a488035
TO
323 <import>true</import>
324 <comment>The campaign for which this contribution has been triggered.</comment>
3e3eacd0
CW
325 <pseudoconstant>
326 <table>civicrm_campaign</table>
327 <keyColumn>id</keyColumn>
328 <labelColumn>title</labelColumn>
3e3eacd0 329 </pseudoconstant>
6a488035
TO
330 <add>4.1</add>
331 </field>
332 <foreignKey>
333 <name>campaign_id</name>
334 <table>civicrm_campaign</table>
335 <key>id</key>
336 <onDelete>SET NULL</onDelete>
337 </foreignKey>
6d68a4cb
CW
338 <field>
339 <name>is_email_receipt</name>
797b807e 340 <title>Send email Receipt?</title>
6d68a4cb
CW
341 <type>boolean</type>
342 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
6a488035 343 <default>1</default>
6d68a4cb
CW
344 <add>4.1</add>
345 </field>
6a488035 346</table>