| @@ 26-39 (lines=14) @@ | ||
| 23 | /** |
|
| 24 | * This method create users schema. |
|
| 25 | */ |
|
| 26 | public function createUser() |
|
| 27 | { |
|
| 28 | if (! Capsule::schema()->hasTable('users')) { |
|
| 29 | Capsule::schema()->create('users', function ($table) { |
|
| 30 | $table->increments('id'); |
|
| 31 | $table->string('firstname'); |
|
| 32 | $table->string('lastname'); |
|
| 33 | $table->string('username'); |
|
| 34 | $table->string('password'); |
|
| 35 | $table->string('email')->unique(); |
|
| 36 | $table->timestamps(); |
|
| 37 | }); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * This method creates keyword schema. |
|
| @@ 73-85 (lines=13) @@ | ||
| 70 | /** |
|
| 71 | * This method creates emoji schema. |
|
| 72 | */ |
|
| 73 | public function createEmoji() |
|
| 74 | { |
|
| 75 | if (! Capsule::schema()->hasTable('emojis')) { |
|
| 76 | Capsule::schema()->create('emojis', function ($table) { |
|
| 77 | $table->increments('id'); |
|
| 78 | $table->string('name'); |
|
| 79 | $table->string('char'); |
|
| 80 | $table->string('category'); |
|
| 81 | $table->string('created_by'); |
|
| 82 | $table->timestamps(); |
|
| 83 | }); |
|
| 84 | } |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||