philmckrackon
Well-known member
This is my cli input
And my setup.php file,
Any thoughts? Thanks,
Code:
# php cmd.php xf-addon:install-step Demo/Portal 1
PHP Fatal error: Trait 'Demo\Portal\XF\Db\Schema\Alter' not found in C:\xampp\htdocs\community\src\addons\Demo\Portal\Setup.php on line 10
Fatal error: Trait 'Demo\Portal\XF\Db\Schema\Alter' not found in C:\xampp\htdocs\community\src\addons\Demo\Portal\Setup.php on line 10
Code:
<?php
namespace Demo\Portal;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;
public function installStep1()
{
$this->schemaManager()->alterTable('xf_forum', function(Alter $table)
{
$table->addColumn('demo_portal_auto_feature', 'tinyint')->setDefault(0);
});
}
public function installStep2()
{
$this->schemaManager()->alterTable('xf_thread', function(Alter $table)
{
$table->addColumn('demo_portal_featured', 'tinyint')->setDefault(0);
});
}
public function installStep3()
{
$this->schemaManager()->createTable('xf_demo_portal_featured_thread', function(Create $table)
{
$table->addColumn('thread_id', 'int');
$table->addColumn('featured_date', 'int');
$table->addPrimaryKey('thread_id');
});
}
}