cargomedia/cm

Add database manipulation class

Closed this issue · 3 comments

Loose idea once we have container with autowiring (services rework) to have class for database manipulation for lazy operation (it could load depending on configuration).

        $databaseManipulation = new CM_Db_Manipulation($mysqlClient);
        $databaseManipulation->alterTable('cm_user', 'CHANGE `field` `field` int(11) unsigned NOT NULL');

        $databaseManipulation = new CM_PerconaToolkit($mysqlClient);
        $databaseManipulation->alterTable('cm_user', 'CHANGE `field` `field` int(11) unsigned NOT NULL');
njam commented

The difficulty with percona "online schema changes" is orchestration. The percona-migration should run before the release. But it needs to be verified that the old application is compatible with the new schema. And the migration should be tested locally, because not all migrations are supported.

It would be a big project to automate this in a safe way. I don't think it's worth the gains. wdyt?

Well, it was just an idea to simplify altering tables for devs. I guess the wrapper for the percona-toolkit (without orchestration) would be quite simple.

I agree, you would need to spit pull-request into 2 separate ones:

  • first preparing the data
  • second with actual changes
njam commented

Let's close it for now