CRM-13497 - getting there on main tables
[civicrm-core.git] / xml / schema / Pledge / Pledge.xml
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>
31 <html>
32 <type>Autocomplete-Select</type>
33 </html>
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>
42 <field>
43 <name>contribution_type_id</name>
44 <uniqueName>pledge_contribution_type_id</uniqueName>
45 <export>false</export>
46 <type>int unsigned</type>
47 <comment>FK to Contribution Type. This is propagated to contribution record when pledge payments are made.</comment>
48 <add>2.1</add>
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>
55 <add>2.1</add>
56 <drop>4.3</drop>
57 <onDelete>SET NULL</onDelete>
58 </foreignKey>
59 <field>
60 <name>financial_type_id</name>
61 <title>Type</title>
62 <uniqueName>pledge_financial_type_id</uniqueName>
63 <type>int unsigned</type>
64 <comment>FK to Financial Type</comment>
65 <add>4.3</add>
66 <html>
67 <type>Select</type>
68 </html>
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>
77 <name>contribution_page_id</name>
78 <uniqueName>pledge_contribution_page_id</uniqueName>
79 <title>Pledge Contribution Page</title>
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>
88 <onDelete>SET NULL</onDelete>
89 </foreignKey>
90 <field>
91 <name>amount</name>
92 <uniqueName>pledge_amount</uniqueName>
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>
99 <html>
100 <type>Text</type>
101 </html>
102 </field>
103 <field>
104 <name>original_installment_amount</name>
105 <uniqueName>pledge_original_installment_amount</uniqueName>
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>
111 <html>
112 <type>Text</type>
113 </html>
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>
123 <pseudoconstant>
124 <table>civicrm_currency</table>
125 <keyColumn>name</keyColumn>
126 <labelColumn>full_name</labelColumn>
127 <nameColumn>numeric_code</nameColumn>
128 </pseudoconstant>
129 <html>
130 <type>Select></type>
131 </html>
132 </field>
133 <field>
134 <name>frequency_unit</name>
135 <uniqueName>pledge_frequency_unit</uniqueName>
136 <title>Pledge Frequency Unit</title>
137 <type>enum</type>
138 <values>day,week,month,year</values>
139 <default>'month'</default>
140 <comment>Time units for recurrence of pledge payments.</comment>
141 <add>2.1</add>
142 <html>
143 <type>Select</type>
144 </html>
145 </field>
146 <field>
147 <name>frequency_interval</name>
148 <uniqueName>pledge_frequency_interval</uniqueName>
149 <title>Pledge Frequency Interval</title>
150 <type>int unsigned</type>
151 <required>true</required>
152 <default>1</default>
153 <comment>Number of time units for recurrence of pledge payments.</comment>
154 <add>2.1</add>
155 <html>
156 <type>Text</type>
157 </html>
158 </field>
159 <field>
160 <name>frequency_day</name>
161 <type>int unsigned</type>
162 <title>Pledge day</title>
163 <default>3</default>
164 <required>true</required>
165 <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>
166 <add>2.1</add>
167 <html>
168 <type>Select</type>
169 </html>
170 </field>
171 <field>
172 <name>installments</name>
173 <type>int unsigned</type>
174 <title>Pledge Number of Installments</title>
175 <default>1</default>
176 <comment>Total number of payments to be made.</comment>
177 <add>2.1</add>
178 <html>
179 <type>Text</type>
180 </html>
181 </field>
182 <field>
183 <name>start_date</name>
184 <type>datetime</type>
185 <title>Pledge Start Date</title>
186 <required>true</required>
187 <comment>The date the first scheduled pledge occurs.</comment>
188 <add>2.1</add>
189 <html>
190 <type>Select Date</type>
191 </html>
192 </field>
193 <field>
194 <name>create_date</name>
195 <type>datetime</type>
196 <uniqueName>pledge_create_date</uniqueName>
197 <title>Pledge Made</title>
198 <required>true</required>
199 <import>true</import>
200 <comment>When this pledge record was created.</comment>
201 <add>2.1</add>
202 <html>
203 <type>Select Date</type>
204 </html>
205 </field>
206 <field>
207 <name>acknowledge_date</name>
208 <type>datetime</type>
209 <title>Pledge Acknowledged</title>
210 <comment>When a pledge acknowledgement message was sent to the contributor.</comment>
211 <add>2.1</add>
212 <html>
213 <type>Select Date</type>
214 </html>
215 </field>
216 <field>
217 <name>modified_date</name>
218 <type>datetime</type>
219 <title>Pledge Modified Date</title>
220 <comment>Last updated date for this pledge record.</comment>
221 <add>2.1</add>
222 </field>
223 <field>
224 <name>cancel_date</name>
225 <type>datetime</type>
226 <title>Pledge Cancelled Date</title>
227 <comment>Date this pledge was cancelled by contributor.</comment>
228 <add>2.1</add>
229 <html>
230 <type>Select Date</type>
231 </html>
232 </field>
233 <field>
234 <name>end_date</name>
235 <type>datetime</type>
236 <title>Pledge End Date</title>
237 <comment>Date this pledge finished successfully (total pledge payments equal to or greater than pledged amount).</comment>
238 <add>2.1</add>
239 <html>
240 <type>Select Date</type>
241 </html>
242 </field>
243 <field>
244 <name>honor_contact_id</name>
245 <type>int unsigned</type>
246 <title>Pledge Honor Contact</title>
247 <comment>FK to contact ID. Used when pledge is made in honor of another contact. This is propagated to contribution records when pledge payments are made.</comment>
248 <add>2.1</add>
249 <html>
250 <type>Autocomplete-Select</type>
251 </html>
252 </field>
253 <foreignKey>
254 <name>honor_contact_id</name>
255 <table>civicrm_contact</table>
256 <key>id</key>
257 <add>2.1</add>
258 <onDelete>SET NULL</onDelete>
259 </foreignKey>
260 <field>
261 <name>honor_type_id</name>
262 <title>Honor Type</title>
263 <type>int unsigned</type>
264 <comment>Implicit FK to civicrm_option_value.</comment>
265 <add>2.1</add>
266 <onDelete>SET NULL</onDelete>
267 <pseudoconstant>
268 <optionGroupName>honor_type</optionGroupName>
269 </pseudoconstant>
270 <html>
271 <type>Select></type>
272 </html>
273 </field>
274 <field>
275 <name>max_reminders</name>
276 <title>Maximum Number of Reminders</title>
277 <type>int unsigned</type>
278 <default>1</default>
279 <comment>The maximum number of payment reminders to send for any given payment.</comment>
280 <html>
281 <type>Text</type>
282 </html>
283 <add>2.1</add>
284 </field>
285 <field>
286 <name>initial_reminder_day</name>
287 <title>Initial Reminder Day</title>
288 <type>int unsigned</type>
289 <default>5</default>
290 <comment>Send initial reminder this many days prior to the payment due date.</comment>
291 <add>2.1</add>
292 <html>
293 <type>Select</type>
294 </html>
295 </field>
296 <field>
297 <name>additional_reminder_day</name>
298 <title>Additional Reminder Days</title>
299 <type>int unsigned</type>
300 <default>5</default>
301 <comment>Send additional reminder this many days after last one sent, up to maximum number of reminders.</comment>
302 <add>2.1</add>
303 <html>
304 <type>Text</type>
305 </html>
306 </field>
307 <field>
308 <name>status_id</name>
309 <title>Pledge Status Id</title>
310 <uniqueName>pledge_status_id</uniqueName>
311 <import>true</import>
312 <export>false</export>
313 <type>int unsigned</type>
314 <comment>Implicit foreign key to civicrm_option_values in the contribution_status option group.</comment>
315 <add>2.1</add>
316 </field>
317 <index>
318 <name>index_status</name>
319 <fieldName>status_id</fieldName>
320 <add>2.1</add>
321 </index>
322 <field>
323 <name>is_test</name>
324 <uniqueName>pledge_is_test</uniqueName>
325 <import>true</import>
326 <title>Test</title>
327 <type>boolean</type>
328 <default>0</default>
329 <html>
330 <type>CheckBox</type>
331 </html>
332 </field>
333 <field>
334 <name>campaign_id</name>
335 <uniqueName>pledge_campaign_id</uniqueName>
336 <type>int unsigned</type>
337 <title>Campaign ID</title>
338 <import>true</import>
339 <comment>The campaign for which this pledge has been initiated.</comment>
340 <add>3.4</add>
341 <html>
342 <type>Select</type>
343 </html>
344 </field>
345 <foreignKey>
346 <name>campaign_id</name>
347 <table>civicrm_campaign</table>
348 <key>id</key>
349 <onDelete>SET NULL</onDelete>
350 </foreignKey>
351 </table>