| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function up(Schema $schema, QueryBag $queries) |
||
| 16 | { |
||
| 17 | $table = $schema->getTable('orocrm_sales_opportunity'); |
||
| 18 | $indexName = 'opportunities_by_status_idx'; |
||
| 19 | $indexColumns = [ |
||
| 20 | 'organization_id', |
||
| 21 | 'status_id', |
||
| 22 | 'close_revenue', |
||
| 23 | 'budget_amount', |
||
| 24 | 'created_at' |
||
| 25 | ]; |
||
| 26 | if ($table->hasIndex($indexName) && $table->getIndex($indexName)->getColumns() !== $indexColumns) { |
||
| 27 | $table->dropIndex($indexName); |
||
| 28 | $table->addIndex($indexColumns, $indexName); |
||
| 29 | } else { |
||
| 30 | $table->addIndex($indexColumns, $indexName); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 |