| @@ 123-140 (lines=18) @@ | ||
| 120 | * |
|
| 121 | * @return array |
|
| 122 | */ |
|
| 123 | public function alteredColumns(): array |
|
| 124 | { |
|
| 125 | $difference = []; |
|
| 126 | ||
| 127 | $initialColumns = $this->initial->getColumns(); |
|
| 128 | foreach ($this->current->getColumns() as $name => $column) { |
|
| 129 | if (!isset($initialColumns[$name])) { |
|
| 130 | //Added into schema |
|
| 131 | continue; |
|
| 132 | } |
|
| 133 | ||
| 134 | if (!$column->compare($initialColumns[$name])) { |
|
| 135 | $difference[] = [$column, $initialColumns[$name]]; |
|
| 136 | } |
|
| 137 | } |
|
| 138 | ||
| 139 | return $difference; |
|
| 140 | } |
|
| 141 | ||
| 142 | /** |
|
| 143 | * @return AbstractIndex[] |
|
| @@ 177-194 (lines=18) @@ | ||
| 174 | * |
|
| 175 | * @return array |
|
| 176 | */ |
|
| 177 | public function alteredIndexes(): array |
|
| 178 | { |
|
| 179 | $difference = []; |
|
| 180 | ||
| 181 | $initialIndexes = $this->initial->getIndexes(); |
|
| 182 | foreach ($this->current->getIndexes() as $name => $index) { |
|
| 183 | if (!$this->initial->knowsIndex($name)) { |
|
| 184 | //Added into schema |
|
| 185 | continue; |
|
| 186 | } |
|
| 187 | ||
| 188 | if (!$index->compare($initialIndexes[$name])) { |
|
| 189 | $difference[] = [$index, $initialIndexes[$name]]; |
|
| 190 | } |
|
| 191 | } |
|
| 192 | ||
| 193 | return $difference; |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * @return AbstractReference[] |
|
| @@ 231-248 (lines=18) @@ | ||
| 228 | * |
|
| 229 | * @return array |
|
| 230 | */ |
|
| 231 | public function alteredForeigns(): array |
|
| 232 | { |
|
| 233 | $difference = []; |
|
| 234 | ||
| 235 | $initialForeigns = $this->initial->getForeigns(); |
|
| 236 | foreach ($this->current->getForeigns() as $name => $foreign) { |
|
| 237 | if (!$this->initial->knowsForeign($name)) { |
|
| 238 | //Added into schema |
|
| 239 | continue; |
|
| 240 | } |
|
| 241 | ||
| 242 | if (!$foreign->compare($initialForeigns[$name])) { |
|
| 243 | $difference[] = [$foreign, $initialForeigns[$name]]; |
|
| 244 | } |
|
| 245 | } |
|
| 246 | ||
| 247 | return $difference; |
|
| 248 | } |
|
| 249 | } |
|
| 250 | ||