| Conditions | 6 |
| Paths | 18 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function up(Schema $schema, QueryBag $queries) |
||
| 26 | { |
||
| 27 | $table = $schema->getTable('orocrm_sales_lead'); |
||
| 28 | $statusColumnName = 'status_name'; |
||
| 29 | |||
| 30 | $leadForeignKeyList = $table->getForeignKeys(); |
||
| 31 | foreach ($leadForeignKeyList as $foreignKey) { |
||
| 32 | $foreingKeyColumns = $foreignKey->getUnquotedLocalColumns(); |
||
| 33 | if (in_array($statusColumnName, $foreingKeyColumns, true)) { |
||
| 34 | $table->removeForeignKey($foreignKey->getName()); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | $leadIndexList = $table->getIndexes(); |
||
| 39 | foreach ($leadIndexList as $index) { |
||
| 40 | if ($index->hasColumnAtPosition($statusColumnName, 0)) { |
||
| 41 | $table->dropIndex($index->getName()); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | if ($table->hasColumn($statusColumnName)) { |
||
| 46 | $table->dropColumn($statusColumnName); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |