Esempio n. 1
0
 private function runStatement(\Yaoi\Sql\Expression $statement)
 {
     $query = $statement->build();
     if (!$query) {
         return;
     }
     if ($this->log) {
         $this->log->push(trim($query, ";\n") . ';');
     }
     if (!$this->dryRun) {
         $this->table->database()->query($statement);
     }
 }
Esempio n. 2
0
 public function extractForeignKeysStatement()
 {
     $alterExpression = new SimpleExpression('ALTER TABLE ?' . PHP_EOL, new Symbol($this->after->schemaName));
     $alterExpression->bindDatabase($this->database());
     $alterExpression->appendExpr(clone $this->addFkExpression);
     $this->addFkExpression->disable();
     return $alterExpression;
 }
Esempio n. 3
0
 public function extractForeignKeysStatement()
 {
     $this->fkLines->disable();
     return $this->database()->getUtility()->generateAlterTable(new Table(null, $this->database(), '_any_name'), $this->table)->extractForeignKeysStatement();
 }
Esempio n. 4
0
 protected function buildSet(Quoter $quoter)
 {
     if ($this->set && !$this->set->isEmpty()) {
         return ' SET ' . $this->set->build($quoter);
     } else {
         return '';
     }
 }