Merge pull request #22822 from civicrm/5.47
[civicrm-core.git] / xml / schema / Core / File.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>File</class>
6 <name>civicrm_file</name>
7 <comment>Data store for uploaded (attached) files (pointer to file on disk OR blob). Maybe be joined to entities via custom_value.file_id or entity_file table.</comment>
8 <add>1.5</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <title>File ID</title>
14 <required>true</required>
15 <comment>Unique ID</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>file_type_id</name>
27 <type>int unsigned</type>
28 <title>File Type</title>
29 <comment>Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.</comment>
30 <add>1.5</add>
31 </field>
32 <field>
33 <name>mime_type</name>
34 <type>varchar</type>
35 <title>Mime Type</title>
36 <length>255</length>
37 <comment>mime type of the document</comment>
38 <add>1.5</add>
39 </field>
40 <field>
41 <name>uri</name>
42 <type>varchar</type>
43 <title>Path</title>
44 <length>255</length>
45 <comment>uri of the file on disk</comment>
46 <add>1.5</add>
47 </field>
48 <field>
49 <name>document</name>
50 <type>mediumblob</type>
51 <title>File Contents</title>
52 <comment>contents of the document</comment>
53 <add>1.5</add>
54 </field>
55 <field>
56 <name>description</name>
57 <type>varchar</type>
58 <title>File Description</title>
59 <length>255</length>
60 <comment>Additional descriptive text regarding this attachment (optional).</comment>
61 <add>1.5</add>
62 </field>
63 <field>
64 <name>upload_date</name>
65 <type>datetime</type>
66 <title>File Upload Date</title>
67 <comment>Date and time that this attachment was uploaded or written to server.</comment>
68 <add>1.5</add>
69 </field>
70 <field>
71 <name>created_id</name>
72 <type>int unsigned</type>
73 <title>Created By Contact ID</title>
74 <comment>FK to civicrm_contact, who uploaded this file</comment>
75 <html>
76 <label>Created By</label>
77 </html>
78 <add>5.3</add>
79 </field>
80 <foreignKey>
81 <name>created_id</name>
82 <table>civicrm_contact</table>
83 <key>id</key>
84 <add>5.3</add>
85 <onDelete>SET NULL</onDelete>
86 </foreignKey>
87 </table>