Introduce 'context' param to CRM.api CRM-12029
[civicrm-core.git] / xml / schema / Grant / Grant.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2 <table>
3 <base>CRM/Grant</base>
4 <class>Grant</class>
5 <name>civicrm_grant</name>
6 <comment>This table stores information about grants given to a contact.</comment>
7 <add>1.8</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <uniqueName>grant_id</uniqueName>
13 <title>Grant ID</title>
14 <required>true</required>
15 <comment>Unique Grant id</comment>
16 <import>true</import>
17 <add>1.8</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>contact_id</name>
25 <type>int unsigned</type>
26 <uniqueName>grant_contact_id</uniqueName>
27 <title>Contact ID</title>
28 <export>true</export>
29 <required>true</required>
30 <comment>Contact ID of contact record given grant belongs to.</comment>
31 <add>1.8</add>
32 </field>
33 <foreignKey>
34 <name>contact_id</name>
35 <table>civicrm_contact</table>
36 <key>id</key>
37 <add>1.8</add>
38 <onDelete>CASCADE</onDelete>
39 </foreignKey>
40 <field>
41 <name>application_received_date</name>
42 <title>Application received date</title>
43 <type>date</type>
44 <export>true</export>
45 <comment>Date on which grant application was received by donor.</comment>
46 <add>1.8</add>
47 </field>
48 <field>
49 <name>decision_date</name>
50 <title>Decision date</title>
51 <type>date</type>
52 <comment>Date on which grant decision was made.</comment>
53 <import>true</import>
54 <add>1.8</add>
55 </field>
56 <field>
57 <name>money_transfer_date</name>
58 <title>Grant Money transfer date</title>
59 <type>date</type>
60 <comment>Date on which grant money transfer was made.</comment>
61 <import>true</import>
62 <add>1.8</add>
63 </field>
64 <field>
65 <name>grant_due_date</name>
66 <type>date</type>
67 <title>Grant Due Date</title>
68 <comment>Date on which grant report is due.</comment>
69 <add>1.8</add>
70 </field>
71 <field>
72 <name>grant_report_received</name>
73 <title>Grant report received</title>
74 <type>boolean</type>
75 <comment>Yes/No field stating whether grant report was received by donor.</comment>
76 <import>true</import>
77 <add>1.8</add>
78 </field>
79 <field>
80 <name>grant_type_id</name>
81 <type>int unsigned</type>
82 <title>Grant Type Id</title>
83 <pseudoconstant>
84 <name>grantType</name>
85 <optionGroupName>grant_type</optionGroupName>
86 </pseudoconstant>
87 <export>false</export>
88 <required>true</required>
89 <comment>Type of grant. Implicit FK to civicrm_option_value in grant_type option_group.</comment>
90 <add>1.8</add>
91 </field>
92 <index>
93 <name>index_grant_type_id</name>
94 <fieldName>grant_type_id</fieldName>
95 <add>1.8</add>
96 </index>
97 <field>
98 <name>amount_total</name>
99 <title>Total Amount</title>
100 <type>decimal</type>
101 <required>true</required>
102 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
103 <import>true</import>
104 <comment>Requested grant amount, in default currency.</comment>
105 <add>1.8</add>
106 </field>
107 <field>
108 <name>amount_requested</name>
109 <title>Amount Requested</title>
110 <type>decimal</type>
111 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
112 <comment>Requested grant amount, in original currency (optional).</comment>
113 <add>1.8</add>
114 </field>
115 <field>
116 <name>amount_granted</name>
117 <title>Amount granted</title>
118 <type>decimal</type>
119 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
120 <import>true</import>
121 <comment>Granted amount, in default currency.</comment>
122 <add>1.8</add>
123 </field>
124 <field>
125 <name>currency</name>
126 <type>varchar</type>
127 <length>3</length>
128 <required>true</required>
129 <comment>3 character string, value from config setting or input via user.</comment>
130 <add>3.2</add>
131 </field>
132 <field>
133 <name>currency</name>
134 <type>varchar</type>
135 <length>8</length>
136 <default>NULL</default>
137 <comment>3 character string, value from config setting or input via user.</comment>
138 <add>3.2</add>
139 <drop>4.3</drop>
140 </field>
141 <field>
142 <name>rationale</name>
143 <type>text</type>
144 <title>Grant Rationale</title>
145 <comment>Grant rationale.</comment>
146 <htmlType>textarea</htmlType>
147 <rows>4</rows>
148 <cols>60</cols>
149 <import>true</import>
150 <add>1.8</add>
151 </field>
152 <field>
153 <name>status_id</name>
154 <type>int unsigned</type>
155 <title>Grant Status Id</title>
156 <uniqueName>grant_status_id</uniqueName>
157 <required>true</required>
158 <import>true</import>
159 <export>false</export>
160 <comment>Id of Grant status.</comment>
161 <add>1.8</add>
162 </field>
163 <index>
164 <name>index_status_id</name>
165 <fieldName>status_id</fieldName>
166 <add>1.8</add>
167 </index>
168 <field>
169 <name>financial_type_id</name>
170 <title>Financial Type</title>
171 <type>int unsigned</type>
172 <default>NULL</default>
173 <comment>FK to Financial Type.</comment>
174 <add>4.3</add>
175 </field>
176 <foreignKey>
177 <name>financial_type_id</name>
178 <table>civicrm_financial_type</table>
179 <key>id</key>
180 <onDelete>SET NULL</onDelete>
181 <add>4.3</add>
182 </foreignKey>
183 </table>