Merge pull request #21943 from mattwire/gccacheignore
[civicrm-core.git] / xml / schema / Core / EntityFile.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>EntityFile</class>
6 <name>civicrm_entity_file</name>
7 <comment>Attaches (joins) uploaded files (images, documents, etc.) to entities (Contacts, Groups, Actions).</comment>
8 <add>1.5</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <title>Entity File ID</title>
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>primary key</comment>
16 <html>
17 <type>Number</type>
18 </html>
19 <add>1.5</add>
20 </field>
21 <primaryKey>
22 <name>id</name>
23 <autoincrement>true</autoincrement>
24 </primaryKey>
25 <field>
26 <name>entity_table</name>
27 <title>Entity Table</title>
28 <type>varchar</type>
29 <length>64</length>
30 <comment>physical tablename for entity being joined to file, e.g. civicrm_contact</comment>
31 <add>1.5</add>
32 </field>
33 <field>
34 <name>entity_id</name>
35 <title>Entity ID</title>
36 <type>int unsigned</type>
37 <required>true</required>
38 <comment>FK to entity table specified in entity_table column.</comment>
39 <add>1.5</add>
40 </field>
41 <dynamicForeignKey>
42 <idColumn>entity_id</idColumn>
43 <typeColumn>entity_table</typeColumn>
44 <add>1.5</add>
45 </dynamicForeignKey>
46 <field>
47 <name>file_id</name>
48 <title>File ID</title>
49 <type>int unsigned</type>
50 <required>true</required>
51 <comment>FK to civicrm_file</comment>
52 <html>
53 <label>File</label>
54 </html>
55 <add>1.5</add>
56 </field>
57 <foreignKey>
58 <name>file_id</name>
59 <table>civicrm_file</table>
60 <key>id</key>
61 <add>1.5</add>
62 </foreignKey>
63 <index>
64 <name>UI_entity_id_entity_table_file_id</name>
65 <fieldName>entity_id</fieldName>
66 <fieldName>entity_table</fieldName>
67 <fieldName>file_id</fieldName>
68 <unique>true</unique>
69 <add>1.1</add>
70 </index>
71 </table>