Merge pull request #23274 from civicrm/5.49
[civicrm-core.git] / xml / schema / Core / EntityFile.xml
CommitLineData
6a488035
TO
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>
8f069c03 7 <comment>Attaches (joins) uploaded files (images, documents, etc.) to entities (Contacts, Groups, Actions).</comment>
929a1c14 8 <add>1.5</add>
6a488035
TO
9 <log>true</log>
10 <field>
8f069c03 11 <name>id</name>
f3ea5182 12 <title>Entity File ID</title>
8f069c03
EM
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>primary key</comment>
0481e12c
A
16 <html>
17 <type>Number</type>
18 </html>
8f069c03 19 <add>1.5</add>
6a488035
TO
20 </field>
21 <primaryKey>
8f069c03
EM
22 <name>id</name>
23 <autoincrement>true</autoincrement>
6a488035
TO
24 </primaryKey>
25 <field>
8f069c03 26 <name>entity_table</name>
f3ea5182 27 <title>Entity Table</title>
8f069c03
EM
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>
6a488035
TO
32 </field>
33 <field>
8f069c03 34 <name>entity_id</name>
f3ea5182 35 <title>Entity ID</title>
8f069c03
EM
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>
6a488035 40 </field>
71e5aa5c 41 <dynamicForeignKey>
8f069c03
EM
42 <idColumn>entity_id</idColumn>
43 <typeColumn>entity_table</typeColumn>
44 <add>1.5</add>
71e5aa5c 45 </dynamicForeignKey>
6a488035 46 <field>
8f069c03 47 <name>file_id</name>
57e94608 48 <title>File ID</title>
8f069c03
EM
49 <type>int unsigned</type>
50 <required>true</required>
51 <comment>FK to civicrm_file</comment>
57e94608
A
52 <html>
53 <label>File</label>
54 </html>
8f069c03 55 <add>1.5</add>
6a488035
TO
56 </field>
57 <foreignKey>
8f069c03
EM
58 <name>file_id</name>
59 <table>civicrm_file</table>
60 <key>id</key>
61 <add>1.5</add>
6a488035
TO
62 </foreignKey>
63 <index>
90dcf8f8 64 <name>UI_entity_id_entity_table_file_id</name>
8f069c03 65 <fieldName>entity_id</fieldName>
90dcf8f8 66 <fieldName>entity_table</fieldName>
8f069c03 67 <fieldName>file_id</fieldName>
8506cda6 68 <unique>true</unique>
8f069c03 69 <add>1.1</add>
6a488035
TO
70 </index>
71</table>