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