Page MenuHomePhabricator

D18555.diff
No OneTemporary

D18555.diff

diff --git a/resources/sql/autopatches/20170907.ferret.04.fund.doc.sql b/resources/sql/autopatches/20170907.ferret.04.fund.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.04.fund.doc.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_fund.fund_initiative_fdocument (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ objectPHID VARBINARY(64) NOT NULL,
+ isClosed BOOL NOT NULL,
+ authorPHID VARBINARY(64),
+ ownerPHID VARBINARY(64),
+ epochCreated INT UNSIGNED NOT NULL,
+ epochModified INT UNSIGNED NOT NULL
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.05.fund.field.sql b/resources/sql/autopatches/20170907.ferret.05.fund.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.05.fund.field.sql
@@ -0,0 +1,8 @@
+CREATE TABLE {$NAMESPACE}_fund.fund_initiative_ffield (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
+ rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.06.fund.ngrams.sql b/resources/sql/autopatches/20170907.ferret.06.fund.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.06.fund.ngrams.sql
@@ -0,0 +1,5 @@
+CREATE TABLE {$NAMESPACE}_fund.fund_initiative_fngrams (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
+) 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
@@ -1153,6 +1153,10 @@
'FundInitiativeEditController' => 'applications/fund/controller/FundInitiativeEditController.php',
'FundInitiativeEditEngine' => 'applications/fund/editor/FundInitiativeEditEngine.php',
'FundInitiativeEditor' => 'applications/fund/editor/FundInitiativeEditor.php',
+ 'FundInitiativeFerretDocument' => 'applications/fund/storage/FundInitiativeFerretDocument.php',
+ 'FundInitiativeFerretEngine' => 'applications/fund/search/FundInitiativeFerretEngine.php',
+ 'FundInitiativeFerretField' => 'applications/fund/storage/FundInitiativeFerretField.php',
+ 'FundInitiativeFerretNgrams' => 'applications/fund/storage/FundInitiativeFerretNgrams.php',
'FundInitiativeFulltextEngine' => 'applications/fund/search/FundInitiativeFulltextEngine.php',
'FundInitiativeListController' => 'applications/fund/controller/FundInitiativeListController.php',
'FundInitiativeMerchantTransaction' => 'applications/fund/xaction/FundInitiativeMerchantTransaction.php',
@@ -6231,6 +6235,7 @@
'PhabricatorTokenReceiverInterface',
'PhabricatorDestructibleInterface',
'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
),
'FundInitiativeBackController' => 'FundController',
'FundInitiativeBackerTransaction' => 'FundInitiativeTransactionType',
@@ -6239,6 +6244,10 @@
'FundInitiativeEditController' => 'FundController',
'FundInitiativeEditEngine' => 'PhabricatorEditEngine',
'FundInitiativeEditor' => 'PhabricatorApplicationTransactionEditor',
+ 'FundInitiativeFerretDocument' => 'PhabricatorFerretDocument',
+ 'FundInitiativeFerretEngine' => 'PhabricatorFerretEngine',
+ 'FundInitiativeFerretField' => 'PhabricatorFerretField',
+ 'FundInitiativeFerretNgrams' => 'PhabricatorFerretNgrams',
'FundInitiativeFulltextEngine' => 'PhabricatorFulltextEngine',
'FundInitiativeListController' => 'FundController',
'FundInitiativeMerchantTransaction' => 'FundInitiativeTransactionType',
diff --git a/src/applications/fund/query/FundInitiativeQuery.php b/src/applications/fund/query/FundInitiativeQuery.php
--- a/src/applications/fund/query/FundInitiativeQuery.php
+++ b/src/applications/fund/query/FundInitiativeQuery.php
@@ -42,28 +42,28 @@
if ($this->ids !== null) {
$where[] = qsprintf(
$conn,
- 'id IN (%Ld)',
+ 'i.id IN (%Ld)',
$this->ids);
}
if ($this->phids !== null) {
$where[] = qsprintf(
$conn,
- 'phid IN (%Ls)',
+ 'i.phid IN (%Ls)',
$this->phids);
}
if ($this->ownerPHIDs !== null) {
$where[] = qsprintf(
$conn,
- 'ownerPHID IN (%Ls)',
+ 'i.ownerPHID IN (%Ls)',
$this->ownerPHIDs);
}
if ($this->statuses !== null) {
$where[] = qsprintf(
$conn,
- 'status IN (%Ls)',
+ 'i.status IN (%Ls)',
$this->statuses);
}
@@ -74,4 +74,8 @@
return 'PhabricatorFundApplication';
}
+ protected function getPrimaryTableAlias() {
+ return 'i';
+ }
+
}
diff --git a/src/applications/fund/search/FundInitiativeFerretEngine.php b/src/applications/fund/search/FundInitiativeFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/fund/search/FundInitiativeFerretEngine.php
@@ -0,0 +1,22 @@
+<?php
+
+final class FundInitiativeFerretEngine
+ extends PhabricatorFerretEngine {
+
+ public function newNgramsObject() {
+ return new FundInitiativeFerretNgrams();
+ }
+
+ public function newDocumentObject() {
+ return new FundInitiativeFerretDocument();
+ }
+
+ public function newFieldObject() {
+ return new FundInitiativeFerretField();
+ }
+
+ public function newSearchEngine() {
+ return new FundInitiativeSearchEngine();
+ }
+
+}
diff --git a/src/applications/fund/storage/FundInitiative.php b/src/applications/fund/storage/FundInitiative.php
--- a/src/applications/fund/storage/FundInitiative.php
+++ b/src/applications/fund/storage/FundInitiative.php
@@ -10,7 +10,8 @@
PhabricatorFlaggableInterface,
PhabricatorTokenReceiverInterface,
PhabricatorDestructibleInterface,
- PhabricatorFulltextInterface {
+ PhabricatorFulltextInterface,
+ PhabricatorFerretInterface {
protected $name;
protected $ownerPHID;
@@ -212,4 +213,12 @@
return new FundInitiativeFulltextEngine();
}
+
+/* -( PhabricatorFerretInterface )----------------------------------------- */
+
+
+ public function newFerretEngine() {
+ return new FundInitiativeFerretEngine();
+ }
+
}
diff --git a/src/applications/fund/storage/FundInitiativeFerretDocument.php b/src/applications/fund/storage/FundInitiativeFerretDocument.php
new file mode 100644
--- /dev/null
+++ b/src/applications/fund/storage/FundInitiativeFerretDocument.php
@@ -0,0 +1,14 @@
+<?php
+
+final class FundInitiativeFerretDocument
+ extends PhabricatorFerretDocument {
+
+ public function getApplicationName() {
+ return 'fund';
+ }
+
+ public function getIndexKey() {
+ return 'initiative';
+ }
+
+}
diff --git a/src/applications/fund/storage/FundInitiativeFerretField.php b/src/applications/fund/storage/FundInitiativeFerretField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/fund/storage/FundInitiativeFerretField.php
@@ -0,0 +1,14 @@
+<?php
+
+final class FundInitiativeFerretField
+ extends PhabricatorFerretField {
+
+ public function getApplicationName() {
+ return 'fund';
+ }
+
+ public function getIndexKey() {
+ return 'initiative';
+ }
+
+}
diff --git a/src/applications/fund/storage/FundInitiativeFerretNgrams.php b/src/applications/fund/storage/FundInitiativeFerretNgrams.php
new file mode 100644
--- /dev/null
+++ b/src/applications/fund/storage/FundInitiativeFerretNgrams.php
@@ -0,0 +1,14 @@
+<?php
+
+final class FundInitiativeFerretNgrams
+ extends PhabricatorFerretNgrams {
+
+ public function getApplicationName() {
+ return 'fund';
+ }
+
+ public function getIndexKey() {
+ return 'initiative';
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 15, 5:18 AM (1 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7597220
Default Alt Text
D18555.diff (7 KB)

Event Timeline