| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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() |
||
| 43 | } |
||
| 44 | } |
||
| 45 |