CRM-16176 - schema + templates update - upgrade script missing
[civicrm-core.git] / xml / schema / Contact / RelationshipType.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>RelationshipType</class>
6 <name>civicrm_relationship_type</name>
7 <comment>Relationship types s/b structured with contact_a as the 'subject/child' contact and contact_b as the 'object/parent' contact (e.g. Individual A is Employee of Org B).</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Relationship Type ID</title>
14 <required>true</required>
15 <comment>Primary key</comment>
16 <add>1.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>name_a_b</name>
24 <type>varchar</type>
25 <title>Relationship Type Name A to B</title>
26 <length>64</length>
27 <comment>name for relationship of contact_a to contact_b.</comment>
28 <add>1.1</add>
29 </field>
30 <field>
31 <name>label_a_b</name>
32 <type>varchar</type>
33 <title>Relationship Type Label A to B</title>
34 <length>64</length>
35 <comment>label for relationship of contact_a to contact_b.</comment>
36 <add>3.0</add>
37 <localizable>true</localizable>
38 </field>
39 <field>
40 <name>name_b_a</name>
41 <type>varchar</type>
42 <title>Relationship Type Name B to A</title>
43 <length>64</length>
44 <comment>Optional name for relationship of contact_b to contact_a.</comment>
45 <add>1.1</add>
46 </field>
47 <field>
48 <name>label_b_a</name>
49 <type>varchar</type>
50 <title>Relationship Type Label B to A</title>
51 <length>64</length>
52 <comment>Optional label for relationship of contact_b to contact_a.</comment>
53 <add>3.0</add>
54 <localizable>true</localizable>
55 </field>
56 <field>
57 <name>description</name>
58 <type>varchar</type>
59 <title>Relationship Description</title>
60 <length>255</length>
61 <comment>Optional verbose description of the relationship type.</comment>
62 <add>1.1</add>
63 <localizable>true</localizable>
64 </field>
65 <field>
66 <name>contact_type_a</name>
67 <title>Contact Type for Contact A</title>
68 <type>varchar</type>
69 <length>12</length>
70 <comment>If defined, contact_a in a relationship of this type must be a specific contact_type.</comment>
71 <pseudoconstant>
72 <table>civicrm_contact_type</table>
73 <keyColumn>name</keyColumn>
74 <labelColumn>label</labelColumn>
75 <condition>parent_id IS NULL</condition>
76 </pseudoconstant>
77 <add>1.1</add>
78 <html>
79 <type>Select</type>
80 </html>
81 </field>
82 <field>
83 <name>contact_type_b</name>
84 <title>Contact Type for Contact B</title>
85 <type>varchar</type>
86 <length>12</length>
87 <comment>If defined, contact_b in a relationship of this type must be a specific contact_type.</comment>
88 <pseudoconstant>
89 <table>civicrm_contact_type</table>
90 <keyColumn>name</keyColumn>
91 <labelColumn>label</labelColumn>
92 <condition>parent_id IS NULL</condition>
93 </pseudoconstant>
94 <add>1.1</add>
95 <html>
96 <type>Select</type>
97 </html>
98 </field>
99 <field>
100 <name>contact_sub_type_a</name>
101 <title>Contact Subtype A</title>
102 <type>varchar</type>
103 <length>64</length>
104 <comment>If defined, contact_sub_type_a in a relationship of this type must be a specific contact_sub_type.
105 </comment>
106 <add>3.1</add>
107 <html>
108 <type>Select</type>
109 </html>
110 <pseudoconstant>
111 <table>civicrm_contact_type</table>
112 <keyColumn>name</keyColumn>
113 <labelColumn>label</labelColumn>
114 <condition>parent_id IS NOT NULL</condition>
115 </pseudoconstant>
116 </field>
117 <field>
118 <name>contact_sub_type_b</name>
119 <title>Contact Subtype B</title>
120 <type>varchar</type>
121 <length>64</length>
122 <comment>If defined, contact_sub_type_b in a relationship of this type must be a specific contact_sub_type.
123 </comment>
124 <add>3.1</add>
125 <html>
126 <type>Select</type>
127 </html>
128 <pseudoconstant>
129 <table>civicrm_contact_type</table>
130 <keyColumn>name</keyColumn>
131 <labelColumn>label</labelColumn>
132 <condition>parent_id IS NOT NULL</condition>
133 </pseudoconstant>
134 </field>
135 <field>
136 <name>is_reserved</name>
137 <type>boolean</type>
138 <title>Relationship Type is Reserved</title>
139 <comment>Is this relationship type a predefined system type (can not be changed or de-activated)?</comment>
140 <add>1.1</add>
141 </field>
142 <field>
143 <name>is_active</name>
144 <title>Relationship Type is Active</title>
145 <type>boolean</type>
146 <default>1</default>
147 <comment>Is this relationship type currently active (i.e. can be used when creating or editing relationships)?
148 </comment>
149 <add>1.1</add>
150 </field>
151 <index>
152 <name>UI_name_a_b</name>
153 <fieldName>name_a_b</fieldName>
154 <unique>true</unique>
155 <add>2.1</add>
156 </index>
157 <index>
158 <name>UI_name_b_a</name>
159 <fieldName>name_b_a</fieldName>
160 <unique>true</unique>
161 <add>2.1</add>
162 </index>
163 </table>