Page MenuHomePhabricator

Move Phriction internal document/content references from IDs to PHIDs
ClosedPublic

Authored by epriestley on Aug 29 2018, 3:18 PM.
Tags
None
Referenced Files
F13275123: D19619.diff
Fri, May 31, 4:25 AM
F13261190: D19619.diff
Mon, May 27, 12:47 AM
F13243714: D19619.diff
Thu, May 23, 4:09 AM
F13224967: D19619.diff
Sun, May 19, 12:26 PM
F13215460: D19619.diff
Fri, May 17, 5:31 PM
F13204675: D19619.diff
Wed, May 15, 12:49 AM
F13192122: D19619.id46903.diff
Sun, May 12, 5:38 AM
F13187736: D19619.diff
Sat, May 11, 4:43 AM
Subscribers
Restricted Owners Package

Details

Summary

Ref T13077. This is mostly just a small cleanup change, even though the actual change is large.

We currently reference content and document objects from one another with contentID and documentID, but this means that contentID must be nullable. Switching to PHIDs allows the column to be non-nullable.

This also supports reorienting some current and future transactions around PHIDs, which is preferable for the API. In particular, I'm adding a "publish version X" transaction soon, and would rather callers pass a PHID than an ID or version number, since this will make the API more consistent and powerful.

Today, contentID gets used as a cheaty way to order documents by (content) edit time. Since PHIDs aren't orderable and stuff is going to become actually-revertible soon, replace this with an epoch timestamp.

Test Plan
  • Created, edited, moved, retitled, and deleted Phriction documents.
  • Grepped for documentID and contentID.
  • This probably breaks something but I'll be in this code for a bit and am likely to catch whatever breaks.

Diff Detail

Repository
rP Phabricator
Branch
phriction4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20704
Build 28142: Run Core Tests
Build 28141: arc lint + arc unit