-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Plugin schemaVersion
is cached in plugins.php
and can't be updated
#2419
Comments
Lindsey noted that if will check the |
This is only the case for
That’s not actually true; the two are always checked independently of each other. |
If you created a plugin that has a
schemaVersion
in theextra
array, this data is cached in theplugins.php
file by Craft.If you then have db migrations that you want to run, you can't update the
schemaVersion
in yourcomposer.json
because Craft doesn't look there for it when loading the plugin. Instead, it looks at the cached into if has inplugins.php
If you then try to update the public property
$schemaVersion
in your plugin's primary class, this unfortunately is stomped on by theschemaVersion
that is cached in theplugins.php
file.The only solution is to uninstall and re-install the plugin (which could potentially involve data loss, depending on the plugin), or manually edit the
plugins.php
file to remove theschemaVersion
key/value pair.I'll modify
generate-craftplugin
to remove theschemaVersion
field from thecomposer.json
and move it to the public property$schemaVersion
but this does create a bit of an issue for any existing plugins that might run into this situation.The text was updated successfully, but these errors were encountered: