| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function getSchemaFor($tableName) |
||
| 21 | { |
||
| 22 | if (!isset($this->schemas[$tableName])) { |
||
| 23 | $this->schemas[$tableName] = new Schema(); |
||
| 24 | $table = $this->schemas[$tableName]->createTable($tableName); |
||
| 25 | $table->addColumn('id', 'bigint', ['autoincrement' => true]); |
||
| 26 | $table->addColumn('endpoint_id', 'integer'); |
||
| 27 | $table->addColumn('message_id', 'binary', ['length' => 16, 'fixed' => true]); |
||
| 28 | $table->addColumn('is_dispatched', 'smallint'); |
||
| 29 | $table->addColumn('dispatched_at', 'datetime', ['notnull' => false]); |
||
| 30 | $table->addColumn('transport_operations', 'text'); |
||
| 31 | $table->setPrimaryKey(['id']); |
||
| 32 | $table->addUniqueIndex(['message_id', 'endpoint_id']); |
||
| 33 | $table->addIndex(['dispatched_at', 'is_dispatched']); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $this->schemas[$tableName]; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |