fabiang / doctrine-migrations-liquibase
Generate Liquibase ChangeLog from Doctrine Entities
v2.4.0
2024-01-24 12:47 UTC
Requires
- php: ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
- doctrine/dbal: ^3.1.2
- doctrine/orm: ^2.11
Requires (Dev)
- doctrine/annotations: ^1.13 || ^2.0
- doctrine/cache: ^2.1
- laminas/laminas-coding-standard: ^2.3
- phpspec/prophecy: ^1.14
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5 || ^10.0
- thomasweinert/phpunit-xpath-assertions: ^3.0
- vimeo/psalm: ^4.23
Replaces
README
Generate Liquibase ChangeLog from Doctrine Entities.
API Usage
/** @var Doctrine\ORM\EntityManager $em */ $em = ...; // Retrieve Doctrine EntityManager as usual in your environment. // Create a Liquibase SchemaTool with EntityManager $schemaTool = new LiquibaseSchemaTool($this->em); // Create a changelog that can be used on an empty database to build from scratch. /** @var \DOMDocument $changeLog */ $changeLog = $schemaTool->changeLog()->getResult(); echo $changeLog->saveXML(); // Or create a diff changelog that can be used on current database to upgrade it. /** @var \DOMDocument $diffChangeLog */ $diffChangeLog = $schemaTool->diffChangeLog()->getResult(); echo $diffChangeLog->saveXML();