Source: stefan-netbrothers.medium.com

Version Control with MySQL Triggers
Version control and versioning in Symfony and Doctrine based on SQL-Triggers: Our NetBrothers VersionBundle creates versions for records in the SQL-database on the fly. After our switch from Zend framework to Symfony and from the Propel ORMt o Doctrine we were faced with a problem: Versioning is a built-in feature in Propel and is not in Doctrine.Our existing projects had version control implemented deep down in their foundations and as developers we had gotten used to the comfort of versioning running automatically in the background. So how are we going to deal with our existing projects?

By running in the terminal you create the version table and add triggers to the original table.

When changes are made to tables that have existing version tables, you need to add these changes to the version table as well.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners