Working on Leagues: Adding migrations, controllers, views

This commit is contained in:
Torsten 2017-09-08 16:22:40 +02:00
parent 50cc4c75bf
commit 7bfba61602
16 changed files with 8788 additions and 33 deletions

View file

@ -0,0 +1,47 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLeaguesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('leagues', function (Blueprint $table) {
$table->increments('id');
$table->integer('season_id');
$table->integer('rank');
$table->integer('subrank');
$table->string('name');
$table->boolean('is_qualification');
$table->integer('start_round_id');
$table->integer('round_count');
$table->timestamps();
});
Schema::create('leagues_members', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('league_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('leagues');
Schema::dropIfExists('leagues_members');
}
}

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMatchesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('leagues_matches', function (Blueprint $table) {
$table->increments('id');
$table->integer('league_id');
$table->integer('round_id');
$table->integer('user1_id');
$table->integer('user2_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('league_matches');
}
}