/**
  * Compile a create table command.
  *
  * @param  BaseBlueprint $blueprint
  * @param  \Illuminate\Support\Fluent $command
  * @return string
  */
 public function compileCreate(BaseBlueprint $blueprint, Fluent $command)
 {
     $inheritedTables = implode(', ', $this->getInheritedTables($blueprint));
     $sql = parent::compileCreate($blueprint, $command);
     if (empty($inheritedTables)) {
         return $sql;
     } else {
         return $sql . " inherits ({$inheritedTables})";
     }
 }
Пример #2
0
 /**
  * @param mixed $value
  * @return mixed|string
  */
 protected function getDefaultValue($value)
 {
     if ($this->isUuid($value)) {
         return strval($value);
     }
     return parent::getDefaultValue($value);
 }
Пример #3
0
 /**
  * Compile create table query.
  *
  * @param  Illuminate\Database\Schema\Blueprint  $blueprint
  * @param  \Illuminate\Support\Fluent  $command
  * @return string
  */
 public function compileCreate(BaseBlueprint $blueprint, Fluent $command)
 {
     $sql = parent::compileCreate($blueprint, $command);
     if (isset($blueprint->inherits)) {
         $sql .= ' INHERITS ("' . $blueprint->inherits . '")';
     }
     return $sql;
 }