Files
nextcloud-workflow-deck-aut…/lib/Migration/Version1004Date20261002120000.php
T
Patrick Niebeling 7612344726
Build package / xml-lint (push) Successful in 33s
Build package / php-lint (8.5) (push) Successful in 1m48s
Build package / php-lint (8.4) (push) Successful in 1m50s
Build package / unit-tests (push) Successful in 1m52s
Build package / package (push) Successful in 1m38s
Send moved-card notices as Nextcloud notifications too
Each workflow now has a notify channel (mail, notification or both) next
to its recipient mode. Notifications go out per card through
OCP\Notification\IManager, so they show up in the bell and as push on the
mobile and desktop clients. Without the notifications app nothing is sent.
The one-off "workflow disabled" notice is sent as a notification as well.

Existing workflows keep mail (migration Version1004). Bumps to 35.3.0 so
the migration runs.
2026-09-30 12:31:01 +02:00

42 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace OCA\WorkflowDeckAutomation\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
/**
* Adds `notify_channel` (mail / notification / both, see
* NotificationPolicy::CHANNELS): how the recipients chosen by `notify_mode`
* hear about moved cards. Existing workflows get `mail`, the only channel
* there was, so nothing changes for them.
*/
class Version1004Date20261002120000 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('notify_channel')) {
return null;
}
$table->addColumn('notify_channel', Types::STRING, [
'notnull' => true,
'length' => 16,
'default' => 'mail',
]);
return $schema;
}
}