Migration and Maintenance in Plugin

Hi!

I am currently working on some new stuff for the kirby podcaster plugin, extending the statistics. The in-depth-stats use a database to store their data.

So I am wondering where the best place might be to run migrations and in the future do other stuff to keep the plugin-installation clean. I looked out for a hook like ‘plugin.after.install’ or something, but with no result.

Can you help me?

Thank you!
Maurice

AFAIK there’s nothing baked in.

You could create something yourself though: e.g. write the plugin version to a text file somewhere and have a bootstrap function in your plugin that checks this file and does necessary migrations + afterwards update the text file with the new version.

Related to this, I think, would be a Panel plugin that tracks plugins you’ve installed. Then, if they’re on GitHub (or similar), and it could compare version numbers of your installed plugins to alert you to updates.

Perhaps even alert you to an updated version of Kirby, as well.

https://github.com/bnomei/kirby3-doctor checks at least for current Kirby version and you can add custom checks.

1 Like

Okay,

thanks for your suggestions. I’ll keep trying around a bit and see what might be the best path to go.