@@ -2,7 +2,7 @@ |
||
| 2 | 2 | /* @var $table string the name table */ |
| 3 | 3 | /* @var $indexes array the foreign keys */ |
| 4 | 4 | |
| 5 | -if($indexes){ |
|
| 5 | +if ($indexes) { |
|
| 6 | 6 | foreach ($indexes as $key => $index): ?> |
| 7 | 7 | $this->dropIndex('<?= $key ?>', $this->tableName); |
| 8 | 8 | <?php endforeach; |
@@ -8,16 +8,16 @@ |
||
| 8 | 8 | |
| 9 | 9 | //dd( $indexes ); |
| 10 | 10 | |
| 11 | -if($indexes){ |
|
| 11 | +if ($indexes) { |
|
| 12 | 12 | foreach ($indexes as $index): |
| 13 | - if(is_string($index['Column_name'])): ?> |
|
| 14 | - <?php if($index['Non_unique'] == 0): ?> |
|
| 13 | + if (is_string($index['Column_name'])): ?> |
|
| 14 | + <?php if ($index['Non_unique'] == 0): ?> |
|
| 15 | 15 | $this->createIndex('<?= str_replace('_UNIQUE', '', $index['Key_name'])?>', $this->tableName, '<?= $index['Column_name'] ?>', true); |
| 16 | 16 | <?php else: ?> |
| 17 | 17 | $this->createIndex('<?= $index['Key_name'] ?>', $this->tableName, '<?= $index['Column_name'] ?>'); |
| 18 | 18 | <?php endif; ?> |
| 19 | 19 | <?php else: ?> |
| 20 | - $this->createIndex('<?= $index['Key_name'] ?>', $this->tableName, ['<?= implode("','",$index['Column_name']) ?>']); |
|
| 20 | + $this->createIndex('<?= $index['Key_name'] ?>', $this->tableName, ['<?= implode("','", $index['Column_name']) ?>']); |
|
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | <?php endforeach; |
| 23 | 23 | } |