CRM-13810 - Campaign Search - remove data constraint, rename Campaign ID to Campaign...
[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>
f389e500
E
162 <pseudoconstant>
163 <optionGroupName>contribution_status</optionGroupName>
164 </pseudoconstant>
6a488035
TO
165 </field>
166 <index>
167 <name>index_contribution_status</name>
168 <fieldName>contribution_status_id</fieldName>
169 <add>1.6</add>
170 </index>
6d68a4cb
CW
171 <field>
172 <name>is_test</name>
6a488035
TO
173 <title>Test</title>
174 <type>boolean</type>
175 <default>0</default>
176 <import>true</import>
177 </field>
178 <field>
179 <name>cycle_day</name>
797b807e 180 <title>Number of Cycle Day</title>
6a488035
TO
181 <type>int unsigned</type>
182 <default>1</default>
183 <required>true</required>
184 <comment>Day in the period when the payment should be charged e.g. 1st of month, 15th etc.</comment>
185 <add>1.6</add>
186 </field>
187 <field>
188 <name>next_sched_contribution</name>
189 <type>datetime</type>
5beb1de0 190 <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 191 <add>1.6</add>
797b807e 192 <drop>4.4</drop>
193 </field>
194 <field>
195 <name>next_sched_contribution_date</name>
196 <title>Next Scheduled Contribution Date</title>
197 <type>datetime</type>
198 <comment>Next scheduled date</comment>
199 <add>4.4</add>
6a488035
TO
200 </field>
201 <field>
202 <name>failure_count</name>
797b807e 203 <title>Number of Failures</title>
6a488035
TO
204 <type>int unsigned</type>
205 <default>0</default>
206 <comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
207 <add>1.6</add>
208 </field>
209 <field>
210 <name>failure_retry_date</name>
211 <type>datetime</type>
797b807e 212 <title>Retry Failed Attempt Date</title>
213 <comment>Date to retry failed attempt</comment>
6a488035
TO
214 <add>1.6</add>
215 </field>
6d68a4cb 216 <field>
6a488035 217 <name>auto_renew</name>
797b807e 218 <title>Auto Renew</title>
6d68a4cb
CW
219 <type>boolean</type>
220 <required>true</required>
6a488035 221 <default>0</default>
6d68a4cb
CW
222 <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>
223 <add>1.6</add>
6a488035
TO
224 </field>
225 <field>
226 <name>payment_processor_id</name>
797b807e 227 <title>Payment Processor</title>
6a488035
TO
228 <type>int unsigned</type>
229 <comment>Foreign key to civicrm_payment_processor.id</comment>
230 <add>3.3</add>
231 </field>
6d68a4cb
CW
232 <foreignKey>
233 <name>payment_processor_id</name>
234 <table>civicrm_payment_processor</table>
235 <key>id</key>
236 <add>3.3</add>
6a488035
TO
237 <onDelete>SET NULL</onDelete>
238 </foreignKey>
239 <field>
240 <name>contribution_type_id</name>
241 <title>Contribution Type</title>
242 <export>false</export>
243 <type>int unsigned</type>
244 <comment>FK to Contribution Type</comment>
245 <add>4.1</add>
246 <drop>4.3</drop>
247 </field>
248 <foreignKey>
249 <name>contribution_type_id</name>
250 <table>civicrm_contribution_type</table>
251 <key>id</key>
252 <add>4.1</add>
253 <drop>4.3</drop>
254 <onDelete>SET NULL</onDelete>
255 </foreignKey>
256 <field>
257 <name>financial_type_id</name>
258 <title>Financial Type</title>
259 <export>false</export>
260 <type>int unsigned</type>
261 <comment>FK to Financial Type</comment>
262 <add>4.3</add>
f389e500
E
263 <pseudoconstant>
264 <table>civicrm_financial_type</table>
265 <keyColumn>id</keyColumn>
266 <labelColumn>name</labelColumn>
267 </pseudoconstant>
6a488035
TO
268 </field>
269 <foreignKey>
270 <name>financial_type_id</name>
271 <table>civicrm_financial_type</table>
272 <key>id</key>
273 <add>4.3</add>
274 <onDelete>SET NULL</onDelete>
275 </foreignKey>
276 <field>
277 <name>payment_instrument_id</name>
278 <title>Payment Instrument</title>
279 <type>int unsigned</type>
280 <comment>FK to Payment Instrument</comment>
6d68a4cb
CW
281 <pseudoconstant>
282 <optionGroupName>payment_instrument</optionGroupName>
283 </pseudoconstant>
6a488035
TO
284 <add>4.1</add>
285 </field>
286 <index>
5beb1de0 287 <name>UI_contribution_recur_payment_instrument_id</name>
6a488035
TO
288 <fieldName>payment_instrument_id</fieldName>
289 <add>4.1</add>
290 </index>
291 <field>
292 <name>campaign_id</name>
293 <uniqueName>contribution_campaign_id</uniqueName>
294 <type>int unsigned</type>
e1ab2e91 295 <title>Campaign</title>
6a488035
TO
296 <import>true</import>
297 <comment>The campaign for which this contribution has been triggered.</comment>
3e3eacd0
CW
298 <pseudoconstant>
299 <table>civicrm_campaign</table>
300 <keyColumn>id</keyColumn>
301 <labelColumn>title</labelColumn>
3e3eacd0 302 </pseudoconstant>
6a488035
TO
303 <add>4.1</add>
304 </field>
305 <foreignKey>
306 <name>campaign_id</name>
307 <table>civicrm_campaign</table>
308 <key>id</key>
309 <onDelete>SET NULL</onDelete>
310 </foreignKey>
6d68a4cb
CW
311 <field>
312 <name>is_email_receipt</name>
797b807e 313 <title>Send email Receipt?</title>
6d68a4cb
CW
314 <type>boolean</type>
315 <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
6a488035 316 <default>1</default>
6d68a4cb
CW
317 <add>4.1</add>
318 </field>
6a488035 319</table>