1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00
phorge-phorge/resources/sql/autopatches/20140808.boardprop.3.php
epriestley 24a6eeb8d8 Allow the workboard backlog column to be reordered
Summary:
Fixes T5677.

  - Instead of using `sequence == 0` to mean "this is the backlog column", flag the column explicitly.
  - Migrate existing sequence 0 columns to have the flag.
  - Add the flag when initializing or copying a board.
  - Remove special backlog logic when reordering columns.

Test Plan:
  - Migrated columns, viewed some boards, they looked identical.
  - Reordered the backlog column a bunch of times (first, last, middle, dragged other stuff around).
  - Added tasks to a project, saw them show up in the reordered backlog.
  - Initialized a new board and saw a backlog column show up.
  - Copied an existing board and saw the backlog column come over.
  - Tried to hide a backlog column.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5677

Differential Revision: https://secure.phabricator.com/D10189
2014-08-08 15:50:36 -07:00

24 lines
513 B
PHP

<?php
$table = new PhabricatorProjectColumn();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $column) {
$id = $column->getID();
echo "Adjusting column {$id}...\n";
if ($column->getSequence() == 0) {
$properties = $column->getProperties();
$properties['isDefault'] = true;
queryfx(
$conn_w,
'UPDATE %T SET properties = %s WHERE id = %d',
$table->getTableName(),
json_encode($properties),
$id);
}
}
echo "Done.\n";