/** * Create changelog table * * @throws Exception */ public function createChangelog() { if (!$this->getId() || $this->getChangelogName()) { throw new Exception('Cann\'t create changelog table because materialized' . ' view doesn\'t exists or changelog already exists!!'); } $this->setData('changelog_name', $this->_generateChangelogName($this->getMviewName())); $this->_commandFactory->getCommandChangelogCreate($this->getMviewName(), $this->getChangelogName(), $this->getRuleColumn())->execute(); $this->save(); }