2016_03_20_164520_create_game_sentence_table.php 843 B

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