From f55aac49f4d7aab895fee1736b92eb6ac68f1431 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Jul 2019 10:31:52 -0700 Subject: [PATCH] Rename "pastebin" database to "paste" Summary: See D20650. Long ago, this got added as "pastebin", but that's the name of another product/company, not a generic term for paste storage. Rename the database to `phabricator_paste`. (An alternate version of this patch would rename `phabricator_search` to `phabricator_bing`, `phabricator_countdown` to `phabricator_spacex`, `phabricator_pholio` to `phabricator_adobe_photoshop`, etc.) Test Plan: - Grepped for `pastebin`, now only found references in old patches. - Applied patches. - Browsed around Paste in the UI without encountering issues. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Differential Revision: https://secure.phabricator.com/D20661 --- resources/sql/autopatches/20190718.paste.01.edge.sql | 2 ++ resources/sql/autopatches/20190718.paste.02.edgedata.sql | 2 ++ resources/sql/autopatches/20190718.paste.03.paste.sql | 2 ++ resources/sql/autopatches/20190718.paste.04.xaction.sql | 2 ++ resources/sql/autopatches/20190718.paste.05.comment.sql | 2 ++ src/applications/paste/storage/PhabricatorPasteDAO.php | 2 +- .../paste/storage/PhabricatorPasteTransaction.php | 2 +- .../storage/patch/PhabricatorBuiltinPatchList.php | 5 ++++- 8 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 resources/sql/autopatches/20190718.paste.01.edge.sql create mode 100644 resources/sql/autopatches/20190718.paste.02.edgedata.sql create mode 100644 resources/sql/autopatches/20190718.paste.03.paste.sql create mode 100644 resources/sql/autopatches/20190718.paste.04.xaction.sql create mode 100644 resources/sql/autopatches/20190718.paste.05.comment.sql diff --git a/resources/sql/autopatches/20190718.paste.01.edge.sql b/resources/sql/autopatches/20190718.paste.01.edge.sql new file mode 100644 index 0000000000..ba138a3b92 --- /dev/null +++ b/resources/sql/autopatches/20190718.paste.01.edge.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_pastebin.edge + TO {$NAMESPACE}_paste.edge; diff --git a/resources/sql/autopatches/20190718.paste.02.edgedata.sql b/resources/sql/autopatches/20190718.paste.02.edgedata.sql new file mode 100644 index 0000000000..18b0c3ff4e --- /dev/null +++ b/resources/sql/autopatches/20190718.paste.02.edgedata.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_pastebin.edgedata + TO {$NAMESPACE}_paste.edgedata; diff --git a/resources/sql/autopatches/20190718.paste.03.paste.sql b/resources/sql/autopatches/20190718.paste.03.paste.sql new file mode 100644 index 0000000000..cc8d100773 --- /dev/null +++ b/resources/sql/autopatches/20190718.paste.03.paste.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_pastebin.pastebin_paste + TO {$NAMESPACE}_paste.paste; diff --git a/resources/sql/autopatches/20190718.paste.04.xaction.sql b/resources/sql/autopatches/20190718.paste.04.xaction.sql new file mode 100644 index 0000000000..5ebfcdfeaf --- /dev/null +++ b/resources/sql/autopatches/20190718.paste.04.xaction.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_pastebin.pastebin_pastetransaction + TO {$NAMESPACE}_paste.paste_transaction; diff --git a/resources/sql/autopatches/20190718.paste.05.comment.sql b/resources/sql/autopatches/20190718.paste.05.comment.sql new file mode 100644 index 0000000000..0221d0f668 --- /dev/null +++ b/resources/sql/autopatches/20190718.paste.05.comment.sql @@ -0,0 +1,2 @@ +RENAME TABLE {$NAMESPACE}_pastebin.pastebin_pastetransaction_comment + TO {$NAMESPACE}_paste.paste_transaction_comment; diff --git a/src/applications/paste/storage/PhabricatorPasteDAO.php b/src/applications/paste/storage/PhabricatorPasteDAO.php index dd61ff7920..0decb81055 100644 --- a/src/applications/paste/storage/PhabricatorPasteDAO.php +++ b/src/applications/paste/storage/PhabricatorPasteDAO.php @@ -3,7 +3,7 @@ abstract class PhabricatorPasteDAO extends PhabricatorLiskDAO { public function getApplicationName() { - return 'pastebin'; + return 'paste'; } } diff --git a/src/applications/paste/storage/PhabricatorPasteTransaction.php b/src/applications/paste/storage/PhabricatorPasteTransaction.php index 1cd77a7048..18bf984259 100644 --- a/src/applications/paste/storage/PhabricatorPasteTransaction.php +++ b/src/applications/paste/storage/PhabricatorPasteTransaction.php @@ -8,7 +8,7 @@ final class PhabricatorPasteTransaction const MAILTAG_COMMENT = 'paste-comment'; public function getApplicationName() { - return 'pastebin'; + return 'paste'; } public function getApplicationTransactionType() { diff --git a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php index 2d5245459b..8adcfa64df 100644 --- a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php +++ b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php @@ -67,7 +67,9 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { 'db.metamta' => array(), 'db.oauth_server' => array(), 'db.owners' => array(), - 'db.pastebin' => array(), + 'db.pastebin' => array( + 'dead' => true, + ), 'db.phame' => array(), 'db.phriction' => array(), 'db.project' => array(), @@ -113,6 +115,7 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { 'db.badges' => array(), 'db.packages' => array(), 'db.application' => array(), + 'db.paste' => array(), '0000.legacy.sql' => array( 'legacy' => 0, ),