22 lines
618 B
PHP
22 lines
618 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Database\Console\Migrations\MigrateCommand as BaseMigrateCommand;
|
|
|
|
class MigrateCommand extends BaseMigrateCommand
|
|
{
|
|
/**
|
|
* 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'),
|
|
]));
|
|
}
|
|
}
|
|
}
|