Page MenuHomePhabricator

Denormalize object IDs into column positions
AbandonedPublic

Authored by epriestley on Aug 7 2014, 7:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:37 PM
Unknown Object (File)
Fri, Apr 12, 8:09 PM
Unknown Object (File)
Sun, Apr 7, 3:34 AM
Unknown Object (File)
Feb 10 2024, 4:32 AM
Unknown Object (File)
Feb 3 2024, 12:23 AM
Unknown Object (File)
Jan 29 2024, 8:51 PM
Unknown Object (File)
Jan 6 2024, 8:17 AM
Unknown Object (File)
Dec 3 2023, 5:07 AM
Subscribers

Details

Summary

Ref T4807. In the next diff, which actually implements "natural" ordering, I need to be able to sort column positions.

Currently, the objects don't have enough information to do this on their own, since the complete ordering is <sequence, objectID> and I think it's desirable to be flexible about sequences being unique.
We could load the attached objects to figure out the objectID part, but this is a huge amount of data which is expensive to query.

Instead, just denormalize object IDs into the column position row. These always exist, are stable, and are easy to denormalize. We can then order all positions purely with the position objects.

(I didn't adjust the key on the table since we don't actually need it to include this column and I don't anticipate changing the query, at least for now.)

Test Plan
  • Ran migration, spot-checked data in DB.
  • Created, edited, and moved tasks.
  • Verified DB remained in the correct state.

Diff Detail

Repository
rP Phabricator
Branch
board3
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2088
Build 2092: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Denormalize object IDs into column positions.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

On further consideration, I'm going to use the ColumnPosition ID instead. In general, this will make objects that are newly added to a board float to the top, instead of the newest objects.

In particular, if an old task is added to a board, it will float to the top. This seems desirable.

The rule is also a little simpler, I think (we don't have to do as much work here, at a minimum).

It does make some things a little bit tricky when moving things, but I think those are easy to finesse around.

src/applications/project/query/PhabricatorProjectColumnPositionQuery.php
209

I'm just going to do this.

D10180 is my replacement for this; I think it implements a simpler and more natural rule.