Allow owners paths to be arbitrarily long and add storage for display paths

Summary:
Depends on D19182. Ref T11015. This changes `path` from `text255` to `longtext` because paths may be arbitrarily long.

It adds `pathDisplay` to prepare for display paths and storage paths having different values. For now, `pathDisplay` is copied from `path` and always has the same value.

Test Plan:
  - Ran migration, checked database for sanity (all `pathDisplay` and `path` values identical).
  - Added new paths, saw `pathDisplay` and `path` get the same values.
  - Added an unreasonably enormous path with far more than 255 characters.

Maniphest Tasks: T11015

Differential Revision: https://secure.phabricator.com/D19183
This commit is contained in:
epriestley
2018-03-06 19:50:09 -08:00
parent 8cb273a053
commit adde4089b4
4 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_owners.owners_path
CHANGE path path LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};

View File

@@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_owners.owners_path
ADD pathDisplay LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};

View File

@@ -0,0 +1,2 @@
UPDATE {$NAMESPACE}_owners.owners_path
SET pathDisplay = path WHERE pathDisplay = '';