| @@ 124-148 (lines=25) @@ | ||
| 121 | * @param bool $pretend |
|
| 122 | * @return void |
|
| 123 | */ |
|
| 124 | protected function runUp($file, $batch, $pretend) |
|
| 125 | { |
|
| 126 | /** |
|
| 127 | * Run our migrations first. |
|
| 128 | * |
|
| 129 | * @var Migration $migration |
|
| 130 | */ |
|
| 131 | $migration = $this->resolve($file); |
|
| 132 | ||
| 133 | /** |
|
| 134 | * Set the addon if there is |
|
| 135 | * one contextually available. |
|
| 136 | * |
|
| 137 | * @var Addon $addon |
|
| 138 | */ |
|
| 139 | if ($addon = $this->getAddon()) { |
|
| 140 | $migration->setAddon($addon); |
|
| 141 | } |
|
| 142 | ||
| 143 | if ($migration instanceof Migration) { |
|
| 144 | $this->dispatch(new Migrate($migration)); |
|
| 145 | } |
|
| 146 | ||
| 147 | parent::runUp($file, $batch, $pretend); |
|
| 148 | } |
|
| 149 | ||
| 150 | /** |
|
| 151 | * Run "down" a migration instance. |
|
| @@ 158-182 (lines=25) @@ | ||
| 155 | * @param bool $pretend |
|
| 156 | * @return void |
|
| 157 | */ |
|
| 158 | protected function runDown($file, $migration, $pretend) |
|
| 159 | { |
|
| 160 | /** |
|
| 161 | * Run our migrations first. |
|
| 162 | * |
|
| 163 | * @var Migration $migration |
|
| 164 | */ |
|
| 165 | $migration = $this->resolve($file); |
|
| 166 | ||
| 167 | /** |
|
| 168 | * Set the addon if there is |
|
| 169 | * one contextually available. |
|
| 170 | * |
|
| 171 | * @var Addon $addon |
|
| 172 | */ |
|
| 173 | if ($addon = $this->getAddon()) { |
|
| 174 | $migration->setAddon($addon); |
|
| 175 | } |
|
| 176 | ||
| 177 | if ($migration instanceof Migration) { |
|
| 178 | $this->dispatch(new Reset($migration)); |
|
| 179 | } |
|
| 180 | ||
| 181 | parent::runDown($file, $migration, $pretend); |
|
| 182 | } |
|
| 183 | ||
| 184 | /** |
|
| 185 | * Resolve a migration instance from a file. |
|