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