| @@ 189-205 (lines=17) @@ | ||
| 186 | } |
|
| 187 | } |
|
| 188 | ||
| 189 | if ($behaviour & self::ALTER_COLUMNS) { |
|
| 190 | foreach ($comparator->alteredColumns() as $pair) { |
|
| 191 | /** |
|
| 192 | * @var AbstractColumn $initial |
|
| 193 | * @var AbstractColumn $current |
|
| 194 | */ |
|
| 195 | list($current, $initial) = $pair; |
|
| 196 | ||
| 197 | $this->log('Altering column [{statement}] to [{new}] in table {table}.', [ |
|
| 198 | 'statement' => $initial->sqlStatement($this->driver), |
|
| 199 | 'new' => $current->sqlStatement($this->driver), |
|
| 200 | 'table' => $this->identify($table), |
|
| 201 | ]); |
|
| 202 | ||
| 203 | $this->alterColumn($table, $initial, $current); |
|
| 204 | } |
|
| 205 | } |
|
| 206 | ||
| 207 | if ($behaviour & self::CREATE_INDEXES) { |
|
| 208 | foreach ($comparator->addedIndexes() as $index) { |
|
| @@ 218-234 (lines=17) @@ | ||
| 215 | } |
|
| 216 | } |
|
| 217 | ||
| 218 | if ($behaviour & self::ALTER_INDEXES) { |
|
| 219 | foreach ($comparator->alteredIndexes() as $pair) { |
|
| 220 | /** |
|
| 221 | * @var AbstractIndex $initial |
|
| 222 | * @var AbstractIndex $current |
|
| 223 | */ |
|
| 224 | list($current, $initial) = $pair; |
|
| 225 | ||
| 226 | $this->log('Altering index [{statement}] to [{new}] in table {table}.', [ |
|
| 227 | 'statement' => $initial->sqlStatement($this->driver), |
|
| 228 | 'new' => $current->sqlStatement($this->driver), |
|
| 229 | 'table' => $this->identify($table), |
|
| 230 | ]); |
|
| 231 | ||
| 232 | $this->alterIndex($table, $initial, $current); |
|
| 233 | } |
|
| 234 | } |
|
| 235 | ||
| 236 | if ($behaviour & self::CREATE_FOREIGNS) { |
|
| 237 | foreach ($comparator->addedForeigns() as $foreign) { |
|
| @@ 247-262 (lines=16) @@ | ||
| 244 | } |
|
| 245 | } |
|
| 246 | ||
| 247 | if ($behaviour & self::ALTER_FOREIGNS) { |
|
| 248 | foreach ($comparator->alteredForeigns() as $pair) { |
|
| 249 | /** |
|
| 250 | * @var AbstractReference $initial |
|
| 251 | * @var AbstractReference $current |
|
| 252 | */ |
|
| 253 | list($current, $initial) = $pair; |
|
| 254 | ||
| 255 | $this->log('Altering foreign key [{statement}] to [{new}] in {table}.', [ |
|
| 256 | 'statement' => $initial->sqlStatement($this->driver), |
|
| 257 | 'table' => $this->identify($table), |
|
| 258 | ]); |
|
| 259 | ||
| 260 | $this->alterForeign($table, $initial, $current); |
|
| 261 | } |
|
| 262 | } |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|