Commit ae555fb9 authored by abkrim's avatar abkrim 😀
Browse files

Some corrections os style

parent 7ce4df95
Pipeline #226 passed with stages
in 1 minute and 14 seconds
......@@ -92,8 +92,8 @@ class DoctrineListSchema extends Command
'options' => implode(',', $column->getPlatformOptions())
];
}
//dd($this->option('e'));
if ($this->option('s') == true ) {
if ($this->option('s') == true) {
if (! is_null($this->option('e'))) {
$this->saveSchema($table, $table_schemas);
} else {
......@@ -137,13 +137,12 @@ class DoctrineListSchema extends Command
{
if ($this->option('c')) {
$this->connection = $this->option('c');
// Verify if connection exists
if (! Arr::has(config('database.connections'), $this->connection)) {
$this->error('Incorrect option database connection');
exit;
}
}
}
private function setDbTables(): void
......
......@@ -4,9 +4,6 @@ namespace Abkrim\DbSchema\Schema\Wrapper;
use Abkrim\DbSchema\Schema\Helper;
use Abkrim\DbSchema\Schema\BaseDbSchema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MySQLWrapper implements WrapperContract
{
......@@ -30,7 +27,8 @@ class MySQLWrapper implements WrapperContract
public function getColumns($tableName)
{
return $this->transformColumns($this->baseDbSchema->database->select("SHOW COLUMNS FROM " . $tableName));
return $this->transformColumns($this->baseDbSchema->database
->select("SHOW COLUMNS FROM " . $tableName));
}
public function getSchema()
......@@ -38,16 +36,6 @@ class MySQLWrapper implements WrapperContract
foreach ($this->getTables() as $table) {
$columns = $this->getColumns($table);
// Schema::table($table, function (Blueprint $dbtable) use ($table) {
// $sm = Schema::getConnection()->getDoctrineSchemaManager();
// //dd($table, $sm->listTableIndexes($table));
// echo "Table: " . $table.PHP_EOL;
// $indexesFound = $sm->listTableIndexes($table);
// foreach ($indexesFound as $index) {
// echo $index->getName() . ': ' . implode(',', $index->getColumns()) .' '. ($index->isUnique() ? 'unique' : 'not unique') . "\n";
// }
// });
$this->dbSchema[$table]['attributes'] = $columns;
$this->dbSchema[$table]['rowsCount'] = $this->baseDbSchema->getTableRowCount($table);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment