Merge pull request #23052 from konadave/r25088
[civicrm-core.git] / xml / schema / Core / File.xml
CommitLineData
6a488035
TO
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>
e9986910 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>
6a488035
TO
8 <add>1.5</add>
9 <log>true</log>
10 <field>
8f069c03
EM
11 <name>id</name>
12 <type>int unsigned</type>
56b7523d 13 <title>File ID</title>
8f069c03
EM
14 <required>true</required>
15 <comment>Unique ID</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
EM
26 <name>file_type_id</name>
27 <type>int unsigned</type>
56b7523d 28 <title>File Type</title>
8f069c03
EM
29 <comment>Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.</comment>
30 <add>1.5</add>
6a488035
TO
31 </field>
32 <field>
8f069c03
EM
33 <name>mime_type</name>
34 <type>varchar</type>
56b7523d 35 <title>Mime Type</title>
8f069c03
EM
36 <length>255</length>
37 <comment>mime type of the document</comment>
38 <add>1.5</add>
6a488035
TO
39 </field>
40 <field>
8f069c03
EM
41 <name>uri</name>
42 <type>varchar</type>
56b7523d 43 <title>Path</title>
8f069c03
EM
44 <length>255</length>
45 <comment>uri of the file on disk</comment>
46 <add>1.5</add>
6a488035
TO
47 </field>
48 <field>
8f069c03
EM
49 <name>document</name>
50 <type>mediumblob</type>
56b7523d 51 <title>File Contents</title>
8f069c03
EM
52 <comment>contents of the document</comment>
53 <add>1.5</add>
6a488035
TO
54 </field>
55 <field>
8f069c03
EM
56 <name>description</name>
57 <type>varchar</type>
56b7523d 58 <title>File Description</title>
8f069c03
EM
59 <length>255</length>
60 <comment>Additional descriptive text regarding this attachment (optional).</comment>
61 <add>1.5</add>
6a488035
TO
62 </field>
63 <field>
8f069c03
EM
64 <name>upload_date</name>
65 <type>datetime</type>
56b7523d 66 <title>File Upload Date</title>
8f069c03
EM
67 <comment>Date and time that this attachment was uploaded or written to server.</comment>
68 <add>1.5</add>
6a488035 69 </field>
c3438d19
DA
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>
57e94608
A
75 <html>
76 <label>Created By</label>
77 </html>
ae2c7e00 78 <add>5.3</add>
c3438d19
DA
79 </field>
80 <foreignKey>
81 <name>created_id</name>
82 <table>civicrm_contact</table>
83 <key>id</key>
ae2c7e00 84 <add>5.3</add>
c3438d19
DA
85 <onDelete>SET NULL</onDelete>
86 </foreignKey>
6a488035 87</table>