Commit 3be50148 authored by abkrim's avatar abkrim 😀
Browse files

Refactor doctrine-list and add options with array

parent 5f836208
Pipeline #276 passed with stages
in 1 minute and 23 seconds
......@@ -18,3 +18,7 @@ All notable changes to `db-schema` will be documented in this file
## [1.0.1] - 2019-09-12
- Correct some problems with multidatabase projects
- I need some help for make tests in package ... Help me !!!
## [1.0.2] - 2019-09-24
- Refactor doctrine-list for get options with Laravel model instead Symfony model
- Add option **--C|connection** to support an array of options
......@@ -32,6 +32,8 @@ php artisan vendor:publish --tag=config-db-schema
New command for see or show schema and indexes for any connection fo our Laravel project, using Doctrine instead use several wrappers.
Only tested with MySQL (not testing phpunit, testing in production) but is possible that work fine with Postgresql, sqlite,...
On this version options for this command are in Laravel mode instead Symfony Model. Check with --help
```bash
php artisan db-schema:doctrine-list
```
......
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>The coding standard for our project.</description>
<rule ref="PSR2"/>
<rule ref="PSR2.Classes.PropertyDeclaration">
<severity>0</severity>
</rule>
<file>src</file>
<exclude-pattern>bootstrap/cache/*</exclude-pattern>
<exclude-pattern>bootstrap/autoload.php</exclude-pattern>
<exclude-pattern>*/migrations/*</exclude-pattern>
<exclude-pattern>*/seeds/*</exclude-pattern>
<exclude-pattern>*.blade.php</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<!-- Show progression -->
<arg value="p"/>
</ruleset>
......@@ -8,8 +8,6 @@ use Abkrim\DbSchema\Schema\Helper;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Mockery\Exception;
use Symfony\Component\Console\Input\InputOption;
class DoctrineListSchema extends Command
{
......@@ -20,7 +18,8 @@ class DoctrineListSchema extends Command
*
* @var string
*/
protected $name = 'db-schema:doctrine-list';
protected $signature = 'db-schema:doctrine-list {--T|table= : Table name} {--C|connection=* : Connection name}
{--N|number= : Version number} {--S|save : Save schema version} {--F|force : Force save schema}';
/**
* The console command description.
......@@ -38,6 +37,8 @@ class DoctrineListSchema extends Command
public function handle()
{
//dd("hello",$this->options());
//change connection if provide
$this->setConnection();
......@@ -174,17 +175,17 @@ class DoctrineListSchema extends Command
}
}
protected function getOptions()
{
return [
['t', 't', InputOption::VALUE_OPTIONAL, 'Table name'],
['c', 'c', InputOption::VALUE_OPTIONAL, 'Connection name'],
['e', 'e', InputOption::VALUE_OPTIONAL, 'Version'],
['s', 's', InputOption::VALUE_NONE, 'Save schema version'],
['f', 'f', InputOption::VALUE_NONE, 'Force save schema']
];
}
//
// protected function getOptions()
// {
// return [
// ['t', 't', InputOption::VALUE_OPTIONAL, 'Table name'],
// ['c', 'c', InputOption::VALUE_OPTIONAL, 'Connection name'],
// ['e', 'e', InputOption::VALUE_OPTIONAL, 'Version'],
// ['s', 's', InputOption::VALUE_NONE, 'Save schema version'],
// ['f', 'f', InputOption::VALUE_NONE, 'Force save schema']
// ];
// }
/**
* @param string $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