CRM-15168 stdise whitespace across schema xml to make editing easier
[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 </field>
45 <foreignKey>
46 <name>contact_id_b</name>
47 <table>civicrm_contact</table>
48 <key>id</key>
49 <add>1.1</add>
50 <onDelete>CASCADE</onDelete>
51 </foreignKey>
52 <field>
53 <name>relationship_type_id</name>
54 <type>int unsigned</type>
55 <title>Relationship Type</title>
56 <required>true</required>
57 <comment>id of the relationship</comment>
58 <add>1.1</add>
59 </field>
60 <foreignKey>
61 <name>relationship_type_id</name>
62 <table>civicrm_relationship_type</table>
63 <key>id</key>
64 <add>1.1</add>
65 <onDelete>CASCADE</onDelete>
66 </foreignKey>
67 <field>
68 <name>start_date</name>
69 <type>date</type>
70 <title>Relationship Start Date</title>
71 <comment>date when the relationship started</comment>
72 <add>1.1</add>
73 </field>
74 <field>
75 <name>end_date</name>
76 <type>date</type>
77 <title>Relationship End Date</title>
78 <comment>date when the relationship ended</comment>
79 <add>1.1</add>
80 </field>
81 <field>
82 <name>is_active</name>
83 <type>boolean</type>
84 <title>Relationship Is Active</title>
85 <default>1</default>
86 <comment>is the relationship active ?</comment>
87 <add>1.1</add>
88 </field>
89 <field>
90 <name>description</name>
91 <type>varchar</type>
92 <title>Relationship Description</title>
93 <length>255</length>
94 <comment>Optional verbose description for the relationship.</comment>
95 <add>1.5</add>
96 </field>
97 <field>
98 <name>is_permission_a_b</name>
99 <type>boolean</type>
100 <title>Contact A has Permission Over Contact B</title>
101 <default>0</default>
102 <comment>is contact a has permission to view / edit contact and
103 related data for contact b ?
104 </comment>
105 <add>2.1</add>
106 </field>
107 <field>
108 <name>is_permission_b_a</name>
109 <type>boolean</type>
110 <title>Contact B has Permission Over Contact A</title>
111 <default>0</default>
112 <comment>is contact b has permission to view / edit contact and
113 related data for contact a ?
114 </comment>
115 <add>2.1</add>
116 </field>
117 <field>
118 <name>case_id</name>
119 <type>int unsigned</type>
120 <title>Relationship Case</title>
121 <default>NULL</default>
122 <comment>FK to civicrm_case</comment>
123 <add>2.2</add>
124 </field>
125 <foreignKey>
126 <name>case_id</name>
127 <table>civicrm_case</table>
128 <key>id</key>
129 <add>2.2</add>
130 <onDelete>CASCADE</onDelete>
131 </foreignKey>
132 </table>