Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-11-09-14-08-33
[civicrm-core.git] / xml / schema / Contact / Relationship.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Contact</base>
5 <class>Relationship</class>
6 <name>civicrm_relationship</name>
7 <comment>Relationship between any 2 types of contacts.</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>Relationship ID</title>
14 <required>true</required>
15 <comment>Relationship ID</comment>
16 <add>1.1</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22 <field>
23 <name>contact_id_a</name>
24 <type>int unsigned</type>
25 <title>Contact A</title>
26 <required>true</required>
27 <comment>id of the first contact</comment>
28 <add>1.1</add>
29 </field>
30 <foreignKey>
31 <name>contact_id_a</name>
32 <table>civicrm_contact</table>
33 <key>id</key>
34 <add>1.1</add>
35 <onDelete>CASCADE</onDelete>
36 </foreignKey>
37 <field>
38 <name>contact_id_b</name>
39 <type>int unsigned</type>
40 <title>Contact B</title>
41 <required>true</required>
42 <comment>id of the second contact</comment>
43 <add>1.1</add>
44 <html>
45 <type>EntityRef</type>
46 </html>
47 </field>
48 <foreignKey>
49 <name>contact_id_b</name>
50 <table>civicrm_contact</table>
51 <key>id</key>
52 <add>1.1</add>
53 <onDelete>CASCADE</onDelete>
54 </foreignKey>
55 <field>
56 <name>relationship_type_id</name>
57 <type>int unsigned</type>
58 <title>Relationship Type</title>
59 <required>true</required>
60 <comment>id of the relationship</comment>
61 <add>1.1</add>
62 <html>
63 <type>Select</type>
64 </html>
65 </field>
66 <foreignKey>
67 <name>relationship_type_id</name>
68 <table>civicrm_relationship_type</table>
69 <key>id</key>
70 <add>1.1</add>
71 <onDelete>CASCADE</onDelete>
72 </foreignKey>
73 <field>
74 <name>start_date</name>
75 <type>date</type>
76 <title>Relationship Start Date</title>
77 <comment>date when the relationship started</comment>
78 <add>1.1</add>
79 <html>
80 <type>Select Date</type>
81 </html>
82 </field>
83 <field>
84 <name>end_date</name>
85 <type>date</type>
86 <title>Relationship End Date</title>
87 <comment>date when the relationship ended</comment>
88 <add>1.1</add>
89 <html>
90 <type>Select Date</type>
91 </html>
92 </field>
93 <field>
94 <name>is_active</name>
95 <type>boolean</type>
96 <title>Relationship Is Active</title>
97 <default>1</default>
98 <comment>is the relationship active ?</comment>
99 <add>1.1</add>
100 <html>
101 <type>CheckBox</type>
102 </html>
103 </field>
104 <field>
105 <name>description</name>
106 <type>varchar</type>
107 <title>Relationship Description</title>
108 <length>255</length>
109 <comment>Optional verbose description for the relationship.</comment>
110 <add>1.5</add>
111 <html>
112 <type>Text</type>
113 </html>
114 </field>
115 <field>
116 <name>is_permission_a_b</name>
117 <type>boolean</type>
118 <title>Contact A has Permission Over Contact B</title>
119 <default>0</default>
120 <comment>is contact a has permission to view / edit contact and
121 related data for contact b ?
122 </comment>
123 <add>2.1</add>
124 <html>
125 <type>CheckBox</type>
126 </html>
127 </field>
128 <field>
129 <name>is_permission_b_a</name>
130 <type>boolean</type>
131 <title>Contact B has Permission Over Contact A</title>
132 <default>0</default>
133 <comment>is contact b has permission to view / edit contact and
134 related data for contact a ?
135 </comment>
136 <add>2.1</add>
137 <html>
138 <type>CheckBox</type>
139 </html>
140 </field>
141 <field>
142 <name>case_id</name>
143 <type>int unsigned</type>
144 <title>Relationship Case</title>
145 <default>NULL</default>
146 <comment>FK to civicrm_case</comment>
147 <add>2.2</add>
148 </field>
149 <foreignKey>
150 <name>case_id</name>
151 <table>civicrm_case</table>
152 <key>id</key>
153 <add>2.2</add>
154 <onDelete>CASCADE</onDelete>
155 </foreignKey>
156 </table>