Deck 1.18 added a start date to cards (Card::$startdate), so a workflow
no longer has to mean "overdue". Each rule now carries a date_field
('due' | 'start'), chosen in the settings form next to board and stacks.
Existing rules keep the due date: the new column's default supplies it
for every stored row, so there is no backfill step, and
Workflow::getDateFieldOrDue() covers entities that were never near the
database as well as hand-edited values. The controller is the one place
that rejects an unknown value instead of normalising it - a client
asking for a rule it would not get should hear about it.
The probe for the field is property_exists(), not method_exists():
Deck's entities declare no getter as real code - getStartdate(),
getDuedate(), even getId() all go through Entity::__call(), which
method_exists() ignores by definition. A method_exists() guard would
have been false on every Deck version and would have turned every
start-date rule into a silent no-op.
assertDeckAvailable() now also refuses Deck older than 1.18.0. That
floor cannot live in appinfo/info.xml - neither the server's nor the app
store's schema has an app-to-app dependency element - but
<nextcloud min-version="34"> already implies it, since 1.18.x is the
only Deck release line published for Nextcloud 34.
isOverdue() becomes hasPassed(): one function for both dates, since the
comparison and the argument against Deck's day-truncating
getDaysUntilDue() are identical for either.
Also carries a pending NcSelect icon-alignment fix that was already in
the working tree.
Bump to 34.1.0.
48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\WorkflowDeckAutomation\Migration;
|
|
|
|
use Closure;
|
|
use OCA\WorkflowDeckAutomation\Db\Workflow;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
/**
|
|
* Adds the per-workflow choice between Deck's due date and its start date.
|
|
*
|
|
* A separate migration rather than an edit to Version1000...: that one is
|
|
* wrapped in `if (!$schema->hasTable(...))`, so changing it would only ever
|
|
* reach fresh installs.
|
|
*
|
|
* The `default` is what migrates the existing rows — every workflow written
|
|
* before this release was evaluated against the due date, and the column
|
|
* default gives exactly that without a backfill step.
|
|
*/
|
|
class Version1001Date20260825120000 extends SimpleMigrationStep {
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
if (!$schema->hasTable('wfda_workflows')) {
|
|
return null;
|
|
}
|
|
|
|
$table = $schema->getTable('wfda_workflows');
|
|
if ($table->hasColumn('date_field')) {
|
|
return null;
|
|
}
|
|
|
|
$table->addColumn('date_field', Types::STRING, [
|
|
'notnull' => true,
|
|
'length' => 16,
|
|
'default' => Workflow::DATE_FIELD_DUE,
|
|
]);
|
|
|
|
return $schema;
|
|
}
|
|
}
|