mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
aeae0e7028
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
28 lines
758 B
PHP
28 lines
758 B
PHP
<?php
|
|
|
|
$app = PhabricatorApplication::getByClass('PhabricatorProjectApplication');
|
|
|
|
$view_policy = $app->getPolicy(ProjectDefaultViewCapability::CAPABILITY);
|
|
$edit_policy = $app->getPolicy(ProjectDefaultEditCapability::CAPABILITY);
|
|
$join_policy = $app->getPolicy(ProjectDefaultJoinCapability::CAPABILITY);
|
|
|
|
$table = new PhabricatorProject();
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET viewPolicy = %s WHERE viewPolicy IS NULL',
|
|
$table->getTableName(),
|
|
$view_policy);
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET editPolicy = %s WHERE editPolicy IS NULL',
|
|
$table->getTableName(),
|
|
$edit_policy);
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET joinPolicy = %s WHERE joinPolicy IS NULL',
|
|
$table->getTableName(),
|
|
$join_policy);
|