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