|
@@ 145-156 (lines=12) @@
|
| 142 |
|
* |
| 143 |
|
* @return void |
| 144 |
|
*/ |
| 145 |
|
public function execute(AdapterInterface $executor) |
| 146 |
|
{ |
| 147 |
|
foreach ($this->tableCreates as $newTable) { |
| 148 |
|
$executor->createTable($newTable->getTable(), $newTable->getColumns(), $newTable->getIndexes()); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
foreach ($this->updatesSequence() as $updates) { |
| 152 |
|
foreach ($updates as $update) { |
| 153 |
|
$executor->executeActions($update->getTable(), $update->getActions()); |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
/** |
| 159 |
|
* Executes the inverse plan (rollback the actions) with the given AdapterInterface:w |
|
@@ 165-176 (lines=12) @@
|
| 162 |
|
* |
| 163 |
|
* @return void |
| 164 |
|
*/ |
| 165 |
|
public function executeInverse(AdapterInterface $executor) |
| 166 |
|
{ |
| 167 |
|
foreach ($this->inverseUpdatesSequence() as $updates) { |
| 168 |
|
foreach ($updates as $update) { |
| 169 |
|
$executor->executeActions($update->getTable(), $update->getActions()); |
| 170 |
|
} |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
foreach ($this->tableCreates as $newTable) { |
| 174 |
|
$executor->createTable($newTable->getTable(), $newTable->getColumns(), $newTable->getIndexes()); |
| 175 |
|
} |
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
/** |
| 179 |
|
* Deletes certain actions from the plan if they are found to be conflicting or redundant. |