Each chapter page gets a collapsible "Chapter notes" card at the top — a free-text log the DM fills during play (the story the party tells after the Crooked Goose, names given to NPCs, threads for next time). Saved per chapter slug with a "saved <timestamp>" marker, same shape as the Enemy/NPC game-notes field. New: ChapterNote entity (slug-keyed, unique) + repository findOrCreate(), ChapterNoteType form, chapter_note table migration (ENGINE = InnoDB pinned). The storyline chapter route now also accepts POST to save. Chapters stay hand-written Twig; only the mutable notes live in the DB. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
32 lines
1019 B
PHP
32 lines
1019 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20260908164955 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return "Add chapter_note table for the DM's per-chapter storyline notes";
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
// ENGINE = InnoDB is pinned explicitly: the local WAMP MariaDB defaults
|
|
// to MyISAM, which would silently drop the unique index behaviour.
|
|
$this->addSql('CREATE TABLE chapter_note (id INT AUTO_INCREMENT NOT NULL, slug VARCHAR(120) NOT NULL, notes LONGTEXT DEFAULT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX uniq_chapter_note_slug (slug), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 ENGINE = InnoDB');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP TABLE chapter_note');
|
|
}
|
|
}
|