| @@ 197-211 (lines=15) @@ | ||
| 194 | * |
|
| 195 | * @throws InvalidNameException if invalid table or column name is detected |
|
| 196 | */ |
|
| 197 | protected function checkTables(SchemaDiff $schemaDiff, Migration $migration) |
|
| 198 | { |
|
| 199 | foreach ($schemaDiff->newTables as $table) { |
|
| 200 | $this->checkTableName($table->getName(), $migration); |
|
| 201 | $this->checkColumnNames($table->getName(), $table->getColumns(), $migration); |
|
| 202 | } |
|
| 203 | ||
| 204 | foreach ($schemaDiff->changedTables as $tableName => $diff) { |
|
| 205 | $this->checkColumnNames( |
|
| 206 | $tableName, |
|
| 207 | array_values($diff->addedColumns), |
|
| 208 | $migration |
|
| 209 | ); |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||
| 213 | /** |
|
| 214 | * Validates the given columns |
|
| @@ 258-275 (lines=18) @@ | ||
| 255 | * @param SchemaDiff $schemaDiff |
|
| 256 | * @param Migration $migration |
|
| 257 | */ |
|
| 258 | protected function checkIndexes(SchemaDiff $schemaDiff, Migration $migration) |
|
| 259 | { |
|
| 260 | foreach ($schemaDiff->newTables as $table) { |
|
| 261 | foreach ($table->getIndexes() as $index) { |
|
| 262 | $this->checkIndex($table, $index, $migration); |
|
| 263 | } |
|
| 264 | } |
|
| 265 | ||
| 266 | foreach ($schemaDiff->changedTables as $tableDiff) { |
|
| 267 | foreach (array_values($tableDiff->addedIndexes) as $index) { |
|
| 268 | $this->checkIndex( |
|
| 269 | $this->getTableFromDiff($tableDiff), |
|
| 270 | $index, |
|
| 271 | $migration |
|
| 272 | ); |
|
| 273 | } |
|
| 274 | } |
|
| 275 | } |
|
| 276 | ||
| 277 | /** |
|
| 278 | * @param Table $table |
|