Merge pull request #17068 from colemanw/currentPath
[civicrm-core.git] / xml / schema / Core / File.xml
index d8beb0ef5580c2fd8113510b2fa77dd028557df5..925e1f64893de551c1d77dddc882890509fbdcd2 100644 (file)
@@ -8,53 +8,74 @@
   <add>1.5</add>
   <log>true</log>
   <field>
-      <name>id</name>
-      <type>int unsigned</type>
-      <required>true</required>
-      <comment>Unique ID</comment>
-      <add>1.5</add>
+    <name>id</name>
+    <type>int unsigned</type>
+    <title>File ID</title>
+    <required>true</required>
+    <comment>Unique ID</comment>
+    <add>1.5</add>
   </field>
   <primaryKey>
-       <name>id</name>
-       <autoincrement>true</autoincrement>
+    <name>id</name>
+    <autoincrement>true</autoincrement>
   </primaryKey>
   <field>
-      <name>file_type_id</name>
-      <type>int unsigned</type>
-      <comment>Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.</comment>
-      <add>1.5</add>
+    <name>file_type_id</name>
+    <type>int unsigned</type>
+    <title>File Type</title>
+    <comment>Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.</comment>
+    <add>1.5</add>
   </field>
   <field>
-     <name>mime_type</name>
-     <type>varchar</type>
-     <length>255</length>
-     <comment>mime type of the document</comment>
-     <add>1.5</add>
+    <name>mime_type</name>
+    <type>varchar</type>
+    <title>Mime Type</title>
+    <length>255</length>
+    <comment>mime type of the document</comment>
+    <add>1.5</add>
   </field>
   <field>
-     <name>uri</name>
-     <type>varchar</type>
-     <length>255</length>
-     <comment>uri of the file on disk</comment>
-     <add>1.5</add>
+    <name>uri</name>
+    <type>varchar</type>
+    <title>Path</title>
+    <length>255</length>
+    <comment>uri of the file on disk</comment>
+    <add>1.5</add>
   </field>
   <field>
-     <name>document</name>
-     <type>mediumblob</type>
-     <comment>contents of the document</comment>
-     <add>1.5</add>
+    <name>document</name>
+    <type>mediumblob</type>
+    <title>File Contents</title>
+    <comment>contents of the document</comment>
+    <add>1.5</add>
   </field>
   <field>
-       <name>description</name>
-       <type>varchar</type>
-       <length>255</length>
-       <comment>Additional descriptive text regarding this attachment (optional).</comment>
-      <add>1.5</add>
+    <name>description</name>
+    <type>varchar</type>
+    <title>File Description</title>
+    <length>255</length>
+    <comment>Additional descriptive text regarding this attachment (optional).</comment>
+    <add>1.5</add>
   </field>
   <field>
-       <name>upload_date</name>
-       <type>datetime</type>
-       <comment>Date and time that this attachment was uploaded or written to server.</comment>
-       <add>1.5</add>
+    <name>upload_date</name>
+    <type>datetime</type>
+    <title>File Upload Date</title>
+    <comment>Date and time that this attachment was uploaded or written to server.</comment>
+    <add>1.5</add>
   </field>
+  <field>
+    <name>created_id</name>
+    <type>int unsigned</type>
+    <title>Created By Contact ID</title>
+    <comment>FK to civicrm_contact, who uploaded this file</comment>
+    <add>5.3</add>
+  </field>
+  <foreignKey>
+    <name>created_id</name>
+    <table>civicrm_contact</table>
+    <key>id</key>
+    <add>5.3</add>
+    <onDelete>SET NULL</onDelete>
+  </foreignKey>
 </table>