Skip to content

Commit d4b4c7b

Browse files
committed
updates postcodes seeder and table to includes sectors;
1 parent b0150fd commit d4b4c7b

File tree

5 files changed

+403506
-292540
lines changed

5 files changed

+403506
-292540
lines changed

database/migrations/2017_12_07_150800_create_postcodes_table.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
6+
use LaravelEnso\Addresses\Models\Sector;
67

7-
return new class extends Migration
8-
{
8+
return new class extends Migration {
99
public function up()
1010
{
1111
Schema::create('postcodes', function (Blueprint $table) {
@@ -27,9 +27,13 @@ public function up()
2727
$table->foreign('locality_id')->references('id')->on('localities')
2828
->onUpdate('restrict')->onDelete('restrict');
2929

30+
$table->foreignIdFor(Sector::class)->nullable()->constrained();
31+
3032
$table->string('code');
3133
$table->string('city')->nullable();
32-
$table->string('street')->nullable();
34+
$table->string('street_type')->nullable();
35+
$table->string('street_name')->nullable();
36+
$table->string('street_number')->nullable();
3337

3438
$table->float('lat', 10, 6)->nullable();
3539
$table->float('long', 10, 6)->nullable();

0 commit comments

Comments
 (0)