Scaffold a complete Doctrine entity → migration → repository → fixture for this Symfony 7.4 project. Run when adding a new entity or adding fields to an existing one.
Scaffold the entity/migration/fixture for: $ARGUMENTS
All commands run from server/. See references/doctrine.md for patterns.
server/src/Entity/ to understand the existing conventions (UUID PK, PHP 8.3 attributes, DateTimeImmutable, etc.)server/src/DataFixtures/AppFixtures.php to match fixture styleIf creating a new entity:
php bin/console make:entity mentally as a reference — but write the class manually to match conventionsreferences/doctrine.md)#[ORM\...] attributes only — no YAML or XML?Type with nullable ORM optionDateTimeImmutable for all date/time fieldsstaticserver/src/Entity/EntityName.phpIf adding fields to an existing entity:
If creating a new entity, create the matching repository:
ServiceEntityRepository<EntityName>server/src/Repository/EntityNameRepository.phpGenerate and review:
cd server
php bin/console doctrine:migrations:diff
doctrine:schema:validate firstAdd seed data to server/src/DataFixtures/AppFixtures.php:
new Entity(), setters, $manager->persist())\Faker\Factory::create()Run in order:
php bin/console cache:clear
php bin/console doctrine:schema:validate
php bin/console doctrine:migrations:migrate --no-interaction
php bin/console doctrine:fixtures:load --no-interaction --append
All four must succeed. Fix errors before reporting done.
State: