Calendar Fixed Upgrading 1.0.12 to 2.1.10 - table xf_nf_calendar_calendar doesn't exist

Affected version
2.1.10

Mouth

Member
# php cmd.php xf:addon-upgrade NF/Calendar
Upgrading NixFifty: Calendar from 1.0.12 to 2.1.10...
Confirm upgrade? (y/n)y
Upgrading . . . . . . .
In AbstractStatement.php line 228:

[XF\Db\Exception (1146)]
MySQL statement prepare error [1146]: Table 'dev.xf_nf_calendar_calendar' doesn't exist


Exception trace:
at src/XF/Db/AbstractStatement.php:228
XF\Db\AbstractStatement->getException() at src/XF/Db/Mysqli/Statement.php:196
XF\Db\Mysqli\Statement->getException() at src/XF/Db/Mysqli/Statement.php:39
XF\Db\Mysqli\Statement->prepare() at src/XF/Db/Mysqli/Statement.php:54
XF\Db\Mysqli\Statement->execute() at src/XF/Db/AbstractAdapter.php:94
XF\Db\AbstractAdapter->query() at src/XF/Db/AbstractAdapter.php:150
XF\Db\AbstractAdapter->fetchOne() at src/XF/Install/InstallHelperTrait.php:80
XF\AddOn\AbstractSetup->tableColumnsToJson() at src/XF/Install/InstallHelperTrait.php:43
XF\AddOn\AbstractSetup->entityColumnsToJson() at src/addons/NF/Calendar/Setup.php:251
NF\Calendar\Setup->upgrade2010010Step2() at src/XF/AddOn/StepRunnerUpgradeTrait.php:122
NF\Calendar\Setup->upgradeStepRunner() at src/XF/AddOn/StepRunnerUpgradeTrait.php:71
NF\Calendar\Setup->upgrade() at src/XF/Cli/Command/AddOnActionTrait.php:109
XF\Cli\Command\AddOnSubAction->performAddOnAction() at src/XF/Cli/Command/AddOnSubAction.php:79
XF\Cli\Command\AddOnSubAction->execute() at src/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at src/vendor/symfony/console/Application.php:987
Symfony\Component\Console\Application->doRunCommand() at src/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at src/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at src/XF/Cli/Runner.php:76
XF\Cli\Runner->run() at cmd.php:15

xf:addon-sub-action [--k K] [--] <id> <action>
 
Ha, that's annoying and slightly nefarious.

That's been working for a while but very recently, the tables were renamed for consistency. In the step that's breaking, the tables haven't been renamed yet so the XF helper function is looking for the tables with the new name but at that point in the upgrade, they're still using the old name.

I'll rejig the installer a bit to account for this.
 
Back
Top