Polls are deleted POLL_RETENTION_DAYS (default 90) after creation by the cron job `bin/cake polls cleanup`. POLL_REMINDER_DAYS (default 14) before that the owner gets a one-time reminder mail (expiry_reminded_at). New commands: polls list, show (admin link only with --link), delete, remind, cleanup. The expiry date is shown in the creation mail and the dashboard. Docs: README, AGENTS.md, .env.example. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
37 lines
876 B
PHP
37 lines
876 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Migrations\BaseMigration;
|
|
|
|
/**
|
|
* When the reminder mail before a poll expires was sent (null = not yet), so it goes out only once.
|
|
*/
|
|
class AddExpiryRemindedAtToPolls extends BaseMigration
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$table = $this->table('polls');
|
|
if (!$table->hasColumn('expiry_reminded_at')) {
|
|
$table->addColumn('expiry_reminded_at', 'datetime', [
|
|
'null' => true,
|
|
'default' => null,
|
|
'after' => 'last_admin_access',
|
|
])->update();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function down(): void
|
|
{
|
|
$table = $this->table('polls');
|
|
if ($table->hasColumn('expiry_reminded_at')) {
|
|
$table->removeColumn('expiry_reminded_at')->update();
|
|
}
|
|
}
|
|
}
|