add pseudoconstants for domain_id
[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 <pseudoconstant>
26 <table>civicrm_domain</table>
27 <keyColumn>id</keyColumn>
28 <labelColumn>name</labelColumn>
29 </pseudoconstant>
30 <comment>Which Domain is this match entry for</comment>
31 <add>3.0</add>
32 </field>
33 <foreignKey>
34 <name>domain_id</name>
35 <table>civicrm_domain</table>
36 <key>id</key>
37 <add>3.0</add>
38 </foreignKey>
39 <field>
40 <name>name</name>
41 <uniqueName>membership_type</uniqueName>
42 <title>Membership Type</title>
43 <type>varchar</type>
44 <import>true</import>
45 <length>128</length>
46 <localizable>true</localizable>
47 <comment>Name of Membership Type</comment>
48 <add>1.5</add>
49 </field>
50 <field>
51 <name>description</name>
52 <type>varchar</type>
53 <html>
54 <type>TextArea</type>
55 <rows>6</rows>
56 <cols>50</cols>
57 </html>
58 <length>255</length>
59 <localizable>true</localizable>
60 <comment>Description of Membership Type</comment>
61 <add>1.5</add>
62 </field>
63 <field>
64 <name>member_of_contact_id</name>
65 <type>int unsigned</type>
66 <required>true</required>
67 <comment>Owner organization for this membership type. FK to Contact ID</comment>
68 <add>1.5</add>
69 </field>
70 <foreignKey>
71 <name>member_of_contact_id</name>
72 <table>civicrm_contact</table>
73 <key>id</key>
74 <add>1.5</add>
75 <onDelete>RESTRICT</onDelete>
76 </foreignKey>
77 <field>
78 <name>contribution_type_id</name>
79 <type>int unsigned</type>
80 <required>true</required>
81 <comment>If membership is paid by a contribution - what contribution type should be used. FK to Contribution Type ID</comment>
82 <add>1.5</add>
83 <drop>4.3</drop>
84 </field>
85 <foreignKey>
86 <name>contribution_type_id</name>
87 <table>civicrm_contribution_type</table>
88 <key>id</key>
89 <add>1.5</add>
90 <drop>4.3</drop>
91 </foreignKey>
92 <field>
93 <name>financial_type_id</name>
94 <type>int unsigned</type>
95 <required>true</required>
96 <pseudoconstant>
97 <table>civicrm_financial_type</table>
98 <keyColumn>id</keyColumn>
99 <labelColumn>name</labelColumn>
100 </pseudoconstant>
101 <comment>If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id</comment>
102 <add>4.3</add>
103 </field>
104 <foreignKey>
105 <name>financial_type_id</name>
106 <table>civicrm_financial_type</table>
107 <key>id</key>
108 <add>4.3</add>
109 </foreignKey>
110 <field>
111 <name>minimum_fee</name>
112 <type>decimal</type>
113 <comment>Minimum fee for this membership (0 for free/complimentary memberships).</comment>
114 <default>0</default>
115 <add>1.5</add>
116 </field>
117 <field>
118 <name>duration_unit</name>
119 <type>varchar</type>
120 <length>8</length>
121 <comment>Unit in which membership period is expressed.</comment>
122 <pseudoconstant>
123 <callback>CRM_Core_SelectValues::membershipTypeUnitList</callback>
124 </pseudoconstant>
125 <add>1.5</add>
126 <html>
127 <type>Select</type>
128 </html>
129 </field>
130 <field>
131 <name>duration_interval</name>
132 <type>int</type>
133 <comment>Number of duration units in membership period (e.g. 1 year, 12 months).</comment>
134 <add>1.5</add>
135 </field>
136 <field>
137 <name>period_type</name>
138 <type>varchar</type>
139 <length>8</length>
140 <comment>Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.</comment>
141 <pseudoconstant>
142 <callback>CRM_Core_SelectValues::periodType</callback>
143 </pseudoconstant>
144 <add>1.5</add>
145 </field>
146 <field>
147 <name>fixed_period_start_day</name>
148 <type>int</type>
149 <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>
150 <add>1.5</add>
151 </field>
152 <field>
153 <name>fixed_period_rollover_day</name>
154 <type>int</type>
155 <comment>For fixed period memberships, signups after this day (mmdd) rollover to next period.</comment>
156 <add>1.5</add>
157 </field>
158 <field>
159 <name>relationship_type_id</name>
160 <type>varchar</type>
161 <length>64</length>
162 <comment>FK to Relationship Type ID</comment>
163 <add>1.5</add>
164 </field>
165 <foreignKey>
166 <name>relationship_type_id</name>
167 <table>civicrm_relationship_type</table>
168 <key>id</key>
169 <add>1.5</add>
170 <drop>3.3</drop>
171 </foreignKey>
172 <index>
173 <name>index_relationship_type_id</name>
174 <fieldName>relationship_type_id</fieldName>
175 <add>3.3</add>
176 </index>
177 <field>
178 <name>relationship_direction</name>
179 <type>varchar</type>
180 <length>128</length>
181 <add>1.7</add>
182 </field>
183 <field>
184 <name>max_related</name>
185 <type>int</type>
186 <comment>Maximum number of related memberships.</comment>
187 <add>4.3</add>
188 </field>
189 <field>
190 <name>visibility</name>
191 <title>Visible</title>
192 <type>varchar</type>
193 <length>64</length>
194 <add>1.5</add>
195 <pseudoconstant>
196 <callback>CRM_Core_SelectValues::memberVisibility</callback>
197 </pseudoconstant>
198 <html>
199 <type>Select</type>
200 </html>
201 </field>
202 <field>
203 <name>weight</name>
204 <title>Weight</title>
205 <type>int</type>
206 <add>1.5</add>
207 </field>
208 <field>
209 <name>receipt_text_signup</name>
210 <type>varchar</type>
211 <html>
212 <type>TextArea</type>
213 <rows>6</rows>
214 <cols>50</cols>
215 </html>
216 <length>255</length>
217 <comment>Receipt Text for membership signup</comment>
218 <add>2.0</add>
219 </field>
220 <field>
221 <name>receipt_text_renewal</name>
222 <type>varchar</type>
223 <html>
224 <type>TextArea</type>
225 <rows>6</rows>
226 <cols>50</cols>
227 </html>
228 <length>255</length>
229 <comment>Receipt Text for membership renewal</comment>
230 <add>2.0</add>
231 </field>
232 <field>
233 <name>auto_renew</name>
234 <type>boolean</type>
235 <default>0</default>
236 <comment>0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;</comment>
237 <add>3.3</add>
238 </field>
239 <field>
240 <name>is_active</name>
241 <title>Is Active</title>
242 <type>boolean</type>
243 <default>1</default>
244 <comment>Is this membership_type enabled</comment>
245 <add>1.5</add>
246 </field>
247 </table>