| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function execute(CapsuleInterface $capsule) |
||
| 35 | { |
||
| 36 | $schema = $capsule->getSchema($this->getTable(), $this->getDatabase()); |
||
| 37 | |||
| 38 | if ($schema->hasIndex($this->columns)) { |
||
| 39 | $columns = join(',', $this->columns); |
||
| 40 | throw new IndexException( |
||
| 41 | "Unable to create index '{$schema->getName()}'.({$columns}), index already exists" |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | $schema->index($this->columns)->unique( |
||
| 46 | $this->getOption('unique', false) |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | } |