Add Enemies section: D&D stat-block table + detail/edit pages
- Enemy entity: full 5e stat block (size/type/subtype/alignment, AC, HP,
speed, six ability scores, CR/XP/prof, saves/skills/senses/languages,
damage & condition modifiers, traits/actions/bonus/reactions/legendary,
description, source) plus a DM game-notes field and updated_at.
- CreatureSize / CreatureType enums.
- /enemies: server-side DataTable (name, size, type, CR, AC, HP, notes),
"Add enemy" button.
- /enemies/{id}: stat block rendered read-only + editable game notes.
- /enemies/new and /enemies/{id}/edit: the full stat-block form (no notes).
- "Enemies" nav item between NPC's and Storyline.
- Table left empty on purpose.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?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 Version20260906143452 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create enemy table (D&D stat blocks + game notes)';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE enemy (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(160) NOT NULL, size VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, subtype VARCHAR(120) DEFAULT NULL, alignment VARCHAR(120) DEFAULT NULL, armor_class SMALLINT NOT NULL, armor_class_note VARCHAR(120) DEFAULT NULL, hit_points SMALLINT NOT NULL, hit_dice VARCHAR(60) DEFAULT NULL, speed VARCHAR(180) DEFAULT NULL, strength SMALLINT NOT NULL, dexterity SMALLINT NOT NULL, constitution SMALLINT NOT NULL, intelligence SMALLINT NOT NULL, wisdom SMALLINT NOT NULL, charisma SMALLINT NOT NULL, challenge_rating VARCHAR(12) DEFAULT NULL, experience_points INT DEFAULT NULL, proficiency_bonus SMALLINT DEFAULT NULL, saving_throws VARCHAR(180) DEFAULT NULL, skills VARCHAR(255) DEFAULT NULL, damage_vulnerabilities VARCHAR(255) DEFAULT NULL, damage_resistances VARCHAR(255) DEFAULT NULL, damage_immunities VARCHAR(255) DEFAULT NULL, condition_immunities VARCHAR(255) DEFAULT NULL, senses VARCHAR(255) DEFAULT NULL, languages VARCHAR(255) DEFAULT NULL, traits LONGTEXT DEFAULT NULL, actions LONGTEXT DEFAULT NULL, bonus_actions LONGTEXT DEFAULT NULL, reactions LONGTEXT DEFAULT NULL, legendary_actions LONGTEXT DEFAULT NULL, description LONGTEXT DEFAULT NULL, source VARCHAR(180) DEFAULT NULL, game_notes LONGTEXT DEFAULT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX uniq_enemy_name (name), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 ENGINE = InnoDB');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TABLE enemy');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user