Every now and then, we are running the admin/cli/check_database_schema.php script in our Moodle installation.
This time, this issue was highlighted:
-------------------------------------------------------------------------------
block_sharing_cart_log
* table is not expected
-------------------------------------------------------------------------------
In our installation, this table contains some rows with timestamps and data from the year 2021.
While there may be valid reasons to have this table for logging the unfixed problem, I would consider it bad practice to create it on the fly.
Would you mind to change the mechanism to create it on the fly to a situation where the table is defined in db/install.xml for new installation and created in db/upgrade.php for updated installations?
Every now and then, we are running the admin/cli/check_database_schema.php script in our Moodle installation.
This time, this issue was highlighted:
In our installation, this table contains some rows with timestamps and data from the year 2021.
Upon investigation, I saw that this table is and was never contained in https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/db/install.xml. Instead, it is created in on-the-fly if needed on https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/classes/mysql_logger.php#L26 and there is a short notice about the purpose in https://github.com/donhinkelman/moodle-block_sharing_cart/blob/master/README.md.
While there may be valid reasons to have this table for logging the unfixed problem, I would consider it bad practice to create it on the fly.
Would you mind to change the mechanism to create it on the fly to a situation where the table is defined in db/install.xml for new installation and created in db/upgrade.php for updated installations?
Thanks in advance, Ale