One time database update process as part of applying a patch
This is usually called a migration, try yii2, Laravel or doctrine

Mostly these frameworks will manage the schema in yml, XML or PHP and automatically calculate schema changes and apply them.

For data changes, you would package up a number of database queries or even program code into a migration, which usually has a forward/up step and a backward/down step.

Migration status is usually stored as a single value in a separate database table