public function createTable() { $empresa = $this->estrutura[EstruturaQuery::COMPANY]; $schema = $this->estrutura[EstruturaQuery::SCHEMA]; $sequence = $this->estrutura[EstruturaQuery::SEQUENCE]; $user = $this->estrutura[EstruturaQuery::USER]; $tabelas = $this->diff_dev_homologQuery(); $fase = FaseQuery::CREATE; $colunas = array(); $stringResult = "\n\n\n------------------------------ CREATE TABLE ------------------------------"; if (!empty($tabelas)) { foreach ($tabelas as $tabela) { $string = "\n\nCREATE TABLE {$tabela}"; $string .= "\n(\n"; $stringColuna = ""; $stringConstraint = ""; $colunaBO = new ColunaBO($empresa, $schema, $tabela, $sequence, $fase); $string .= $colunaBO->createColumn(); $constraintBO = new ConstraintBO($empresa, $schema, $tabela, $fase); $string .= $constraintBO->createConstraint(); $string = substr($string, 0, -2); $string .= "\n);"; $string .= "\nALTER TABLE {$tabela} OWNER TO {$user};"; $triggerBO = new TriggerBO($empresa, $schema, $tabela); $string .= $triggerBO->createTrigger(); $indiceBO = new IndiceBO($empresa, $schema, $tabela); $string .= $indiceBO->createIndex(); $stringResult .= GerenciadorSequence::getQueryCriado() . $string . GerenciadorSequence::getQuerySetado(); $string = ""; } return $stringResult; } }
public function createTable() { $empresa = $this->estrutura[EstruturaQuery::COMPANY]; $schema = $this->estrutura[EstruturaQuery::SCHEMA]; $sequence = $this->estrutura[EstruturaQuery::SEQUENCE]; $tabelas = $this->diff_dev_homologQuery(); $colunas = array(); $stringResult = "\n\n-------------------- CREATE TABLE --------------------"; if (!empty($tabelas)) { foreach ($tabelas as $tabela) { $string = "\n\nCREATE TABLE {$tabela}"; $string .= "\n(\n"; $colunaBO = new ColunaBO($empresa, $schema, $tabela, $sequence); $string .= $colunaBO->createColumn(); $string .= "\n);"; $stringResult .= GerenciadorSequence::getQueryCriado() . $string . GerenciadorSequence::getQuerySetado(); $string = ""; } return $stringResult; } }