CRM-14181 fixes - migrate enums to varchar in schema for all tables
[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>
141 <add>2.1</add>
614d72ec 142 <html>
143 <type>Select</type>
144 </html>
6a488035
TO
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>
614d72ec 155 <html>
156 <type>Text</type>
157 </html>
6a488035
TO
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>
614d72ec 167 <html>
168 <type>Select</type>
169 </html>
6a488035
TO
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>
614d72ec 178 <html>
179 <type>Text</type>
180 </html>
6a488035
TO
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>
614d72ec 189 <html>
190 <type>Select Date</type>
191 </html>
6a488035
TO
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>
614d72ec 202 <html>
203 <type>Select Date</type>
204 </html>
6a488035
TO
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>
614d72ec 212 <html>
213 <type>Select Date</type>
214 </html>
6a488035
TO
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>
614d72ec 229 <html>
230 <type>Select Date</type>
231 </html>
6a488035
TO
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>
614d72ec 239 <html>
240 <type>Select Date</type>
241 </html>
6a488035 242 </field>
6a488035
TO
243 <field>
244 <name>max_reminders</name>
245 <title>Maximum Number of Reminders</title>
246 <type>int unsigned</type>
247 <default>1</default>
248 <comment>The maximum number of payment reminders to send for any given payment.</comment>
614d72ec 249 <html>
250 <type>Text</type>
251 </html>
6a488035
TO
252 <add>2.1</add>
253 </field>
254 <field>
255 <name>initial_reminder_day</name>
256 <title>Initial Reminder Day</title>
257 <type>int unsigned</type>
258 <default>5</default>
259 <comment>Send initial reminder this many days prior to the payment due date.</comment>
260 <add>2.1</add>
614d72ec 261 <html>
262 <type>Select</type>
263 </html>
6a488035
TO
264 </field>
265 <field>
266 <name>additional_reminder_day</name>
267 <title>Additional Reminder Days</title>
268 <type>int unsigned</type>
269 <default>5</default>
270 <comment>Send additional reminder this many days after last one sent, up to maximum number of reminders.</comment>
271 <add>2.1</add>
614d72ec 272 <html>
273 <type>Text</type>
274 </html>
6a488035
TO
275 </field>
276 <field>
277 <name>status_id</name>
278 <title>Pledge Status Id</title>
279 <uniqueName>pledge_status_id</uniqueName>
280 <import>true</import>
281 <export>false</export>
282 <type>int unsigned</type>
283 <comment>Implicit foreign key to civicrm_option_values in the contribution_status option group.</comment>
284 <add>2.1</add>
285 </field>
286 <index>
287 <name>index_status</name>
288 <fieldName>status_id</fieldName>
289 <add>2.1</add>
290 </index>
3c7d2158 291 <field>
292 <name>is_test</name>
293 <uniqueName>pledge_is_test</uniqueName>
6a488035
TO
294 <import>true</import>
295 <title>Test</title>
296 <type>boolean</type>
297 <default>0</default>
614d72ec 298 <html>
299 <type>CheckBox</type>
300 </html>
6a488035 301 </field>
3c7d2158 302 <field>
303 <name>campaign_id</name>
6a488035 304 <uniqueName>pledge_campaign_id</uniqueName>
3c7d2158 305 <type>int unsigned</type>
e1ab2e91 306 <title>Campaign</title>
3c7d2158 307 <import>true</import>
308 <comment>The campaign for which this pledge has been initiated.</comment>
3e3eacd0
CW
309 <pseudoconstant>
310 <table>civicrm_campaign</table>
311 <keyColumn>id</keyColumn>
312 <labelColumn>title</labelColumn>
3e3eacd0 313 </pseudoconstant>
3c7d2158 314 <add>3.4</add>
614d72ec 315 <html>
316 <type>Select</type>
317 </html>
3c7d2158 318 </field>
319 <foreignKey>
320 <name>campaign_id</name>
321 <table>civicrm_campaign</table>
322 <key>id</key>
6a488035
TO
323 <onDelete>SET NULL</onDelete>
324 </foreignKey>
325</table>