wallet handling 4
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Database\Console\Migrations\MigrateCommand as BaseMigrateCommand;
|
||||
use Illuminate\Database\Migrations\Migrator;
|
||||
|
||||
/**
|
||||
* فقط از طریق AppServiceProvider روی command.migrate ثبت میشود —
|
||||
* داخل Commands/ نباشد تا Kernel آن را auto-load نکند.
|
||||
*/
|
||||
class MigrateCommand extends BaseMigrateCommand
|
||||
{
|
||||
public function __construct(Migrator $migrator, Dispatcher $dispatcher)
|
||||
{
|
||||
parent::__construct($migrator, $dispatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Never auto-load database/schema/*.sql — it DROP TABLEs and wipes production data
|
||||
* when the migrations table is empty. Use baseline_migrations.sql on existing DBs.
|
||||
*/
|
||||
protected function prepareDatabase()
|
||||
{
|
||||
if (! $this->migrator->repositoryExists()) {
|
||||
$this->call('migrate:install', array_filter([
|
||||
'--database' => $this->option('database'),
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user