Total Complexity | 2 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CreateLocationTable extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('test_geometries', function(Blueprint $table) { |
||
17 | $table->increments('id'); |
||
18 | $table->geometry('geo')->default(null)->nullable(); |
||
19 | $table->point('location'); // required to be not null in order to add an index |
||
20 | $table->lineString('line')->default(null)->nullable(); |
||
21 | $table->polygon('shape')->default(null)->nullable(); |
||
22 | $table->multiPoint('multi_locations')->default(null)->nullable(); |
||
23 | $table->multiLineString('multi_lines')->default(null)->nullable(); |
||
24 | $table->multiPolygon('multi_shapes')->default(null)->nullable(); |
||
25 | $table->geometryCollection('multi_geometries')->default(null)->nullable(); |
||
26 | $table->timestamps(); |
||
27 | }); |
||
28 | |||
29 | Schema::create('no_spatial_fields', function(Blueprint $table) { |
||
30 | $table->increments('id'); |
||
31 | $table->geometry('geometry')->default(null)->nullable(); |
||
32 | }); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Reverse the migrations. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | public function down() |
||
44 | } |
||
45 | } |
||
46 |