Please, how can i resolve this problem? my setup script doesn't work when i enable my module using this command:
php bin/magento module:enable Demo_Demo
<?php
namespace Demo\Demo\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
class InstallSchema implements InstallSchemaInterface
{
public function install(SchemaSetupInterface $setup)
{
$setup->startSetup();
$data = [];
$statuses = [
'demo_payed' => __('payed'),
'demo_error' => __('error'),
'demo_processing' => __('processing'),
];
foreach ($statuses as $code => $info) {
$data[] = ['status' => $code, 'label' => $info];
}
$setup->getConnection()
->insertArray($setup->getTable('sales_order_status'), ['status', 'label'], $data);
$setup->endSetup();
}
}