← Back to team overview

phpdevshell team mailing list archive

Re: [Question #210689]: Is there a more detailed tutorial for how to use the upgrade feature of a plugin

 

Question #210689 on PHPDevShell changed:
https://answers.launchpad.net/phpdevshell/+question/210689

    Status: Open => Answered

Greg proposed the following answer:
Thanks for the compliment :) we try very hard to provide a good tool but
we lack resources to write a complete documentation.

I personnaly never had to use the upgrade mecanism because I don't
release my plugins but I'm sure Jason can explain that.

I'll try however to give you what I understand.

There are in fact 3 different versions count:

- the "human readable" version to be displayed, for example 3.2.5 - only for display
- the "database version" which refer to the data stored in the database
- the "software version" which is the state of the code

Why so many? the first one is quite obvious : you can decide on your own
version scheme, which may be very hard for a computer to compare to
another. The second is only related to the database, it indicates how
the data is stored, where the third is only for the code itself.

For example, version 2.0 of your plugin can be database version 150 and
code version 200. When you release 2.0.1 it's very likely the same
database can be used without a change. So the plugin version goes up to
let's say 210, but the database version is still 150. Now PHPDevShell
know it can replace the old code with the new one without upgrading the
database. When you release 3.0 you might require a database change (for
example you might have added a field somewhere). The database version
goes up to 300, which compared to the current 150 means "apply the
upgrade sql to the database".

Does it make sense for you?

greg

-- 
You received this question notification because you are a member of
PHPDevShell, which is an answer contact for PHPDevShell.