CStrategies
Active member
In my setup.php I have:
	
	
	
		
When I installed this through the ACP, it correctly created the table 'my_table'.
I built the next version of my addon using:
	
	
	
		
Then, I added this to setup:
	
	
	
		
Then, bumped and built:
	
	
	
		
At this point, I would have thought I would see the new tables in the database, but it appears the steps were skipped. I thought maybe the version needs to be higher than the one in setup, so I tried bumping and building again:
	
	
	
		
Didn't work. Tried rebuilding the addon from the ACP. Didn't work. Any ideas? Thank you!
				
			
		PHP:
	
	namespace My/Addon;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;
class Setup extends AbstractSetup
{
    use StepRunnerInstallTrait;
    use StepRunnerUninstallTrait;
    use StepRunnerUpgradeTrait;
    public function installStep1()
    {
        $this->schemaManager()->createTable('my_table', function(Create $table)
    ....
	When I installed this through the ACP, it correctly created the table 'my_table'.
I built the next version of my addon using:
		Code:
	
	xf-addon:bump-version My/Addon --version-id 1003010
xf-addon:build-release My/Addon
	Then, I added this to setup:
		PHP:
	
	    public function upgrade1004010Step1()
    {
        $this->schemaManager()->alterTable('my_table', function(Alter $table)
    ...
    }
    public function upgrade1004010Step2()
    {
        $this->schemaManager()->createTable('new_table', function(Create $table)
        {
    ...
	Then, bumped and built:
		Code:
	
	xf-addon:bump-version My/Addon --version-id 1004010
xf-addon:build-release My/Addon
	At this point, I would have thought I would see the new tables in the database, but it appears the steps were skipped. I thought maybe the version needs to be higher than the one in setup, so I tried bumping and building again:
		Code:
	
	xf-addon:bump-version My/Addon --version-id 1005010
xf-addon:build-release My/Addon
	Didn't work. Tried rebuilding the addon from the ACP. Didn't work. Any ideas? Thank you!