Merge pull request #3341 from systopia/CRM-14740
[civicrm-core.git] / xml / schema / Pledge / Pledge.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Pledge</base>
4 <class>Pledge</class>
5 <name>civicrm_pledge</name>
6 <add>2.1</add>
7 <log>true</log>
8 <field>
9 <name>id</name>
10 <uniqueName>pledge_id</uniqueName>
11 <title>Pledge ID</title>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Pledge ID</comment>
15 <import>true</import>
16 <add>2.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>contact_id</name>
24 <uniqueName>pledge_contact_id</uniqueName>
25 <title>Contact ID</title>
26 <import>true</import>
27 <type>int unsigned</type>
28 <required>true</required>
29 <comment>Foreign key to civicrm_contact.id .</comment>
30 <add>2.1</add>
614d72ec 31 <html>
32 <type>Autocomplete-Select</type>
33 </html>
6a488035
TO
34 </field>
35 <foreignKey>
36 <name>contact_id</name>
37 <table>civicrm_contact</table>
38 <key>id</key>
39 <add>2.1</add>
40 <onDelete>CASCADE</onDelete>
41 </foreignKey>
3c7d2158 42 <field>
43 <name>contribution_type_id</name>
6a488035
TO
44 <uniqueName>pledge_contribution_type_id</uniqueName>
45 <export>false</export>
3c7d2158 46 <type>int unsigned</type>
6a488035
TO
47 <comment>FK to Contribution Type. This is propagated to contribution record when pledge payments are made.</comment>
48 <add>2.1</add>
3c7d2158 49 <drop>4.3</drop>
50 </field>
51 <foreignKey>
52 <name>contribution_type_id</name>
53 <table>civicrm_contribution_type</table>
54 <key>id</key>
6a488035 55 <add>2.1</add>
3c7d2158 56 <drop>4.3</drop>
6a488035
TO
57 <onDelete>SET NULL</onDelete>
58 </foreignKey>
3c7d2158 59 <field>
60 <name>financial_type_id</name>
6a488035
TO
61 <title>Type</title>
62 <uniqueName>pledge_financial_type_id</uniqueName>
3c7d2158 63 <type>int unsigned</type>
6a488035 64 <comment>FK to Financial Type</comment>
3c7d2158 65 <add>4.3</add>
614d72ec 66 <html>
67 <type>Select</type>
68 </html>
3c7d2158 69 </field>
70 <foreignKey>
71 <name>financial_type_id</name>
72 <table>civicrm_financial_type</table>
73 <key>id</key>
74 <add>4.3</add>
75 </foreignKey>
76 <field>
6a488035
TO
77 <name>contribution_page_id</name>
78 <uniqueName>pledge_contribution_page_id</uniqueName>
79 <title>Pledge Contribution Page</title>
3c7d2158 80 <type>int unsigned</type>
81 <comment>The Contribution Page which triggered this contribution</comment>
82 <add>2.1</add>
83 </field>
84 <foreignKey>
85 <name>contribution_page_id</name>
86 <table>civicrm_contribution_page</table>
87 <key>id</key>
6a488035
TO
88 <onDelete>SET NULL</onDelete>
89 </foreignKey>
90 <field>
91 <name>amount</name>
3c7d2158 92 <uniqueName>pledge_amount</uniqueName>
6a488035
TO
93 <title>Total Pledged</title>
94 <type>decimal</type>
95 <required>true</required>
96 <import>true</import>
97 <comment>Total pledged amount.</comment>
98 <add>2.1</add>
614d72ec 99 <html>
100 <type>Text</type>
101 </html>
6a488035
TO
102 </field>
103 <field>
104 <name>original_installment_amount</name>
3c7d2158 105 <uniqueName>pledge_original_installment_amount</uniqueName>
6a488035
TO
106 <title>Original Installment Amount</title>
107 <type>decimal</type>
108 <required>true</required>
109 <comment>Original amount for each of the installments.</comment>
110 <add>3.2</add>
614d72ec 111 <html>
112 <type>Text</type>
113 </html>
6a488035
TO
114 </field>
115 <field>
116 <name>currency</name>
117 <type>varchar</type>
118 <title>Pledge Currency</title>
119 <length>3</length>
120 <default>NULL</default>
121 <comment>3 character string, value from config setting or input via user.</comment>
122 <add>3.2</add>
bd44e0df
AS
123 <pseudoconstant>
124 <table>civicrm_currency</table>
125 <keyColumn>name</keyColumn>
a38a89fc
CW
126 <labelColumn>full_name</labelColumn>
127 <nameColumn>numeric_code</nameColumn>
bd44e0df 128 </pseudoconstant>
614d72ec 129 <html>
e0991796 130 <type>Select</type>
614d72ec 131 </html>
6a488035
TO
132 </field>
133 <field>
134 <name>frequency_unit</name>
135 <uniqueName>pledge_frequency_unit</uniqueName>
136 <title>Pledge Frequency Unit</title>
be622aca 137 <type>varchar</type>
138 <length>8</length>
6a488035
TO
139 <default>'month'</default>
140 <comment>Time units for recurrence of pledge payments.</comment>
71a707c3 141 <pseudoconstant>
142 <optionGroupName>recur_frequency_units</optionGroupName>
143 <keyColumn>name</keyColumn>
144 </pseudoconstant>
6a488035 145 <add>2.1</add>
614d72ec 146 <html>
147 <type>Select</type>
148 </html>
6a488035
TO
149 </field>
150 <field>
151 <name>frequency_interval</name>
152 <uniqueName>pledge_frequency_interval</uniqueName>
153 <title>Pledge Frequency Interval</title>
154 <type>int unsigned</type>
155 <required>true</required>
156 <default>1</default>
157 <comment>Number of time units for recurrence of pledge payments.</comment>
158 <add>2.1</add>
614d72ec 159 <html>
160 <type>Text</type>
161 </html>
6a488035
TO
162 </field>
163 <field>
164 <name>frequency_day</name>
165 <type>int unsigned</type>
166 <title>Pledge day</title>
167 <default>3</default>
168 <required>true</required>
169 <comment>Day in the period when the pledge payment is due e.g. 1st of month, 15th etc. Use this to set the scheduled dates for pledge payments.</comment>
170 <add>2.1</add>
614d72ec 171 <html>
172 <type>Select</type>
173 </html>
6a488035
TO
174 </field>
175 <field>
176 <name>installments</name>
177 <type>int unsigned</type>
178 <title>Pledge Number of Installments</title>
179 <default>1</default>
180 <comment>Total number of payments to be made.</comment>
181 <add>2.1</add>
614d72ec 182 <html>
183 <type>Text</type>
184 </html>
6a488035
TO
185 </field>
186 <field>
187 <name>start_date</name>
188 <type>datetime</type>
189 <title>Pledge Start Date</title>
190 <required>true</required>
191 <comment>The date the first scheduled pledge occurs.</comment>
192 <add>2.1</add>
614d72ec 193 <html>
194 <type>Select Date</type>
195 </html>
6a488035
TO
196 </field>
197 <field>
198 <name>create_date</name>
199 <type>datetime</type>
200 <uniqueName>pledge_create_date</uniqueName>
201 <title>Pledge Made</title>
202 <required>true</required>
203 <import>true</import>
204 <comment>When this pledge record was created.</comment>
205 <add>2.1</add>
614d72ec 206 <html>
207 <type>Select Date</type>
208 </html>
6a488035
TO
209 </field>
210 <field>
211 <name>acknowledge_date</name>
212 <type>datetime</type>
213 <title>Pledge Acknowledged</title>
214 <comment>When a pledge acknowledgement message was sent to the contributor.</comment>
215 <add>2.1</add>
614d72ec 216 <html>
217 <type>Select Date</type>
218 </html>
6a488035
TO
219 </field>
220 <field>
221 <name>modified_date</name>
222 <type>datetime</type>
223 <title>Pledge Modified Date</title>
224 <comment>Last updated date for this pledge record.</comment>
225 <add>2.1</add>
226 </field>
227 <field>
228 <name>cancel_date</name>
229 <type>datetime</type>
230 <title>Pledge Cancelled Date</title>
231 <comment>Date this pledge was cancelled by contributor.</comment>
232 <add>2.1</add>
614d72ec 233 <html>
234 <type>Select Date</type>
235 </html>
6a488035
TO
236 </field>
237 <field>
238 <name>end_date</name>
239 <type>datetime</type>
240 <title>Pledge End Date</title>
241 <comment>Date this pledge finished successfully (total pledge payments equal to or greater than pledged amount).</comment>
242 <add>2.1</add>
614d72ec 243 <html>
244 <type>Select Date</type>
245 </html>
6a488035 246 </field>
6a488035
TO
247 <field>
248 <name>max_reminders</name>
249 <title>Maximum Number of Reminders</title>
250 <type>int unsigned</type>
251 <default>1</default>
252 <comment>The maximum number of payment reminders to send for any given payment.</comment>
614d72ec 253 <html>
254 <type>Text</type>
255 </html>
6a488035
TO
256 <add>2.1</add>
257 </field>
258 <field>
259 <name>initial_reminder_day</name>
260 <title>Initial Reminder Day</title>
261 <type>int unsigned</type>
262 <default>5</default>
263 <comment>Send initial reminder this many days prior to the payment due date.</comment>
264 <add>2.1</add>
614d72ec 265 <html>
266 <type>Select</type>
267 </html>
6a488035
TO
268 </field>
269 <field>
270 <name>additional_reminder_day</name>
271 <title>Additional Reminder Days</title>
272 <type>int unsigned</type>
273 <default>5</default>
274 <comment>Send additional reminder this many days after last one sent, up to maximum number of reminders.</comment>
275 <add>2.1</add>
614d72ec 276 <html>
277 <type>Text</type>
278 </html>
6a488035
TO
279 </field>
280 <field>
281 <name>status_id</name>
282 <title>Pledge Status Id</title>
283 <uniqueName>pledge_status_id</uniqueName>
284 <import>true</import>
285 <export>false</export>
286 <type>int unsigned</type>
287 <comment>Implicit foreign key to civicrm_option_values in the contribution_status option group.</comment>
288 <add>2.1</add>
289 </field>
290 <index>
291 <name>index_status</name>
292 <fieldName>status_id</fieldName>
293 <add>2.1</add>
294 </index>
3c7d2158 295 <field>
296 <name>is_test</name>
297 <uniqueName>pledge_is_test</uniqueName>
6a488035
TO
298 <import>true</import>
299 <title>Test</title>
300 <type>boolean</type>
301 <default>0</default>
614d72ec 302 <html>
303 <type>CheckBox</type>
304 </html>
6a488035 305 </field>
3c7d2158 306 <field>
307 <name>campaign_id</name>
6a488035 308 <uniqueName>pledge_campaign_id</uniqueName>
3c7d2158 309 <type>int unsigned</type>
e1ab2e91 310 <title>Campaign</title>
3c7d2158 311 <import>true</import>
312 <comment>The campaign for which this pledge has been initiated.</comment>
3e3eacd0
CW
313 <pseudoconstant>
314 <table>civicrm_campaign</table>
315 <keyColumn>id</keyColumn>
316 <labelColumn>title</labelColumn>
3e3eacd0 317 </pseudoconstant>
3c7d2158 318 <add>3.4</add>
614d72ec 319 <html>
320 <type>Select</type>
321 </html>
3c7d2158 322 </field>
323 <foreignKey>
324 <name>campaign_id</name>
325 <table>civicrm_campaign</table>
326 <key>id</key>
6a488035
TO
327 <onDelete>SET NULL</onDelete>
328 </foreignKey>
329</table>