CreateCitiesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 18 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateCitiesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('cities', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->integer('state_id')->unsigned();
19
            $table->string('title');
20
            $table->integer('iso');
21
            $table->integer('iso_ddd');
22
            $table->integer('status');
23
            $table->string('slug');
24
            $table->integer('population');
25
            $table->decimal('lat', 12, 8);
26
            $table->decimal('long', 12, 8);
27
            $table->decimal('income_per_capita', 8, 2);
28
        });
29
30
        Schema::table('cities', function (Blueprint $table) {
31
            $table->foreign('state_id')->references('id')->on('states');
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        Schema::dropIfExists('cities');
43
    }
44
}
45