| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('leaderboard_player_rewards', function(Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | |||
| 19 | $table->integer('leaderboard_timescope_id')->unsigned(); |
||
| 20 | $table->integer('player_id')->unsigned(); |
||
| 21 | $table->integer('score_sum')->unsigned()->nullable(); |
||
| 22 | $table->integer('score_sum_rank')->unsigned()->nullable(); |
||
| 23 | $table->integer('highscore_rank')->unsigned()->nullable(); |
||
| 24 | |||
| 25 | $table->timestamps(); |
||
| 26 | |||
| 27 | $table->unique(['leaderboard_timescope_id', 'player_id', 'score_sum']); |
||
| 28 | $table->unique(['leaderboard_timescope_id', 'player_id', 'score_sum_rank']); |
||
| 29 | $table->unique(['leaderboard_timescope_id', 'player_id', 'highscore_rank']); |
||
| 30 | $table->foreign('player_id')->references('id')->on('players')->onDelete('cascade'); |
||
| 31 | $table->foreign('leaderboard_timescope_id')->references('id')->on('leaderboard_timescopes')->onDelete('cascade'); |
||
| 32 | }); |
||
| 45 |