CreateCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $conn = $this->em->getConnection();
        echo "Recreating aggregation table.\n";
        $conn->executeQuery('DROP TABLE IF EXISTS `aggregate`');
        $conn->executeQuery('CREATE TABLE `aggregate` (' . '  `id` int(11) NOT NULL AUTO_INCREMENT,' . '  `channel_id` int(11) NOT NULL,' . '  `type` tinyint(1) NOT NULL,' . '  `timestamp` bigint(20) NOT NULL,' . '  `value` double NOT NULL,' . '  `count` int(11) NOT NULL,' . '  PRIMARY KEY (`id`),' . '  UNIQUE KEY `ts_uniq` (`channel_id`,`type`,`timestamp`)' . ')');
    }

Usage Example

Esempio n. 1
0
 public function execute()
 {
     $dropCommand = $this->createCommand('LazyRecord\\Command\\DbCommand\\DropCommand');
     $dropCommand->options = $this->options;
     $dropCommand->execute();
     parent::execute();
 }