Fix database migrations and seeding
This commit is contained in:
parent
9cc53f9cbf
commit
322f2eabf9
2 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MStaack\LaravelPostgis\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreatePlacesTable extends Migration
|
class CreatePlacesTable extends Migration
|
||||||
|
@ -17,8 +17,8 @@ class CreatePlacesTable extends Migration
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('slug')->unique();
|
$table->string('slug')->unique();
|
||||||
$table->text('description')->nullable();
|
$table->text('description')->nullable();
|
||||||
$table->point('location');
|
$table->text('location');
|
||||||
$table->polygon('polygon')->nullable();
|
$table->text('polygon')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use App\Models\Place;
|
use App\Models\Place;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use MStaack\LaravelPostgis\Geometries\Point;
|
|
||||||
|
|
||||||
class PlacesTableSeeder extends Seeder
|
class PlacesTableSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
@ -16,7 +15,8 @@ class PlacesTableSeeder extends Seeder
|
||||||
$place = new Place();
|
$place = new Place();
|
||||||
$place->name = 'The Bridgewater Pub';
|
$place->name = 'The Bridgewater Pub';
|
||||||
$place->description = 'A lovely local pub with a decent selection of cask ales';
|
$place->description = 'A lovely local pub with a decent selection of cask ales';
|
||||||
$place->location = new Point('53.4983', '-2.3805');
|
$place->latitude = 53.4983;
|
||||||
|
$place->longitude = -2.3805;
|
||||||
$place->external_urls = 'https://foursquare.com/v/123435/the-bridgewater-pub';
|
$place->external_urls = 'https://foursquare.com/v/123435/the-bridgewater-pub';
|
||||||
$place->external_urls = 'https://www.openstreetmap.org/way/987654';
|
$place->external_urls = 'https://www.openstreetmap.org/way/987654';
|
||||||
$place->save();
|
$place->save();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue