Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function execute(CapsuleInterface $capsule): void |
||
37 | { |
||
38 | $schema = $capsule->getSchema($this->getTable()); |
||
39 | $database = $this->database ?? '[default]'; |
||
|
|||
40 | |||
41 | if ($schema->exists()) { |
||
42 | throw new TableException( |
||
43 | "Unable to set primary keys for table '{$database}'.'{$this->getTable()}', table already exists" |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | $schema->setPrimaryKeys($this->columns); |
||
48 | } |
||
50 |