2020_05_30_115810_create_users_table.php 868 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. use Illuminate\Database\Migrations\Migration;
  11. use Illuminate\Database\Schema\Blueprint;
  12. use Illuminate\Support\Facades\Schema;
  13. class CreateUsersTable extends Migration
  14. {
  15. /**
  16. * Run the migrations.
  17. */
  18. public function up()
  19. {
  20. Schema::create('users', function (Blueprint $table) {
  21. $table->id();
  22. $table->string('name');
  23. $table->string('email')->unique();
  24. $table->string('password');
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('users');
  34. }
  35. }