1 <?xml version=
"1.0" encoding=
"iso-8859-1" ?>
4 <base>CRM/Member
</base>
5 <class>Membership
</class>
6 <name>civicrm_membership
</name>
7 <comment>Contact Membership records.
</comment>
12 <uniqueName>membership_id
</uniqueName>
13 <type>int unsigned
</type>
14 <required>true
</required>
16 <title>Membership ID
</title>
17 <headerPattern>/^(m(embership\s)?id)$/i
</headerPattern>
18 <comment>Membership Id
</comment>
23 <autoincrement>true
</autoincrement>
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>
35 <comment>FK to Contact ID
</comment>
38 <type>EntityRef
</type>
42 <name>contact_id
</name>
43 <table>civicrm_contact
</table>
46 <onDelete>CASCADE
</onDelete>
49 <name>membership_type_id
</name>
50 <type>int unsigned
</type>
51 <title>Membership Type Id
</title>
53 <headerPattern>/^(m(embership\s)?type)$/i
</headerPattern>
54 <export>false
</export>
55 <required>true
</required>
56 <comment>FK to Membership Type
</comment>
58 <table>civicrm_membership_type
</table>
59 <keyColumn>id
</keyColumn>
60 <labelColumn>name
</labelColumn>
68 <name>membership_type_id
</name>
69 <table>civicrm_membership_type
</table>
72 <onDelete>CASCADE
</onDelete>
75 <name>join_date
</name>
76 <title>Member Since
</title>
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>
84 <type>Select Date
</type>
85 <formatType>activityDate
</formatType>
89 <name>start_date
</name>
90 <uniqueName>membership_start_date
</uniqueName>
91 <title>Membership Start Date
</title>
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>
99 <type>Select Date
</type>
100 <formatType>activityDate
</formatType>
104 <name>end_date
</name>
105 <uniqueName>membership_end_date
</uniqueName>
106 <title>Membership Expiration Date
</title>
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>
114 <type>Select Date
</type>
115 <formatType>activityDate
</formatType>
120 <uniqueName>membership_source
</uniqueName>
121 <title>Source
</title>
122 <import>true
</import>
123 <headerPattern>/^(member(ship?))?source$/i
</headerPattern>
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>
141 <table>civicrm_membership_status
</table>
142 <keyColumn>id
</keyColumn>
143 <labelColumn>label
</labelColumn>
151 <name>status_id
</name>
152 <table>civicrm_membership_status
</table>
155 <onDelete>CASCADE
</onDelete>
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>
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>
167 <type>CheckBox
</type>
172 <name>status_override_end_date
</name>
173 <title>Status Override End Date
</title>
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>
180 <type>Select Date
</type>
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>
192 <name>owner_membership_id
</name>
193 <table>civicrm_membership
</table>
196 <onDelete>SET NULL
</onDelete>
199 <name>index_owner_membership_id
</name>
200 <fieldName>owner_membership_id
</fieldName>
204 <name>max_related
</name>
206 <comment>Maximum number of related memberships (membership_type override).
</comment>
208 <export>true
</export>
216 <uniqueName>member_is_test
</uniqueName>
219 <import>true
</import>
220 <headerPattern>/(is.)?test(.member(ship)?)?/i
</headerPattern>
222 <type>CheckBox
</type>
226 <name>is_pay_later
</name>
227 <uniqueName>member_is_pay_later
</uniqueName>
228 <title>Is Pay Later
</title>
231 <import>true
</import>
232 <headerPattern>/(is.)?(pay(.)?later)$/i
</headerPattern>
235 <type>CheckBox
</type>
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>
248 <name>contribution_recur_id
</name>
249 <table>civicrm_contribution_recur
</table>
252 <onDelete>SET NULL
</onDelete>
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>
262 <table>civicrm_campaign
</table>
263 <keyColumn>id
</keyColumn>
264 <labelColumn>title
</labelColumn>
272 <name>campaign_id
</name>
273 <table>civicrm_campaign
</table>
275 <onDelete>SET NULL
</onDelete>