| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| 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', 'integer', ['autoincrement' => true]); |
||
| 26 | $table->addColumn('lookup_hash', 'binary', ['length' => 16, 'fixed' => true]); |
||
| 27 | $table->addColumn('name', 'text'); |
||
| 28 | $table->setPrimaryKey(['id']); |
||
| 29 | $table->addUniqueIndex(['lookup_hash']); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->schemas[$tableName]; |
||
| 33 | } |
||
| 34 | } |
||
| 35 |