Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
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('token') |
||
19 | ->unique() |
||
20 | ->notNull(); |
||
21 | |||
22 | $table->string('refresh_token') |
||
23 | ->unique() |
||
24 | ->notNull(); |
||
25 | |||
26 | $table->datetime('expire_at') |
||
27 | ->notNull(); |
||
28 | |||
29 | $table->integer('user_id') |
||
30 | ->description('The owner of the token') |
||
31 | ->notNull(); |
||
32 | |||
33 | $table->timestamps(); |
||
34 | |||
35 | $table->foreign('user_id') |
||
36 | ->references('users', 'id') |
||
37 | ->onDelete('NO ACTION'); |
||
38 | |||
39 | $table->engine('INNODB'); |
||
40 | }); |
||
49 |