XF 2.0 How does upgradeStep work in Setup ?

[F.A] Walky

Active member
Hi

I wonder how the upgradeStep works in the Setup.php file. Here is an example : public function upgrade1010170Step1(),as you can see there's the versionId included 1010170.

What this versionId should be ?
  • The current version of the addon before incrementing the versionId and release a new update ?
  • The future versionId of the update ?
For example, I've an addon with a versionId of 1.1.0, and I want to release an update with 1.1.1. What the function name in this case should be ?
upgrade1010070Step1() or upgrade1010170Step1() ?

Thank you :)
 
What if a user is at version 1.0.0 and skips 1.0.1 and 1.0.2 and jumps directly to 1.1.1
The setup contains upgradeStep1000170Step1(), upgrade1000270Step1() and upgrade1010170Step1()
Are the needed upgrade-functions in between run automatically before the final upgrade to 1.1.1?
 
Yep, same as the XF installer. The Setup class will loop through all versions in between the version you're currently on and the version being installed.
 
Back
Top Bottom