Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-04-00-08-28
[civicrm-core.git] / xml / schema / Member / MembershipType.xml
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>
33 </foreignKey>
34 <field>
35 <name>name</name>
36 <uniqueName>membership_type</uniqueName>
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>
48 <html>
49 <type>TextArea</type>
50 <rows>6</rows>
51 <cols>50</cols>
52 </html>
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>
65 <foreignKey>
66 <name>member_of_contact_id</name>
67 <table>civicrm_contact</table>
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>
80 <foreignKey>
81 <name>contribution_type_id</name>
82 <table>civicrm_contribution_type</table>
83 <key>id</key>
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>
94 <foreignKey>
95 <name>financial_type_id</name>
96 <table>civicrm_financial_type</table>
97 <key>id</key>
98 <add>4.3</add>
99 </foreignKey>
100 <field>
101 <name>minimum_fee</name>
102 <type>decimal</type>
103 <comment>Minimum fee for this membership (0 for free/complimentary memberships).</comment>
104 <default>0</default>
105 <add>1.5</add>
106 </field>
107 <field>
108 <name>duration_unit</name>
109 <type>varchar</type>
110 <length>8</length>
111 <comment>Unit in which membership period is expressed.</comment>
112 <pseudoconstant>
113 <callback>CRM_Core_SelectValues::membershipTypeUnitList</callback>
114 </pseudoconstant>
115 <add>1.5</add>
116 <html>
117 <type>Select</type>
118 </html>
119 </field>
120 <field>
121 <name>duration_interval</name>
122 <type>int</type>
123 <comment>Number of duration units in membership period (e.g. 1 year, 12 months).</comment>
124 <add>1.5</add>
125 </field>
126 <field>
127 <name>period_type</name>
128 <type>varchar</type>
129 <length>8</length>
130 <comment>Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.</comment>
131 <pseudoconstant>
132 <callback>CRM_Core_SelectValues::periodType</callback>
133 </pseudoconstant>
134 <add>1.5</add>
135 </field>
136 <field>
137 <name>fixed_period_start_day</name>
138 <type>int</type>
139 <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>
140 <add>1.5</add>
141 </field>
142 <field>
143 <name>fixed_period_rollover_day</name>
144 <type>int</type>
145 <comment>For fixed period memberships, signups after this day (mmdd) rollover to next period.</comment>
146 <add>1.5</add>
147 </field>
148 <field>
149 <name>relationship_type_id</name>
150 <type>varchar</type>
151 <length>64</length>
152 <comment>FK to Relationship Type ID</comment>
153 <add>1.5</add>
154 </field>
155 <foreignKey>
156 <name>relationship_type_id</name>
157 <table>civicrm_relationship_type</table>
158 <key>id</key>
159 <add>1.5</add>
160 <drop>3.3</drop>
161 </foreignKey>
162 <index>
163 <name>index_relationship_type_id</name>
164 <fieldName>relationship_type_id</fieldName>
165 <add>3.3</add>
166 </index>
167 <field>
168 <name>relationship_direction</name>
169 <type>varchar</type>
170 <length>128</length>
171 <add>1.7</add>
172 </field>
173 <field>
174 <name>max_related</name>
175 <type>int</type>
176 <comment>Maximum number of related memberships.</comment>
177 <add>4.3</add>
178 </field>
179 <field>
180 <name>visibility</name>
181 <title>Visible</title>
182 <type>varchar</type>
183 <length>64</length>
184 <add>1.5</add>
185 <pseudoconstant>
186 <optionGroupName>visibility</optionGroupName>
187 </pseudoconstant>
188 <html>
189 <type>Select</type>
190 </html>
191 </field>
192 <field>
193 <name>weight</name>
194 <title>Weight</title>
195 <type>int</type>
196 <add>1.5</add>
197 </field>
198 <field>
199 <name>receipt_text_signup</name>
200 <type>varchar</type>
201 <html>
202 <type>TextArea</type>
203 <rows>6</rows>
204 <cols>50</cols>
205 </html>
206 <length>255</length>
207 <comment>Receipt Text for membership signup</comment>
208 <add>2.0</add>
209 </field>
210 <field>
211 <name>receipt_text_renewal</name>
212 <type>varchar</type>
213 <html>
214 <type>TextArea</type>
215 <rows>6</rows>
216 <cols>50</cols>
217 </html>
218 <length>255</length>
219 <comment>Receipt Text for membership renewal</comment>
220 <add>2.0</add>
221 </field>
222 <field>
223 <name>auto_renew</name>
224 <type>boolean</type>
225 <default>0</default>
226 <comment>0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;</comment>
227 <add>3.3</add>
228 </field>
229 <field>
230 <name>is_active</name>
231 <title>Is Active</title>
232 <type>boolean</type>
233 <default>1</default>
234 <comment>Is this membership_type enabled</comment>
235 <add>1.5</add>
236 </field>
237 </table>