-
-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement all or nothing transaction strategy for migrations.
- Loading branch information
Showing
24 changed files
with
317 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations; | ||
|
||
class MigratorConfig | ||
{ | ||
/** @var bool */ | ||
private $dryRun = false; | ||
|
||
/** @var bool */ | ||
private $timeAllQueries = false; | ||
|
||
/** @var bool */ | ||
private $noMigrationException = false; | ||
|
||
/** @var bool */ | ||
private $allOrNothing = false; | ||
|
||
/** @var callable|null */ | ||
private $confirm; | ||
|
||
public function isDryRun() : bool | ||
{ | ||
return $this->dryRun; | ||
} | ||
|
||
public function setDryRun(bool $dryRun) : self | ||
{ | ||
$this->dryRun = $dryRun; | ||
|
||
return $this; | ||
} | ||
|
||
public function getTimeAllQueries() : bool | ||
{ | ||
return $this->timeAllQueries; | ||
} | ||
|
||
public function setTimeAllQueries(bool $timeAllQueries) : self | ||
{ | ||
$this->timeAllQueries = $timeAllQueries; | ||
|
||
return $this; | ||
} | ||
|
||
public function getNoMigrationException() : bool | ||
{ | ||
return $this->noMigrationException; | ||
} | ||
|
||
public function setNoMigrationException(bool $noMigrationException = false) : self | ||
{ | ||
$this->noMigrationException = $noMigrationException; | ||
|
||
return $this; | ||
} | ||
|
||
public function isAllOrNothing() : bool | ||
{ | ||
return $this->allOrNothing; | ||
} | ||
|
||
public function setAllOrNothing(bool $allOrNothing) : self | ||
{ | ||
$this->allOrNothing = $allOrNothing; | ||
|
||
return $this; | ||
} | ||
|
||
public function getConfirm() : ?callable | ||
{ | ||
return $this->confirm; | ||
} | ||
|
||
public function setConfirm(callable $confirm) : self | ||
{ | ||
$this->confirm = $confirm; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.