1: <?php
2:
3: use Illuminate\Database\Schema\Blueprint;
4: use Illuminate\Database\Migrations\Migration;
5:
6: class xxxxCreateUsersTable extends Migration {
7:
8: 9: 10: 11: 12: 13:
14: public function up()
15: {
16:
17:
18: if (!Schema::hasTable('users'))
19: {
20: Schema::create('users', function($table)
21: {
22: $table->increments('id');
23: $table->string('username',100)->unique();
24: $table->string('email', 100);
25: $table->string('password', 100);
26: $table->string('first_name', 100);
27: $table->string('last_name', 100);
28: $table->string('api_token');
29: $table->integer('activated');
30: $table->integer('usergroup_id');
31: $table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
32: $table->timestamp('updated_at')->default('0000-00-00 00:00:00');
33: });
34: }
35: }
36:
37: 38: 39: 40: 41: 42:
43: public function down()
44: {
45: Schema::dropIfExists('users');
46: }
47:
48: }
49: