1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 10:52:41 +01:00
phorge-phorge/resources/sql/autopatches/20151219.proj.10.subcolumns.sql
epriestley aeae0e7028 Prepare Projects schema for subprojects
Summary:
Ref T10010. This does some cleanups on the schema:

  - `viewPolicy`, `editPolicy` and `joinPolicy` were nullable, but should never be `null`. Set them to defaults if they're null, then make the column non-nullable.
  - Rename `phrictionSlug` to `primarySlug` and stop adding and removing trailing slashes from it.
  - Add new columns to support milestones and non-milestone subprojects.
  - Drop very old subprojectPHIDs column. This hasn't done anything in the UI for years and years, and isn't particularly realistic to migrate forward.

The new columns aren't reachable from the UI.

Test Plan:
  - Applied patches.
  - Grepped for `phrictionSlug`.
  - Grepped for `subprojectPHIDs`.
  - Created tasks.
  - Edited tasks.
  - Verified existing tasks still had primary slugs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D14825
2015-12-19 09:21:36 -08:00

17 lines
502 B
SQL

ALTER TABLE {$NAMESPACE}_project.project
ADD parentProjectPHID VARBINARY(64);
ALTER TABLE {$NAMESPACE}_project.project
ADD hasWorkboard BOOL NOT NULL;
ALTER TABLE {$NAMESPACE}_project.project
ADD hasMilestones BOOL NOT NULL;
ALTER TABLE {$NAMESPACE}_project.project
ADD hasSubprojects BOOL NOT NULL;
ALTER TABLE {$NAMESPACE}_project.project
ADD milestoneNumber INT UNSIGNED;
ALTER TABLE {$NAMESPACE}_project.project
ADD UNIQUE KEY `key_milestone` (parentProjectPHID, milestoneNumber);