| Conditions | 1 |
| Paths | 1 |
| Total Lines | 41 |
| Code Lines | 29 |
| 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 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->enum('status', ['A', 'D']) |
||
| 33 | ->description('The user status, A=Active, D=Deactive/Locked') |
||
| 34 | ->defaultValue('D') |
||
| 35 | ->notNull(); |
||
| 36 | |||
| 37 | $table->string('lastname') |
||
| 38 | ->description('The user lastname') |
||
| 39 | ->notNull(); |
||
| 40 | |||
| 41 | $table->string('firstname') |
||
| 42 | ->description('The user firstname') |
||
| 43 | ->notNull(); |
||
| 44 | |||
| 45 | $table->string('role') |
||
| 46 | ->description('The user role or job'); |
||
| 47 | |||
| 48 | $table->timestamps(); |
||
| 49 | |||
| 50 | $table->engine('INNODB'); |
||
| 51 | }); |
||
| 60 |