Total Complexity | 2 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class CreateGamePlayerTable extends Migration |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Run the migrations. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function up() |
||
16 | { |
||
17 | Schema::create('game_player', function(Blueprint $table) { |
||
18 | $table->increments('id'); |
||
19 | |||
20 | $table->integer('game_id')->unsigned(); |
||
21 | $table->integer('player_id')->unsigned(); |
||
22 | $table->tinyInteger('channel')->unsigned()->default('0'); |
||
23 | $table->smallInteger('version')->unsigned()->default('100'); |
||
24 | $table->boolean('is_hack')->default(false); |
||
25 | |||
26 | $table->timestamps(); |
||
27 | |||
28 | $table->foreign('game_id')->references('id')->on('games')->onDelete('cascade'); |
||
29 | $table->foreign('player_id')->references('id')->on('players')->onDelete('cascade'); |
||
30 | }); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Reverse the migrations. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | public function down() |
||
41 | } |
||
42 | |||
44 |