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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners