| Conditions | 1 |
| Paths | 1 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function safeUp() |
||
| 22 | { |
||
| 23 | $this->createTable(Visitor::tableName(), [ |
||
| 24 | 'id' => $this->primaryKey(), |
||
| 25 | 'token' => $this->string()->notNull(), |
||
| 26 | 'contact' => $this->text(), |
||
| 27 | 'status' => $this->enum( |
||
| 28 | 'status', |
||
| 29 | [ |
||
| 30 | Visitor::STATUS_SUCCESSFUL, |
||
| 31 | Visitor::STATUS_PENDING, |
||
| 32 | Visitor::STATUS_ERROR, |
||
| 33 | Visitor::STATUS_NOT_FOUND |
||
| 34 | ] |
||
| 35 | ) |
||
| 36 | ->defaultValue(Visitor::STATUS_PENDING) |
||
| 37 | ->notNull(), |
||
| 38 | 'connection' => $this->string(), |
||
| 39 | 'dateCreated' => $this->dateTime()->notNull(), |
||
| 40 | 'dateUpdated' => $this->dateTime()->notNull(), |
||
| 41 | 'uid' => $this->uid() |
||
| 42 | ]); |
||
| 43 | |||
| 44 | $this->createIndex( |
||
| 45 | $this->db->getIndexName(Visitor::tableName(), 'token', true), |
||
| 46 | Visitor::tableName(), |
||
| 47 | 'token', |
||
| 48 | true |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |