Support database specific DDL in migrations #19649
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
Migration scripts run during Matomo updates often contain MySQL specific DDL statements. Migrations are also run as part of the test suite setup. Alternative databases commonly have minor differences in schema structure and DDL statements, in order to support them we need an option for migration scripts to provide DDL statements for multiple databases if required.
Suggested Approach
core/Updates
andcore/Updater
classes to allow each migration in the migrations array to be optionally associated with a specific database type.If 'all' is specified then the migration will run for any PDO adapter, if a database type is specified then the migration will only run if that PDO adapter is being used.
The Update files in
core/Updates/
may then provide different schema changes for different db types if needed.Rework all existing migrations to use the new format.
As old migrations are re-run during integration tests, future database support may involve retrospectively adding database specific DDL to existing migrations as required.
The text was updated successfully, but these errors were encountered: