Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14702018
D21813.id51990.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21813.id51990.diff
View Options
diff --git a/resources/sql/autopatches/20220510.file.01.attach.sql b/resources/sql/autopatches/20220510.file.01.attach.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20220510.file.01.attach.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_file.file_attachment (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ objectPHID VARBINARY(64) NOT NULL,
+ filePHID VARBINARY(64) NOT NULL,
+ attacherPHID VARBINARY(64),
+ attachmentMode VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT},
+ dateCreated INT UNSIGNED NOT NULL,
+ dateModified INT UNSIGNED NOT NULL
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3451,6 +3451,7 @@
'PhabricatorFile' => 'applications/files/storage/PhabricatorFile.php',
'PhabricatorFileAES256StorageFormat' => 'applications/files/format/PhabricatorFileAES256StorageFormat.php',
'PhabricatorFileAltTextTransaction' => 'applications/files/xaction/PhabricatorFileAltTextTransaction.php',
+ 'PhabricatorFileAttachment' => 'applications/files/storage/PhabricatorFileAttachment.php',
'PhabricatorFileBundleLoader' => 'applications/files/query/PhabricatorFileBundleLoader.php',
'PhabricatorFileChunk' => 'applications/files/storage/PhabricatorFileChunk.php',
'PhabricatorFileChunkIterator' => 'applications/files/engine/PhabricatorFileChunkIterator.php',
@@ -9890,6 +9891,7 @@
),
'PhabricatorFileAES256StorageFormat' => 'PhabricatorFileStorageFormat',
'PhabricatorFileAltTextTransaction' => 'PhabricatorFileTransactionType',
+ 'PhabricatorFileAttachment' => 'PhabricatorFileDAO',
'PhabricatorFileBundleLoader' => 'Phobject',
'PhabricatorFileChunk' => array(
'PhabricatorFileDAO',
diff --git a/src/applications/files/storage/PhabricatorFileAttachment.php b/src/applications/files/storage/PhabricatorFileAttachment.php
new file mode 100644
--- /dev/null
+++ b/src/applications/files/storage/PhabricatorFileAttachment.php
@@ -0,0 +1,31 @@
+<?php
+
+final class PhabricatorFileAttachment
+ extends PhabricatorFileDAO {
+
+ protected $objectPHID;
+ protected $filePHID;
+ protected $attacherPHID;
+ protected $attachmentMode;
+
+ protected function getConfiguration() {
+ return array(
+ self::CONFIG_COLUMN_SCHEMA => array(
+ 'objectPHID' => 'phid',
+ 'filePHID' => 'phid',
+ 'attacherPHID' => 'phid?',
+ 'attachmentMode' => 'text32',
+ ),
+ self::CONFIG_KEY_SCHEMA => array(
+ 'key_object' => array(
+ 'columns' => array('objectPHID', 'filePHID'),
+ 'unique' => true,
+ ),
+ 'key_file' => array(
+ 'columns' => array('filePHID'),
+ ),
+ ),
+ ) + parent::getConfiguration();
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 4:18 AM (16 h, 7 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6995974
Default Alt Text
D21813.id51990.diff (2 KB)
Attached To
Mode
D21813: Add database storage for a dedicated file attachment table
Attached
Detach File
Event Timeline
Log In to Comment