refactor: arcadia replicate migration run only in testing or local
This commit is contained in:
parent
54a199d4e0
commit
728326d0a4
2 changed files with 7 additions and 8 deletions
|
|
@ -125,15 +125,11 @@ final class Migrator
|
|||
VisuelExportGenfiView::class,
|
||||
];
|
||||
|
||||
public function __construct(private readonly string $connection)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly string $connection) {}
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
if (app()->environment('local', 'testing')) {
|
||||
$this->down();
|
||||
}
|
||||
$this->down();
|
||||
|
||||
$schema = Schema::connection($this->connection);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use Database\ArcadiaReplicate\Migrator;
|
|||
use Illuminate\Database\Migrations\Migration;
|
||||
use Infra\Config\ArcadiaStorageConfig;
|
||||
|
||||
return new class () extends Migration
|
||||
return new class() extends Migration
|
||||
{
|
||||
private Migrator $migrator;
|
||||
|
||||
|
|
@ -21,7 +21,10 @@ return new class () extends Migration
|
|||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$this->migrator->up();
|
||||
if (app()->isLocal() || app()->runningUnitTests()) {
|
||||
|
||||
$this->migrator->up();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue