@@ -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,22 @@ |
||
8 | 8 | |
9 | 9 | //dd( $indexes ); |
10 | 10 | |
11 | -if($indexes){ |
|
11 | +if($indexes) { |
|
12 | 12 | foreach ($indexes as $index): |
13 | 13 | if(is_string($index['Column_name'])): ?> |
14 | 14 | <?php if($index['Non_unique'] == 0): ?> |
15 | 15 | $this->createIndex('<?= str_replace('_UNIQUE', '', $index['Key_name'])?>', $this->tableName, '<?= $index['Column_name'] ?>', true); |
16 | - <?php else: ?> |
|
16 | + <?php else { |
|
17 | + : ?> |
|
17 | 18 | $this->createIndex('<?= $index['Key_name'] ?>', $this->tableName, '<?= $index['Column_name'] ?>'); |
18 | - <?php endif; ?> |
|
19 | - <?php else: ?> |
|
19 | + <?php endif; |
|
20 | +} |
|
21 | +?> |
|
22 | + <?php else { |
|
23 | + : ?> |
|
20 | 24 | $this->createIndex('<?= $index['Key_name'] ?>', $this->tableName, ['<?= implode("','",$index['Column_name']) ?>']); |
21 | - <?php endif; ?> |
|
25 | + <?php endif; |
|
26 | +} |
|
27 | +?> |
|
22 | 28 | <?php endforeach; |
23 | 29 | } |