Fix metadata on member export
[civicrm-core.git] / xml / schema / Member / Membership.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Member</base>
5 <class>Membership</class>
6 <name>civicrm_membership</name>
7 <comment>Contact Membership records.</comment>
8 <add>1.5</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <uniqueName>membership_id</uniqueName>
13 <type>int unsigned</type>
14 <required>true</required>
15 <import>true</import>
16 <title>Membership ID</title>
17 <headerPattern>/^(m(embership\s)?id)$/i</headerPattern>
18 <comment>Membership Id</comment>
19 <add>1.5</add>
20 </field>
21 <primaryKey>
22 <name>id</name>
23 <autoincrement>true</autoincrement>
24 </primaryKey>
25
26 <field>
27 <name>contact_id</name>
28 <uniqueName>membership_contact_id</uniqueName>
29 <type>int unsigned</type>
30 <required>true</required>
31 <title>Contact ID</title>
32 <headerPattern>/contact(.?id)?/i</headerPattern>
33 <dataPattern>/^\d+$/</dataPattern>
34 <import>true</import>
35 <comment>FK to Contact ID</comment>
36 <add>1.5</add>
37 <html>
38 <type>EntityRef</type>
39 </html>
40 </field>
41 <foreignKey>
42 <name>contact_id</name>
43 <table>civicrm_contact</table>
44 <key>id</key>
45 <add>1.5</add>
46 <onDelete>CASCADE</onDelete>
47 </foreignKey>
48 <field>
49 <name>membership_type_id</name>
50 <type>int unsigned</type>
51 <title>Membership Type Id</title>
52 <import>true</import>
53 <headerPattern>/^(m(embership\s)?type)$/i</headerPattern>
54 <export>false</export>
55 <required>true</required>
56 <comment>FK to Membership Type</comment>
57 <pseudoconstant>
58 <table>civicrm_membership_type</table>
59 <keyColumn>id</keyColumn>
60 <labelColumn>name</labelColumn>
61 </pseudoconstant>
62 <html>
63 <type>Select</type>
64 </html>
65 <add>1.5</add>
66 </field>
67 <foreignKey>
68 <name>membership_type_id</name>
69 <table>civicrm_membership_type</table>
70 <key>id</key>
71 <add>1.5</add>
72 <onDelete>CASCADE</onDelete>
73 </foreignKey>
74 <field>
75 <name>join_date</name>
76 <title>Member Since</title>
77 <type>date</type>
78 <import>true</import>
79 <headerPattern>/^join|(j(oin\s)?date)$/i</headerPattern>
80 <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern>
81 <comment>Beginning of initial membership period (member since...).</comment>
82 <add>1.5</add>
83 <html>
84 <type>Select Date</type>
85 <formatType>activityDate</formatType>
86 </html>
87 </field>
88 <field>
89 <name>start_date</name>
90 <uniqueName>membership_start_date</uniqueName>
91 <title>Membership Start Date</title>
92 <type>date</type>
93 <import>true</import>
94 <headerPattern>/(member(ship)?.)?start(s)?(.date$)?/i</headerPattern>
95 <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern>
96 <comment>Beginning of current uninterrupted membership period.</comment>
97 <add>1.5</add>
98 <html>
99 <type>Select Date</type>
100 <formatType>activityDate</formatType>
101 </html>
102 </field>
103 <field>
104 <name>end_date</name>
105 <uniqueName>membership_end_date</uniqueName>
106 <title>Membership Expiration Date</title>
107 <type>date</type>
108 <import>true</import>
109 <headerPattern>/(member(ship)?.)?end(s)?(.date$)?/i</headerPattern>
110 <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern>
111 <comment>Current membership period expire date.</comment>
112 <add>1.5</add>
113 <html>
114 <type>Select Date</type>
115 <formatType>activityDate</formatType>
116 </html>
117 </field>
118 <field>
119 <name>source</name>
120 <uniqueName>membership_source</uniqueName>
121 <title>Source</title>
122 <import>true</import>
123 <headerPattern>/^(member(ship?))?source$/i</headerPattern>
124 <type>varchar</type>
125 <length>128</length>
126 <add>1.5</add>
127 <html>
128 <type>Text</type>
129 </html>
130 </field>
131 <field>
132 <name>status_id</name>
133 <title>Membership Status Id</title>
134 <import>true</import>
135 <headerPattern>/(member(ship|).)?(status)$/i</headerPattern>
136 <type>int unsigned</type>
137 <export>false</export>
138 <required>true</required>
139 <comment>FK to Membership Status</comment>
140 <pseudoconstant>
141 <table>civicrm_membership_status</table>
142 <keyColumn>id</keyColumn>
143 <labelColumn>label</labelColumn>
144 </pseudoconstant>
145 <html>
146 <type>Select</type>
147 </html>
148 <add>1.5</add>
149 </field>
150 <foreignKey>
151 <name>status_id</name>
152 <table>civicrm_membership_status</table>
153 <key>id</key>
154 <add>1.5</add>
155 <onDelete>CASCADE</onDelete>
156 </foreignKey>
157 <field>
158 <name>is_override</name>
159 <uniqueName>member_is_override</uniqueName>
160 <title>Status Override</title>
161 <import>true</import>
162 <export>true</export>
163 <headerPattern>/override$/i</headerPattern>
164 <type>boolean</type>
165 <comment>Admin users may set a manual status which overrides the calculated status. When this flag is true, automated status update scripts should NOT modify status for the record.</comment>
166 <html>
167 <type>CheckBox</type>
168 </html>
169 <add>1.5</add>
170 </field>
171 <field>
172 <name>status_override_end_date</name>
173 <title>Status Override End Date</title>
174 <type>date</type>
175 <default>NULL</default>
176 <import>true</import>
177 <comment>Then end date of membership status override if 'Override until selected date' override type is selected.</comment>
178 <add>4.7</add>
179 <html>
180 <type>Select Date</type>
181 </html>
182 </field>
183 <field>
184 <name>owner_membership_id</name>
185 <type>int unsigned</type>
186 <title>Primary Member ID</title>
187 <comment>Optional FK to Parent Membership.</comment>
188 <export>true</export>
189 <add>1.7</add>
190 </field>
191 <foreignKey>
192 <name>owner_membership_id</name>
193 <table>civicrm_membership</table>
194 <key>id</key>
195 <add>1.7</add>
196 <onDelete>SET NULL</onDelete>
197 </foreignKey>
198 <index>
199 <name>index_owner_membership_id</name>
200 <fieldName>owner_membership_id</fieldName>
201 <add>1.7</add>
202 </index>
203 <field>
204 <name>max_related</name>
205 <type>int</type>
206 <comment>Maximum number of related memberships (membership_type override).</comment>
207 <add>4.3</add>
208 <export>true</export>
209 <html>
210 <type>Text</type>
211 </html>
212 </field>
213 <field>
214 <name>is_test</name>
215 <title>Test</title>
216 <uniqueName>member_is_test</uniqueName>
217 <type>boolean</type>
218 <default>0</default>
219 <import>true</import>
220 <headerPattern>/(is.)?test(.member(ship)?)?/i</headerPattern>
221 <html>
222 <type>CheckBox</type>
223 </html>
224 </field>
225 <field>
226 <name>is_pay_later</name>
227 <uniqueName>member_is_pay_later</uniqueName>
228 <title>Is Pay Later</title>
229 <type>boolean</type>
230 <default>0</default>
231 <import>true</import>
232 <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
233 <add>2.1</add>
234 <html>
235 <type>CheckBox</type>
236 </html>
237 </field>
238 <field>
239 <name>contribution_recur_id</name>
240 <uniqueName>membership_recur_id</uniqueName>
241 <title>Membership Recurring Contribution</title>
242 <type>int unsigned</type>
243 <export>true</export>
244 <comment>Conditional foreign key to civicrm_contribution_recur id. Each membership in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.</comment>
245 <add>3.3</add>
246 </field>
247 <foreignKey>
248 <name>contribution_recur_id</name>
249 <table>civicrm_contribution_recur</table>
250 <key>id</key>
251 <add>3.3</add>
252 <onDelete>SET NULL</onDelete>
253 </foreignKey>
254 <field>
255 <name>campaign_id</name>
256 <uniqueName>member_campaign_id</uniqueName>
257 <type>int unsigned</type>
258 <title>Campaign</title>
259 <import>true</import>
260 <comment>The campaign for which this membership is attached.</comment>
261 <pseudoconstant>
262 <table>civicrm_campaign</table>
263 <keyColumn>id</keyColumn>
264 <labelColumn>title</labelColumn>
265 </pseudoconstant>
266 <add>3.4</add>
267 <html>
268 <type>Select</type>
269 </html>
270 </field>
271 <foreignKey>
272 <name>campaign_id</name>
273 <table>civicrm_campaign</table>
274 <key>id</key>
275 <onDelete>SET NULL</onDelete>
276 </foreignKey>
277 </table>