| Conditions | 1 |
| Paths | 1 |
| Total Lines | 45 |
| Code Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function up(): void |
||
| 11 | { |
||
| 12 | //Action when migrate up |
||
| 13 | $this->create('users', function (CreateTable $table) { |
||
| 14 | $table->integer('id') |
||
| 15 | ->autoincrement() |
||
| 16 | ->primary(); |
||
| 17 | |||
| 18 | $table->string('username') |
||
| 19 | ->description('The user username') |
||
| 20 | ->unique() |
||
| 21 | ->notNull(); |
||
| 22 | |||
| 23 | $table->string('email') |
||
| 24 | ->description('The user email') |
||
| 25 | ->unique() |
||
| 26 | ->notNull(); |
||
| 27 | |||
| 28 | $table->string('password') |
||
| 29 | ->description('The user password') |
||
| 30 | ->notNull(); |
||
| 31 | |||
| 32 | $table->integer('status') |
||
| 33 | ->size('tiny') |
||
| 34 | ->description('The user status') |
||
| 35 | ->defaultValue(0); |
||
| 36 | |||
| 37 | $table->integer('age') |
||
| 38 | ->size('tiny') |
||
| 39 | ->description('The user age'); |
||
| 40 | |||
| 41 | $table->string('lastname') |
||
| 42 | ->description('The user lastname'); |
||
| 43 | |||
| 44 | $table->string('firstname') |
||
| 45 | ->description('The user firstname'); |
||
| 46 | |||
| 47 | $table->datetime('created_at') |
||
| 48 | ->description('created date') |
||
| 49 | ->notNull(); |
||
| 50 | |||
| 51 | $table->datetime('updated_at') |
||
| 52 | ->description('last updated date'); |
||
| 53 | |||
| 54 | $table->engine('INNODB'); |
||
| 55 | }); |
||
| 63 | } |