2020_07_15_142100_create_rankings_table.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateRankingsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('rankings', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->integer('calendar_id')->unsigned()->nullable();
  17. $table->foreign('calendar_id')->references('id')->on('calendars');
  18. $table->integer('team_id')->unsigned()->nullable();
  19. $table->foreign('team_id')->references('id')->on('teams');
  20. $table->integer('played');
  21. $table->integer('wins');
  22. $table->integer('dwars');
  23. $table->integer('losts');
  24. $table->integer('goals_scored');
  25. $table->integer('goals_conceded');
  26. $table->integer('points');
  27. $table->timestamps();
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('calendar_games');
  38. }
  39. }