Refactored out of CRM_Core_PseudoConstant: ufGroup(), currencySymbols(). CRM-12464
[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>
31 </field>
32 <foreignKey>
33 <name>contact_id</name>
34 <table>civicrm_contact</table>
35 <key>id</key>
36 <add>2.1</add>
37 <onDelete>CASCADE</onDelete>
38 </foreignKey>
39 <field>
40 <name>contribution_type_id</name>
41 <uniqueName>pledge_contribution_type_id</uniqueName>
42 <export>false</export>
43 <type>int unsigned</type>
44 <comment>FK to Contribution Type. This is propagated to contribution record when pledge payments are made.</comment>
45 <add>2.1</add>
46 <drop>4.3</drop>
47 </field>
48 <foreignKey>
49 <name>contribution_type_id</name>
50 <table>civicrm_contribution_type</table>
51 <key>id</key>
52 <add>2.1</add>
53 <drop>4.3</drop>
54 <onDelete>SET NULL</onDelete>
55 </foreignKey>
56 <field>
57 <name>financial_type_id</name>
58 <title>Type</title>
59 <uniqueName>pledge_financial_type_id</uniqueName>
60 <type>int unsigned</type>
61 <comment>FK to Financial Type</comment>
62 <add>4.3</add>
63 </field>
64 <foreignKey>
65 <name>financial_type_id</name>
66 <table>civicrm_financial_type</table>
67 <key>id</key>
68 <add>4.3</add>
69 </foreignKey>
70 <field>
71 <name>contribution_page_id</name>
72 <uniqueName>pledge_contribution_page_id</uniqueName>
73 <title>Pledge Contribution Page</title>
74 <type>int unsigned</type>
75 <comment>The Contribution Page which triggered this contribution</comment>
76 <add>2.1</add>
77 </field>
78 <foreignKey>
79 <name>contribution_page_id</name>
80 <table>civicrm_contribution_page</table>
81 <key>id</key>
82 <onDelete>SET NULL</onDelete>
83 </foreignKey>
84 <field>
85 <name>amount</name>
86 <uniqueName>pledge_amount</uniqueName>
87 <title>Total Pledged</title>
88 <type>decimal</type>
89 <required>true</required>
90 <import>true</import>
91 <comment>Total pledged amount.</comment>
92 <add>2.1</add>
93 </field>
94 <field>
95 <name>original_installment_amount</name>
96 <uniqueName>pledge_original_installment_amount</uniqueName>
97 <title>Original Installment Amount</title>
98 <type>decimal</type>
99 <required>true</required>
100 <comment>Original amount for each of the installments.</comment>
101 <add>3.2</add>
102 </field>
103 <field>
104 <name>currency</name>
105 <type>varchar</type>
106 <title>Pledge Currency</title>
107 <length>3</length>
108 <default>NULL</default>
109 <comment>3 character string, value from config setting or input via user.</comment>
110 <add>3.2</add>
bd44e0df
AS
111 <pseudoconstant>
112 <table>civicrm_currency</table>
113 <keyColumn>name</keyColumn>
114 <labelColumn>symbol</labelColumn>
115 </pseudoconstant>
6a488035
TO
116 </field>
117 <field>
118 <name>frequency_unit</name>
119 <uniqueName>pledge_frequency_unit</uniqueName>
120 <title>Pledge Frequency Unit</title>
121 <type>enum</type>
122 <values>day,week,month,year</values>
123 <default>'month'</default>
124 <comment>Time units for recurrence of pledge payments.</comment>
125 <add>2.1</add>
126 </field>
127 <field>
128 <name>frequency_interval</name>
129 <uniqueName>pledge_frequency_interval</uniqueName>
130 <title>Pledge Frequency Interval</title>
131 <type>int unsigned</type>
132 <required>true</required>
133 <default>1</default>
134 <comment>Number of time units for recurrence of pledge payments.</comment>
135 <add>2.1</add>
136 </field>
137 <field>
138 <name>frequency_day</name>
139 <type>int unsigned</type>
140 <title>Pledge day</title>
141 <default>3</default>
142 <required>true</required>
143 <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>
144 <add>2.1</add>
145 </field>
146 <field>
147 <name>installments</name>
148 <type>int unsigned</type>
149 <title>Pledge Number of Installments</title>
150 <default>1</default>
151 <comment>Total number of payments to be made.</comment>
152 <add>2.1</add>
153 </field>
154 <field>
155 <name>start_date</name>
156 <type>datetime</type>
157 <title>Pledge Start Date</title>
158 <required>true</required>
159 <comment>The date the first scheduled pledge occurs.</comment>
160 <add>2.1</add>
161 </field>
162 <field>
163 <name>create_date</name>
164 <type>datetime</type>
165 <uniqueName>pledge_create_date</uniqueName>
166 <title>Pledge Made</title>
167 <required>true</required>
168 <import>true</import>
169 <comment>When this pledge record was created.</comment>
170 <add>2.1</add>
171 </field>
172 <field>
173 <name>acknowledge_date</name>
174 <type>datetime</type>
175 <title>Pledge Acknowledged</title>
176 <comment>When a pledge acknowledgement message was sent to the contributor.</comment>
177 <add>2.1</add>
178 </field>
179 <field>
180 <name>modified_date</name>
181 <type>datetime</type>
182 <title>Pledge Modified Date</title>
183 <comment>Last updated date for this pledge record.</comment>
184 <add>2.1</add>
185 </field>
186 <field>
187 <name>cancel_date</name>
188 <type>datetime</type>
189 <title>Pledge Cancelled Date</title>
190 <comment>Date this pledge was cancelled by contributor.</comment>
191 <add>2.1</add>
192 </field>
193 <field>
194 <name>end_date</name>
195 <type>datetime</type>
196 <title>Pledge End Date</title>
197 <comment>Date this pledge finished successfully (total pledge payments equal to or greater than pledged amount).</comment>
198 <add>2.1</add>
199 </field>
200 <field>
201 <name>honor_contact_id</name>
202 <type>int unsigned</type>
203 <title>Pledge Honor Contact</title>
204 <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>
205 <add>2.1</add>
206 </field>
207 <foreignKey>
208 <name>honor_contact_id</name>
209 <table>civicrm_contact</table>
210 <key>id</key>
211 <add>2.1</add>
212 <onDelete>SET NULL</onDelete>
213 </foreignKey>
214 <field>
215 <name>honor_type_id</name>
216 <title>Honor Type</title>
217 <type>int unsigned</type>
218 <comment>Implicit FK to civicrm_option_value.</comment>
219 <add>2.1</add>
220 <onDelete>SET NULL</onDelete>
cbf48754
AS
221 <pseudoconstant>
222 <optionGroupName>honor_type</optionGroupName>
223 </pseudoconstant>
6a488035
TO
224 </field>
225 <field>
226 <name>max_reminders</name>
227 <title>Maximum Number of Reminders</title>
228 <type>int unsigned</type>
229 <default>1</default>
230 <comment>The maximum number of payment reminders to send for any given payment.</comment>
231 <add>2.1</add>
232 </field>
233 <field>
234 <name>initial_reminder_day</name>
235 <title>Initial Reminder Day</title>
236 <type>int unsigned</type>
237 <default>5</default>
238 <comment>Send initial reminder this many days prior to the payment due date.</comment>
239 <add>2.1</add>
240 </field>
241 <field>
242 <name>additional_reminder_day</name>
243 <title>Additional Reminder Days</title>
244 <type>int unsigned</type>
245 <default>5</default>
246 <comment>Send additional reminder this many days after last one sent, up to maximum number of reminders.</comment>
247 <add>2.1</add>
248 </field>
249 <field>
250 <name>status_id</name>
251 <title>Pledge Status Id</title>
252 <uniqueName>pledge_status_id</uniqueName>
253 <import>true</import>
254 <export>false</export>
255 <type>int unsigned</type>
256 <comment>Implicit foreign key to civicrm_option_values in the contribution_status option group.</comment>
257 <add>2.1</add>
258 </field>
259 <index>
260 <name>index_status</name>
261 <fieldName>status_id</fieldName>
262 <add>2.1</add>
263 </index>
264 <field>
265 <name>is_test</name>
266 <uniqueName>pledge_is_test</uniqueName>
267 <import>true</import>
268 <title>Test</title>
269 <type>boolean</type>
270 <default>0</default>
271 </field>
272 <field>
273 <name>campaign_id</name>
274 <uniqueName>pledge_campaign_id</uniqueName>
275 <type>int unsigned</type>
276 <title>Campaign ID</title>
277 <import>true</import>
278 <comment>The campaign for which this pledge has been initiated.</comment>
279 <add>3.4</add>
280 </field>
281 <foreignKey>
282 <name>campaign_id</name>
283 <table>civicrm_campaign</table>
284 <key>id</key>
285 <onDelete>SET NULL</onDelete>
286 </foreignKey>
287</table>