Conditions | 2 |
Paths | 2 |
Total Lines | 35 |
Code Lines | 21 |
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 | 'endpoint_id' => ['type' => 'integer', 'notnull' => true], |
||
28 | 'message_id' => ['type' => 'string', 'length' => 32, 'fixed' => 1, 'notnull' => true], |
||
29 | 'is_dispatched' => ['type' => 'boolean', 'notnull' => true], |
||
30 | 'dispatched_at' => ['type' => 'timestamp'], |
||
31 | 'transport_operations' => ['type' => 'clob', 'notnull' => true] |
||
32 | ], |
||
33 | [ |
||
34 | 'indexes' => [ |
||
35 | 'me' => [ |
||
36 | 'fields' => [ |
||
37 | 'message_id' => [], |
||
38 | 'endpoint_id' => [] |
||
39 | ], |
||
40 | 'type' => 'unique' |
||
41 | ], |
||
42 | 'di' => [ |
||
43 | 'fields' => [ |
||
44 | 'dispatched_at' => [], |
||
45 | 'is_dispatched' => [] |
||
46 | ] |
||
47 | ] |
||
48 | ] |
||
49 | ] |
||
50 | ); |
||
51 | } |
||
52 | |||
53 | return $this->schemas[$tableName]; |
||
54 | } |
||
55 | } |
||
56 |