/** * @param \Notadd\Foundation\Database\Schema\Blueprint $blueprint * @param \Illuminate\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"; }
/** * Get the Doctrine table difference for the given changes. * @param \Notadd\Foundation\Database\Schema\Blueprint $blueprint * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema * @return \Doctrine\DBAL\Schema\TableDiff|bool */ protected function getChangedDiff(Blueprint $blueprint, SchemaManager $schema) { $table = $schema->listTableDetails($this->getTablePrefix() . $blueprint->getTable()); return (new Comparator())->diffTable($table, $this->getTableWithColumnChanges($blueprint, $table)); }
/** * @param \Notadd\Foundation\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command * @return string */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) { return 'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = \'' . $blueprint->getTable() . '\') drop table ' . $blueprint->getTable(); }