-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julien Cappiello
committed
Apr 2, 2018
1 parent
266cfc9
commit f155ed8
Showing
24 changed files
with
1,104 additions
and
1,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
database/migrations/2014_10_13_000015_add_lt_users_fields_table.php
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
database/migrations/2014_11_01_171758_create_lt_Venue_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateLtVenueTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('venue', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('venue_name'); | ||
$table->string('address')->nullable(); | ||
$table->string('details')->nullable(); | ||
$table->string('city')->nullable(); | ||
$table->string('CP')->nullable(); | ||
$table->string('state')->nullable(); | ||
$table->string('latitude')->nullable(); | ||
$table->string('longitude')->nullable(); | ||
$table->timestamps(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::drop('venue'); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
database/migrations/2014_11_01_171759_create_lt_Tournament_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Carbon; | ||
use Xoco70\LaravelTournaments\DBHelpers; | ||
|
||
class CreateLtTournamentTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::create('tournament', function (Blueprint $table) { | ||
$table->increments('id'); | ||
//TODO Added ->nullable() to solve FK issue with Sqlite :( | ||
$table->Integer('user_id')->unsigned()->nullable()->index(); | ||
$table->foreign('user_id') | ||
->references('id') | ||
->on('users') | ||
->onUpdate('cascade') | ||
->onDelete('cascade'); | ||
|
||
$table->string('name'); | ||
$table->string('slug')->unique(); | ||
$table->date('dateIni'); | ||
$table->date('dateFin'); | ||
$table->date('registerDateLimit')->nullable()->default(Carbon::now()->addMonth(1)); | ||
$table->integer('sport')->unsigned()->default(1); | ||
$table->string('promoter')->nullable(); | ||
$table->string('host_organization')->nullable(); | ||
$table->string('technical_assistance')->nullable(); | ||
$table->integer('rule_id')->default(1); | ||
$table->tinyInteger('type')->default(1); // 1= local, 2= state, 3= national, 4=continent, 5=world | ||
$table->integer('venue_id')->nullable()->unsigned(); | ||
$table->integer("level_id")->unsigned()->nullable()->default(1); // TODO nullable ??? | ||
$table->foreign('venue_id') | ||
->references('id') | ||
->on('venue'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
DBHelpers::setFKCheckOff(); | ||
Schema::dropIfExists('tournament'); | ||
DBHelpers::setFKCheckOn(); | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
database/migrations/2014_12_03_230347_create_lt_Category_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Xoco70\LaravelTournaments\DBHelpers; | ||
|
||
class CreateLtCategoryTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
|
||
Schema::create('category', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->string('gender')->nullable(); | ||
$table->integer('isTeam')->unsigned()->default(0); | ||
$table->integer('ageCategory')->unsigned()->default(0); // 0 = none, 1 = child, 2= teenager, 3 = adult, 4 = master | ||
$table->integer('ageMin')->unsigned()->default(0); | ||
$table->integer('ageMax')->unsigned()->default(0); | ||
$table->integer('gradeCategory')->unsigned()->default(0); | ||
$table->integer('gradeMin')->unsigned()->default(0); | ||
$table->integer('gradeMax')->unsigned()->default(0); | ||
$table->unique(['name', 'gender', 'isTeam', 'ageCategory', 'ageMin', 'ageMax', 'gradeCategory', 'gradeMin', 'gradeMax'], 'category_fields_unique'); | ||
$table->timestamps(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
|
||
Schema::create('championship', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->integer('tournament_id')->unsigned()->index(); | ||
$table->integer('category_id')->unsigned()->index(); | ||
$table->unique(['tournament_id', 'category_id']); | ||
|
||
$table->foreign('tournament_id') | ||
->references('id') | ||
->on('tournament') | ||
->onUpdate('cascade') | ||
->onDelete('cascade'); | ||
|
||
$table->foreign('category_id') | ||
->references('id') | ||
->on('category') | ||
->onDelete('cascade'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
|
||
Schema::create('competitor', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->integer('short_id')->unsigned()->nullable(); | ||
$table->integer('championship_id')->unsigned()->index(); | ||
$table->foreign('championship_id') | ||
->references('id') | ||
->on('championship') | ||
->onUpdate('cascade') | ||
->onDelete('cascade'); | ||
|
||
$table->integer('user_id')->unsigned()->index(); | ||
$table->foreign('user_id') | ||
->references('id') | ||
->on('users') | ||
->onUpdate('cascade') | ||
->onDelete('cascade'); | ||
|
||
$table->unique(['championship_id', 'short_id']); | ||
$table->unique(['championship_id', 'user_id']); | ||
|
||
$table->boolean('confirmed'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
|
||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
DBHelpers::setFKCheckOff(); | ||
Schema::dropIfExists('competitor'); | ||
Schema::dropIfExists('championship'); | ||
Schema::dropIfExists('category'); | ||
DBHelpers::setFKCheckOn(); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
database/migrations/2014_12_23_025812_create_lt_ChampionshipSettings_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Xoco70\LaravelTournaments\DBHelpers; | ||
use Xoco70\LaravelTournaments\Models\ChampionshipSettings; | ||
|
||
class CreateLtChampionshipSettingsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('championship_settings', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('alias')->nullable(); | ||
$table->integer('championship_id')->unsigned()->unique(); | ||
$table->foreign('championship_id') | ||
->references('id') | ||
->onUpdate('cascade') | ||
->on('championship') | ||
->onDelete('cascade'); | ||
|
||
// Category Section | ||
$table->tinyInteger('treeType')->default(ChampionshipSettings::SINGLE_ELIMINATION); | ||
$table->tinyInteger('fightingAreas')->unsigned()->nullable()->default(1); | ||
$table->integer('limitByEntity')->unsigned()->nullable(); | ||
|
||
// Preliminary | ||
$table->boolean('hasPreliminary')->default(1); | ||
$table->boolean('preliminaryGroupSize')->default(3); | ||
$table->tinyInteger('preliminaryWinner')->default(1); // Number of Competitors that go to next level | ||
$table->string('preliminaryDuration')->nullable(); // Match Duration in preliminary heat | ||
|
||
// Team | ||
$table->tinyInteger('teamSize')->nullable(); // Default is null | ||
$table->tinyInteger('teamReserve')->nullable(); // Default is null | ||
|
||
// Seed | ||
$table->smallInteger('seedQuantity')->nullable(); // Competitors seeded in tree | ||
|
||
//TODO This should go in another table that is not for tree construction but for rules | ||
// Rules | ||
$table->boolean('hasEncho')->default(1); | ||
$table->tinyInteger('enchoQty')->default(0); | ||
$table->string('enchoDuration')->nullable(); | ||
$table->boolean('hasHantei')->default(false); | ||
$table->smallInteger('cost')->nullable(); // Cost of competition | ||
|
||
$table->string('fightDuration')->nullable(); // Can't apply default because text | ||
$table->smallInteger('hanteiLimit')->default(0); // 0 = none, 1 = 1/8, 2 = 1/4, 3=1/2, 4 = FINAL | ||
$table->smallInteger('enchoGoldPoint')->default(0); // 0 = none, 1 = 1/8, 2 = 1/4, 3=1/2, 4 = FINAL | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->engine = 'InnoDB'; | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
DBHelpers::setFKCheckOff(); | ||
Schema::dropIfExists('championship_settings'); | ||
DBHelpers::setFKCheckOn(); | ||
} | ||
} |
Oops, something went wrong.