Ejemplo n.º 1
0
 /**
  * Compile a drop primary key command.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @param  \Nova\Support\Fluent  $command
  * @return string
  */
 public function compileDropPrimary(Blueprint $blueprint, Fluent $command)
 {
     $table = $blueprint->getTable();
     return 'alter table ' . $this->wrapTable($blueprint) . " drop constraint {$table}_pkey";
 }
Ejemplo n.º 2
0
 /**
  * Create an empty Doctrine DBAL TableDiff from the Blueprint.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @param  \Doctrine\DBAL\Schema\AbstractSchemaManager  $schema
  * @return \Doctrine\DBAL\Schema\TableDiff
  */
 protected function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema)
 {
     $table = $this->getTablePrefix() . $blueprint->getTable();
     $tableDiff = new TableDiff($table);
     $tableDiff->fromTable = $schema->listTableDetails($table);
     return $tableDiff;
 }