CreateLeaguesTable::up()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 19
cts 19
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 18
nc 1
nop 0
crap 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateLeaguesTable extends Migration {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
8
	/**
9
	 * Run the migrations.
10
	 *
11
	 * @return void
12
	 */
13
	public function up()
14
	{
15 9
		Schema::create('leagues', function(Blueprint $table)
16
		{
17 9
			$table->increments('id');
18 9
			$table->string('name');
19 9
			$table->string('slug');
20 9
			$table->text('description');
21 9
			$table->text('url')->nullable();
22
23 9
			$table->string('mode', 16)->default(Config::get('draft.league_defaults.mode'));
24 9
			$table->integer('money')->default(Config::get("draft.league_defaults.money"));
25 9
			$table->string('units', 16)->default(Config::get('draft.league_defaults.units'));
26 9
			$table->integer('extra_weeks')->default(Config::get('draft.league_defaults.extra_weeks'));
27
28 9
			$table->date('start_date');
29 9
			$table->date('end_date');
30 9
			$table->boolean('active')->default(false)->nullable();
31
32 9
			$table->boolean('private')->default(false)->nullable();
33 9
			$table->boolean('featured')->default(false)->nullable();
34
35 9
			$table->timestamps();
36
37 9
			$table->unique('slug');
38 9
		});
39 9
	}
40
41
	/**
42
	 * Reverse the migrations.
43
	 *
44
	 * @return void
45
	 */
46
	public function down()
47
	{
48
		Schema::drop('leagues');
49
	}
50
51
}
52