Passed
Push — testing ( 57c125...199f7f )
by Hennik
03:23
created

CreateLocationTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
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()
41
    {
42
        Schema::drop('no_spatial_fields');
43
        Schema::drop('test_geometries');
44
    }
45
}
46