Merge pull request #15693 from eileenmcnaughton/log_date
[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 <uniqueName>relationship_start_date</uniqueName>
76 <type>date</type>
77 <title>Relationship Start Date</title>
78 <comment>date when the relationship started</comment>
79 <add>1.1</add>
80 <html>
81 <type>Select Date</type>
82 <formatType>activityDate</formatType>
83 </html>
84 </field>
85 <field>
86 <name>end_date</name>
87 <uniqueName>relationship_end_date</uniqueName>
88 <type>date</type>
89 <title>Relationship End Date</title>
90 <comment>date when the relationship ended</comment>
91 <add>1.1</add>
92 <html>
93 <type>Select Date</type>
94 <formatType>activityDate</formatType>
95 </html>
96 </field>
97 <field>
98 <name>is_active</name>
99 <type>boolean</type>
100 <title>Relationship Is Active</title>
101 <default>1</default>
102 <comment>is the relationship active ?</comment>
103 <add>1.1</add>
104 <html>
105 <type>CheckBox</type>
106 </html>
107 </field>
108 <field>
109 <name>description</name>
110 <type>varchar</type>
111 <title>Relationship Description</title>
112 <length>255</length>
113 <comment>Optional verbose description for the relationship.</comment>
114 <add>1.5</add>
115 <html>
116 <type>Text</type>
117 </html>
118 </field>
119 <field>
120 <name>is_permission_a_b</name>
121 <type>int unsigned</type>
122 <title>Contact A has Permission Over Contact B</title>
123 <required>true</required>
124 <default>0</default>
125 <comment>Permission that Contact A has to view/update Contact B</comment>
126 <add>2.1</add>
127 <pseudoconstant>
128 <callback>CRM_Core_SelectValues::getPermissionedRelationshipOptions</callback>
129 </pseudoconstant>
130 <html>
131 <type>Radio</type>
132 </html>
133 </field>
134 <field>
135 <name>is_permission_b_a</name>
136 <type>int unsigned</type>
137 <title>Contact B has Permission Over Contact A</title>
138 <required>true</required>
139 <default>0</default>
140 <comment>Permission that Contact B has to view/update Contact A</comment>
141 <add>2.1</add>
142 <pseudoconstant>
143 <callback>CRM_Core_SelectValues::getPermissionedRelationshipOptions</callback>
144 </pseudoconstant>
145 <html>
146 <type>Radio</type>
147 </html>
148 </field>
149 <field>
150 <name>case_id</name>
151 <type>int unsigned</type>
152 <title>Relationship Case</title>
153 <default>NULL</default>
154 <comment>FK to civicrm_case</comment>
155 <add>2.2</add>
156 </field>
157 <foreignKey>
158 <name>case_id</name>
159 <table>civicrm_case</table>
160 <key>id</key>
161 <add>2.2</add>
162 <onDelete>CASCADE</onDelete>
163 </foreignKey>
164 </table>