Exemplo n.º 1
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;
 }
Exemplo n.º 2
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";
 }
Exemplo n.º 3
0
 /**
  * Execute the blueprint to build / modify the table.
  *
  * @param  \Nova\Database\Schema\Blueprint  $blueprint
  * @return void
  */
 protected function build(Blueprint $blueprint)
 {
     $blueprint->build($this->connection, $this->grammar);
 }