The party sheets in assets/characters/ changed: Darrah_Oakwanderer.pdf is gone, replaced by Darragh Fermwyr (same halfling ranger, renamed and updated), Owayn Fermwyr (stout halfling fighter, BJ) and Dunnchadh (ghostwise halfling druid, Circle of the Blighted, Rick). - app:character:seed now carries those three sheets, read from the PDFs' form fields. Darragh's portrait is renamed to match his new name. - New skill expertise field (double proficiency bonus), since Darragh's Deft Explorer gives him +7 Stealth and the sheet had nowhere to show it. Expertise implies proficiency; the sheet marks it with two dots, the edit form gets a checkbox list next to skill proficiencies. - Migration adds skill_expertise, backfilling existing rows with [] so the NOT NULL JSON column works on tables that already have characters. Tests: expertise math on the entity, and a catalog test that every seed sheet hydrates into a Character that passes validation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
922 B
PHP
33 lines
922 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Characters: skill expertise (double proficiency bonus).
|
|
*/
|
|
final class Version20261004104738 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add skill_expertise to character_sheet';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
// Existing rows need a valid JSON value before the column can be NOT NULL.
|
|
$this->addSql('ALTER TABLE character_sheet ADD skill_expertise JSON DEFAULT NULL');
|
|
$this->addSql("UPDATE character_sheet SET skill_expertise = '[]'");
|
|
$this->addSql('ALTER TABLE character_sheet MODIFY skill_expertise JSON NOT NULL');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE character_sheet DROP skill_expertise');
|
|
}
|
|
}
|