CRM-14700 - Fix membershipType visibility in schema and tests
[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>
be622aca 109 <type>varchar</type>
110 <length>8</length>
3c7d2158 111 <comment>Unit in which membership period is expressed.</comment>
71a707c3 112 <pseudoconstant>
93bfa565 113 <callback>CRM_Core_SelectValues::membershipTypeUnitList</callback>
71a707c3 114 </pseudoconstant>
3c7d2158 115 <add>1.5</add>
614d72ec 116 <html>
117 <type>Select</type>
118 </html>
3c7d2158 119 </field>
120 <field>
6a488035
TO
121 <name>duration_interval</name>
122 <type>int</type>
3c7d2158 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>
be622aca 128 <type>varchar</type>
129 <length>8</length>
3c7d2158 130 <comment>Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.</comment>
71a707c3 131 <pseudoconstant>
93bfa565 132 <callback>CRM_Core_SelectValues::periodType</callback>
71a707c3 133 </pseudoconstant>
3c7d2158 134 <add>1.5</add>
135 </field>
136 <field>
137 <name>fixed_period_start_day</name>
6a488035 138 <type>int</type>
3c7d2158 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>
6a488035
TO
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>
3c7d2158 155 <foreignKey>
156 <name>relationship_type_id</name>
157 <table>civicrm_relationship_type</table>
158 <key>id</key>
6a488035
TO
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>
3c7d2158 167 <field>
168 <name>relationship_direction</name>
169 <type>varchar</type>
170 <length>128</length>
171 <add>1.7</add>
6a488035
TO
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>
3c7d2158 180 <name>visibility</name>
6a488035
TO
181 <title>Visible</title>
182 <type>varchar</type>
183 <length>64</length>
4080e473
AS
184 <add>1.5</add>
185 <pseudoconstant>
eacf220c 186 <callback>CRM_Core_SelectValues::memberVisibility</callback>
4080e473 187 </pseudoconstant>
614d72ec 188 <html>
e0991796 189 <type>Select</type>
614d72ec 190 </html>
6a488035 191 </field>
3c7d2158 192 <field>
193 <name>weight</name>
6a488035
TO
194 <title>Weight</title>
195 <type>int</type>
3c7d2158 196 <add>1.5</add>
6a488035
TO
197 </field>
198 <field>
199 <name>receipt_text_signup</name>
200 <type>varchar</type>
7deea513 201 <html>
202 <type>TextArea</type>
817807ab 203 <rows>6</rows>
204 <cols>50</cols>
7deea513 205 </html>
6a488035
TO
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>
7deea513 213 <html>
214 <type>TextArea</type>
817807ab 215 <rows>6</rows>
216 <cols>50</cols>
7deea513 217 </html>
6a488035
TO
218 <length>255</length>
219 <comment>Receipt Text for membership renewal</comment>
220 <add>2.0</add>
221 </field>
3c7d2158 222 <field>
223 <name>auto_renew</name>
6a488035
TO
224 <type>boolean</type>
225 <default>0</default>
3c7d2158 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>
6a488035
TO
231 <title>Is Active</title>
232 <type>boolean</type>
233 <default>1</default>
3c7d2158 234 <comment>Is this membership_type enabled</comment>
235 <add>1.5</add>
236 </field>
6a488035 237</table>