@@ 6-22 (lines=17) @@ | ||
3 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
4 | use \Illuminate\Database\Schema\Blueprint as Blueprint; |
|
5 | ||
6 | class CreateLeaguesTable |
|
7 | { |
|
8 | /** |
|
9 | * Run the migrations. |
|
10 | * |
|
11 | * @return void |
|
12 | */ |
|
13 | public function run() |
|
14 | { |
|
15 | Capsule::schema()->dropIfExists('leagues'); |
|
16 | Capsule::schema()->create('leagues', function (Blueprint $table) { |
|
17 | $table->increments('id'); |
|
18 | $table->string('name'); |
|
19 | $table->timestamps(); |
|
20 | }); |
|
21 | } |
|
22 | } |
|
23 |
@@ 6-23 (lines=18) @@ | ||
3 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
4 | use \Illuminate\Database\Schema\Blueprint as Blueprint; |
|
5 | ||
6 | class CreateTeamTable |
|
7 | { |
|
8 | /** |
|
9 | * Run the migrations. |
|
10 | * |
|
11 | * @return void |
|
12 | */ |
|
13 | public function run() |
|
14 | { |
|
15 | Capsule::schema()->dropIfExists('teams'); |
|
16 | Capsule::schema()->create('teams', function (Blueprint $table) { |
|
17 | $table->increments('id'); |
|
18 | $table->string('name'); |
|
19 | $table->string('nationality',2); |
|
20 | $table->timestamps(); |
|
21 | }); |
|
22 | } |
|
23 | } |
|
24 |