2016_03_20_153759_create_game_table.php 714 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateGameTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('games', function(Blueprint $table) {
  14. $table->increments('id');
  15. $table->timestamps();
  16. $table->integer('user_id')->unsigned()->nullable();
  17. $table->foreign('user_id')->references('id')->on('users');
  18. $table->integer('game_type');
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. *
  24. * @return void
  25. */
  26. public function down()
  27. {
  28. Schema::drop('games');
  29. }
  30. }