Commit | Line | Data |
---|---|---|
6a488035 TO |
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 ID</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 ID</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 ID</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 ?</comment> | |
104 | <add>2.1</add> | |
105 | </field> | |
106 | <field> | |
107 | <name>is_permission_b_a</name> | |
108 | <type>boolean</type> | |
109 | <title>Contact B has Permission Over Contact A</title> | |
110 | <default>0</default> | |
111 | <comment>is contact b has permission to view / edit contact and | |
112 | related data for contact a ?</comment> | |
113 | <add>2.1</add> | |
114 | </field> | |
115 | <field> | |
116 | <name>case_id</name> | |
117 | <type>int unsigned</type> | |
118 | <title>Relationship Case ID</title> | |
119 | <default>NULL</default> | |
120 | <comment>FK to civicrm_case</comment> | |
121 | <add>2.2</add> | |
122 | </field> | |
3c7d2158 | 123 | <foreignKey> |
124 | <name>case_id</name> | |
125 | <table>civicrm_case</table> | |
126 | <key>id</key> | |
6a488035 TO |
127 | <add>2.2</add> |
128 | <onDelete>CASCADE</onDelete> | |
129 | </foreignKey> | |
130 | </table> |