Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function getSchemaFor($tableName) |
||
21 | { |
||
22 | if (!isset($this->schemas[$tableName])) { |
||
23 | $this->schemas[$tableName] = new Schema( |
||
24 | $tableName, |
||
25 | [ |
||
26 | 'id' => ['type' => 'integer', 'primary' => true, 'autoincrement' => true], |
||
27 | 'lookup_hash' => ['type' => 'string', 'length' => 32, 'fixed' => 1, 'notnull' => true], |
||
28 | 'name' => ['type' => 'string', 'notnull' => true] |
||
29 | ], |
||
30 | [ |
||
31 | 'indexes' => [ |
||
32 | 'lookup_hash' => [ |
||
33 | 'fields' => [ |
||
34 | 'lookup_hash' => [] |
||
35 | ], |
||
36 | 'type' => 'unique' |
||
37 | ] |
||
38 | ] |
||
39 | ] |
||
40 | ); |
||
41 | } |
||
42 | |||
43 | return $this->schemas[$tableName]; |
||
44 | } |
||
45 | } |
||
46 |