| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function up(): void |
||
| 11 | { |
||
| 12 | //Action when migrate up |
||
| 13 | $this->create('tokens', function (CreateTable $table) { |
||
| 14 | $table->integer('id') |
||
| 15 | ->autoincrement() |
||
| 16 | ->primary(); |
||
| 17 | |||
| 18 | $table->string('refresh_token') |
||
| 19 | ->unique() |
||
| 20 | ->notNull(); |
||
| 21 | |||
| 22 | $table->datetime('expire_at') |
||
| 23 | ->notNull(); |
||
| 24 | |||
| 25 | $table->integer('user_id') |
||
| 26 | ->description('The owner of the token') |
||
| 27 | ->notNull(); |
||
| 28 | |||
| 29 | $table->timestamps(); |
||
| 30 | |||
| 31 | $table->foreign('user_id') |
||
| 32 | ->references('users', 'id') |
||
| 33 | ->onDelete('NO ACTION'); |
||
| 34 | |||
| 35 | $table->engine('INNODB'); |
||
| 36 | }); |
||
| 45 |