WIP: weather integration

This commit is contained in:
Joren de Graaf
2026-08-11 21:11:31 +02:00
parent f63134d00f
commit 6a20cb80ca
30 changed files with 1054 additions and 31 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260811120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add task scheduling and recurrence fields.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE task ADD scheduled_for DATE DEFAULT NULL, ADD recurrence_interval INT DEFAULT NULL, ADD recurrence_unit VARCHAR(10) DEFAULT NULL');
$this->addSql("UPDATE task SET recurrence_interval = 1, recurrence_unit = 'day' WHERE is_recurring = 1 AND (recurrence_interval IS NULL OR recurrence_unit IS NULL)");
$this->addSql('UPDATE task SET scheduled_for = DATE(created_at) WHERE scheduled_for IS NULL');
$this->addSql('ALTER TABLE task MODIFY scheduled_for DATE NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE task DROP scheduled_for, DROP recurrence_interval, DROP recurrence_unit');
}
}