Homec4science

Migrate all Differential comment text into new storage

Authored by epriestley <git@epriestley.com> on Feb 11 2014, 20:34.

Description

Migrate all Differential comment text into new storage

Summary:
Ref T2222. Currently, DifferentialComment stores both (a) the text of comments and (b) various other transaction details. This data needs to map to both Transactions and TransactionComments in the long run. This diff separates out all the data which is bound for the TransactionComment table, so that when we migrate DifferentialComment itself it will only need to migrate into the Transactions table. This is a much simpler migration than the inline comment one was, partly because it set up infrastructure and partly because the data is less complex.

Basically, I'm just proxying the read/write for the comment text into the other table. All readers already go through the Query class, and there are only three writers (preview, comment, implicit comment on diff update) which are all highly regular and straightforward to test.

We can also back out of this diff very easily: doing double writes cost only one line of code ($this->content = $content;) so we have proper double writes and a trivial revert path.

Test Plan:

  • Without migrating, added comments and saw them show up.
  • Migrated.
  • Saw all the old comments, and no damage to the new ones.
  • Added new comments.
  • Used comment preview.
  • Updated a revision to implicitly create an update comment and verified it looked OK.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8196

Details

Committed
epriestley <git@epriestley.com>Feb 11 2014, 20:34
Pushed
aubortJan 31 2017, 17:16
Parents
rPH3a01d6dae516: Fix project editing issue with moving wikis
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH305fb3fbd9c1: Migrate all Differential comment text into new storage (authored by epriestley <git@epriestley.com>).Feb 11 2014, 20:34