feat: additional functionality and layout adjustments for season teamers
This commit is contained in:
1 parent
80c6016da3
commit
4cab57d136
30 files changed
+916
-192
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Drops the season assignment's done_teamer flag.
|
||||
*
|
||||
* It was a note the office set by hand and it gated nothing - neither the weekly teamer digest
|
||||
* nor the office deadline summary ever read it. Both stages it was meant to express follow from
|
||||
* the checklist rows, so App\Service\Season\SeasonChecklistBuilder derives them instead.
|
||||
*
|
||||
* Written by hand rather than taken from doctrine:migrations:diff, like Version20260916160000:
|
||||
* the diff against this database also carries the pre-existing drift in datetime and JSON column
|
||||
* declarations, which has nothing to do with this change.
|
||||
*/
|
||||
final class Version20260917120000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Drop the informative done_teamer flag from season assignments';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE season_assignment DROP done_teamer');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// The hand-set notes themselves cannot be recovered, so the column comes back unset.
|
||||
$this->addSql('ALTER TABLE season_assignment ADD done_teamer TINYINT(1) NOT NULL');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Renames the checklist entry's uploaded flag to office_done.
|
||||
*
|
||||
* The flag is the office's own step on an entry, and that step differs per entry - filing a
|
||||
* returned contract is not the same act as registering someone with the municipality. Named
|
||||
* after a file arriving, it read as a second kind of "done" everywhere else, next to the done
|
||||
* flag that actually closes the entry.
|
||||
*
|
||||
* A rename, not a new column: the ticks themselves stay.
|
||||
*/
|
||||
final class Version20260917123000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rename season_assignment_task.uploaded to office_done';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE season_assignment_task CHANGE uploaded office_done TINYINT(1) NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE season_assignment_task CHANGE office_done uploaded TINYINT(1) NOT NULL');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Copies the library document onto the checklist row.
|
||||
*
|
||||
* The library holds what the next assignments get and is replaced from season to season, so
|
||||
* resolving it on read rewrote what an assignment that already exists - a finished one included -
|
||||
* hands out. The row carries its own reference from now on.
|
||||
*
|
||||
* The backfill maps every existing row to what it resolves to today, so nothing changes for the
|
||||
* rows that are already out there. ON DELETE SET NULL keeps a row readable when the library file
|
||||
* itself is deleted: "kein Dokument hinterlegt" is a state every view already handles.
|
||||
*/
|
||||
final class Version20260917140000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Give each season checklist row its own document reference';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE season_assignment_task ADD document_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE season_assignment_task ADD CONSTRAINT FK_BEEB9D8DC33F7837 FOREIGN KEY (document_id) REFERENCES upload (id) ON DELETE SET NULL');
|
||||
$this->addSql('CREATE INDEX IDX_BEEB9D8DC33F7837 ON season_assignment_task (document_id)');
|
||||
|
||||
$this->addSql('UPDATE season_assignment_task t JOIN season_task_document d ON d.task_key = t.task_key SET t.document_id = d.document_id');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE season_assignment_task DROP FOREIGN KEY FK_BEEB9D8DC33F7837');
|
||||
$this->addSql('DROP INDEX IDX_BEEB9D8DC33F7837 ON season_assignment_task');
|
||||
$this->addSql('ALTER TABLE season_assignment_task DROP document_id');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user