/** * 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"; }
/** * 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; }