Merge branch '4.4' of https://github.com/civicrm/civicrm-core
[civicrm-core.git] / xml / schema / Member / MembershipType.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Member</base>
5 <class>MembershipType</class>
6 <name>civicrm_membership_type</name>
7 <comment>Sites can configure multiple types of memberships. They encode the owner organization, fee, and the rules needed to set start and end (expire) dates when a member signs up for that type.</comment>
8 <add>1.5</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Membership Id</comment>
15 <add>1.5</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>domain_id</name>
23 <type>int unsigned</type>
24 <required>true</required>
25 <comment>Which Domain is this match entry for</comment>
26 <add>3.0</add>
27 </field>
28 <foreignKey>
29 <name>domain_id</name>
30 <table>civicrm_domain</table>
31 <key>id</key>
32 <add>3.0</add>
3c7d2158 33 </foreignKey>
6a488035
TO
34 <field>
35 <name>name</name>
3c7d2158 36 <uniqueName>membership_type</uniqueName>
6a488035
TO
37 <title>Membership Type</title>
38 <type>varchar</type>
39 <import>true</import>
40 <length>128</length>
41 <localizable>true</localizable>
42 <comment>Name of Membership Type</comment>
43 <add>1.5</add>
44 </field>
45 <field>
46 <name>description</name>
47 <type>varchar</type>
7deea513 48 <html>
49 <type>TextArea</type>
817807ab 50 <rows>6</rows>
51 <cols>50</cols>
7deea513 52 </html>
6a488035
TO
53 <length>255</length>
54 <localizable>true</localizable>
55 <comment>Description of Membership Type</comment>
56 <add>1.5</add>
57 </field>
58 <field>
59 <name>member_of_contact_id</name>
60 <type>int unsigned</type>
61 <required>true</required>
62 <comment>Owner organization for this membership type. FK to Contact ID</comment>
63 <add>1.5</add>
64 </field>
3c7d2158 65 <foreignKey>
66 <name>member_of_contact_id</name>
67 <table>civicrm_contact</table>
6a488035
TO
68 <key>id</key>
69 <add>1.5</add>
70 <onDelete>RESTRICT</onDelete>
71 </foreignKey>
72 <field>
73 <name>contribution_type_id</name>
74 <type>int unsigned</type>
75 <required>true</required>
76 <comment>If membership is paid by a contribution - what contribution type should be used. FK to Contribution Type ID</comment>
77 <add>1.5</add>
78 <drop>4.3</drop>
79 </field>
3c7d2158 80 <foreignKey>
81 <name>contribution_type_id</name>
82 <table>civicrm_contribution_type</table>
83 <key>id</key>
6a488035
TO
84 <add>1.5</add>
85 <drop>4.3</drop>
86 </foreignKey>
87 <field>
88 <name>financial_type_id</name>
89 <type>int unsigned</type>
90 <required>true</required>
91 <comment>If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id</comment>
92 <add>4.3</add>
93 </field>
3c7d2158 94 <foreignKey>
95 <name>financial_type_id</name>
96 <table>civicrm_financial_type</table>
97 <key>id</key>
6a488035
TO
98 <add>4.3</add>
99 </foreignKey>
3c7d2158 100 <field>
101 <name>minimum_fee</name>
102 <type>decimal</type>
103 <comment>Minimum fee for this membership (0 for free/complimentary memberships).</comment>
6a488035 104 <default>0</default>
3c7d2158 105 <add>1.5</add>
106 </field>
107 <field>
108 <name>duration_unit</name>
6a488035
TO
109 <type>enum</type>
110 <values>day, month, year, lifetime</values>
3c7d2158 111 <comment>Unit in which membership period is expressed.</comment>
112 <add>1.5</add>
614d72ec 113 <html>
114 <type>Select</type>
115 </html>
3c7d2158 116 </field>
117 <field>
6a488035
TO
118 <name>duration_interval</name>
119 <type>int</type>
3c7d2158 120 <comment>Number of duration units in membership period (e.g. 1 year, 12 months).</comment>
121 <add>1.5</add>
122 </field>
123 <field>
124 <name>period_type</name>
6a488035
TO
125 <type>enum</type>
126 <values>rolling, fixed</values>
3c7d2158 127 <comment>Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.</comment>
128 <add>1.5</add>
129 </field>
130 <field>
131 <name>fixed_period_start_day</name>
6a488035 132 <type>int</type>
3c7d2158 133 <comment>For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.</comment>
134 <add>1.5</add>
135 </field>
136 <field>
137 <name>fixed_period_rollover_day</name>
138 <type>int</type>
139 <comment>For fixed period memberships, signups after this day (mmdd) rollover to next period.</comment>
140 <add>1.5</add>
141 </field>
6a488035
TO
142 <field>
143 <name>relationship_type_id</name>
144 <type>varchar</type>
145 <length>64</length>
146 <comment>FK to Relationship Type ID</comment>
147 <add>1.5</add>
148 </field>
3c7d2158 149 <foreignKey>
150 <name>relationship_type_id</name>
151 <table>civicrm_relationship_type</table>
152 <key>id</key>
6a488035
TO
153 <add>1.5</add>
154 <drop>3.3</drop>
155 </foreignKey>
156 <index>
157 <name>index_relationship_type_id</name>
158 <fieldName>relationship_type_id</fieldName>
159 <add>3.3</add>
160 </index>
3c7d2158 161 <field>
162 <name>relationship_direction</name>
163 <type>varchar</type>
164 <length>128</length>
165 <add>1.7</add>
6a488035
TO
166 </field>
167 <field>
168 <name>max_related</name>
169 <type>int</type>
170 <comment>Maximum number of related memberships.</comment>
171 <add>4.3</add>
172 </field>
173 <field>
3c7d2158 174 <name>visibility</name>
6a488035
TO
175 <title>Visible</title>
176 <type>varchar</type>
177 <length>64</length>
4080e473
AS
178 <add>1.5</add>
179 <pseudoconstant>
180 <optionGroupName>visibility</optionGroupName>
4080e473 181 </pseudoconstant>
614d72ec 182 <html>
e0991796 183 <type>Select</type>
614d72ec 184 </html>
6a488035 185 </field>
3c7d2158 186 <field>
187 <name>weight</name>
6a488035
TO
188 <title>Weight</title>
189 <type>int</type>
3c7d2158 190 <add>1.5</add>
6a488035
TO
191 </field>
192 <field>
193 <name>receipt_text_signup</name>
194 <type>varchar</type>
7deea513 195 <html>
196 <type>TextArea</type>
817807ab 197 <rows>6</rows>
198 <cols>50</cols>
7deea513 199 </html>
6a488035
TO
200 <length>255</length>
201 <comment>Receipt Text for membership signup</comment>
202 <add>2.0</add>
203 </field>
204 <field>
205 <name>receipt_text_renewal</name>
206 <type>varchar</type>
7deea513 207 <html>
208 <type>TextArea</type>
817807ab 209 <rows>6</rows>
210 <cols>50</cols>
7deea513 211 </html>
6a488035
TO
212 <length>255</length>
213 <comment>Receipt Text for membership renewal</comment>
214 <add>2.0</add>
215 </field>
3c7d2158 216 <field>
217 <name>auto_renew</name>
6a488035
TO
218 <type>boolean</type>
219 <default>0</default>
3c7d2158 220 <comment>0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;</comment>
221 <add>3.3</add>
222 </field>
223 <field>
224 <name>is_active</name>
6a488035
TO
225 <title>Is Active</title>
226 <type>boolean</type>
227 <default>1</default>
3c7d2158 228 <comment>Is this membership_type enabled</comment>
229 <add>1.5</add>
230 </field>
6a488035 231</table>