vlahaye
(Vincent)
August 19, 2014, 5:28pm
1
Hi there,
I don’t know how to update the plugin tables ?
The method install() of the “PluginName.php” main file doesn’t do that…
And there is nothing about that on Piwik\Plugin.php !
So my new plugin version is not working 'cause it can’t update its database itself.
Is there anything already done on this subject ?
Cheers,
Vincent.
vlahaye
(Vincent)
August 20, 2014, 8:19am
2
Here is my solution :
A DB versioning Class management.
It triggers on \Piwik\Plugin()->postLoad(), so basically on every page load, which is not very efficient.
If someday you come to implement an update() method in \Piwik\Plugin, that could be great!
matthieu
(Matthieu Aubry)
August 25, 2014, 8:54pm
3
This feature iss built-in the Piwik plugin framework of course
Please see an example in the CustomAlerts plugin: plugin-CustomAlerts/Updates at master · matomo-org/plugin-CustomAlerts · GitHub
You can define schema updates and it’s based off the plugin version defined in plugin.json
hope it helps and you can use that instead of your temporary solution
vlahaye
(Vincent)
August 25, 2014, 11:19pm
4
Haaaa no way!!
That was such a waste of time x) looks so good !