Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15414856
D19100.id45766.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
D19100.id45766.diff
View Options
diff --git a/resources/sql/autopatches/20180215.phriction.05.statustext.sql b/resources/sql/autopatches/20180215.phriction.05.statustext.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20180215.phriction.05.statustext.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_phriction.phriction_document
+ CHANGE status status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql b/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20180215.phriction.06.statusvalue.sql
@@ -0,0 +1,11 @@
+UPDATE {$NAMESPACE}_phriction.phriction_document
+ SET status = 'active' WHERE status = '0';
+
+UPDATE {$NAMESPACE}_phriction.phriction_document
+ SET status = 'deleted' WHERE status = '1';
+
+UPDATE {$NAMESPACE}_phriction.phriction_document
+ SET status = 'moved' WHERE status = '2';
+
+UPDATE {$NAMESPACE}_phriction.phriction_document
+ SET status = 'stub' WHERE status = '3';
diff --git a/src/applications/phriction/constants/PhrictionDocumentStatus.php b/src/applications/phriction/constants/PhrictionDocumentStatus.php
--- a/src/applications/phriction/constants/PhrictionDocumentStatus.php
+++ b/src/applications/phriction/constants/PhrictionDocumentStatus.php
@@ -3,10 +3,10 @@
final class PhrictionDocumentStatus
extends PhabricatorObjectStatus {
- const STATUS_EXISTS = 0;
- const STATUS_DELETED = 1;
- const STATUS_MOVED = 2;
- const STATUS_STUB = 3;
+ const STATUS_EXISTS = 'active';
+ const STATUS_DELETED = 'deleted';
+ const STATUS_MOVED = 'moved';
+ const STATUS_STUB = 'stub';
public static function getConduitConstant($const) {
static $map = array(
diff --git a/src/applications/phriction/query/PhrictionDocumentQuery.php b/src/applications/phriction/query/PhrictionDocumentQuery.php
--- a/src/applications/phriction/query/PhrictionDocumentQuery.php
+++ b/src/applications/phriction/query/PhrictionDocumentQuery.php
@@ -196,7 +196,7 @@
if ($this->statuses !== null) {
$where[] = qsprintf(
$conn,
- 'd.status IN (%Ld)',
+ 'd.status IN (%Ls)',
$this->statuses);
}
diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php
--- a/src/applications/phriction/storage/PhrictionDocument.php
+++ b/src/applications/phriction/storage/PhrictionDocument.php
@@ -31,7 +31,7 @@
'slug' => 'sort128',
'depth' => 'uint32',
'contentID' => 'id?',
- 'status' => 'uint32',
+ 'status' => 'text32',
'mailKey' => 'bytes20',
),
self::CONFIG_KEY_SCHEMA => array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 2:49 AM (2 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7472433
Default Alt Text
D19100.id45766.diff (2 KB)
Attached To
Mode
D19100: Give Phriction documents modern string status constants instead of numeric constants
Attached
Detach File
Event Timeline
Log In to Comment