netbrothers-gmbh / version-bundle
Trigger based version tables with MariaDB/MySQL and Doctrine
Installs: 3 235
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Type:symfony-bundle
pkg:composer/netbrothers-gmbh/version-bundle
Requires
- php: >=8.2
- doctrine/dbal: ^4.4.1
- doctrine/orm: ^3.6
- symfony/console: ^7.4 || ^8.0
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpstan/phpstan-deprecation-rules: ^1.0
README
This hybrid package works as a Symfony bundle or as a standalone PHP package for managing versioned tables in MariaDB and MySQL databases using Doctrine. It automatically creates versioning triggers for your database tables.
Note: This package is designed to work specifically with MariaDB/MySQL. It is not compatible with other database systems like PostgreSQL or SQLite.
Features
- Creates and maintains
_versiontables for your Doctrine entities. - Automatically generates
INSERTandUPDATEtriggers. - Works as a native Symfony Bundle.
- Works as a standalone package in any PHP project with a PSR-11 container.
- Compatible with Symfony 7.4 / 8.x and Doctrine DBAL 4.
Installation
composer require netbrothers-gmbh/version-bundle
Quick Start (Symfony Bundle)
- Add a
versioncolumn to your entity using the provided trait. - Run the command to generate version tables and triggers:
php bin/console netbrothers:version
Quick Start (Standalone Package)
- Create a container file (e.g.,
config/container.php) that returns your PSR-11 container with a configured DoctrineEntityManagerInterface. - Run the command and pass the container file path:
vendor/bin/netbrothers-version --container-file=config/container.php
Documentation
For detailed instructions on installation, configuration, and usage (both for Symfony and standalone mode), please see the full documentation.
License
This bundle is released under the MIT license. See the bundled LICENSE file for details.