Test Failed
Push — v0.1 ( 3df3e6...629e1b )
by Hennik
13:04 queued 08:54
created

PostgresGrammar::typeGeography()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace LaravelSpatial\Schema\Grammars;
4
5
use Illuminate\Database\Schema\Grammars\PostgresGrammar as BasePostgresGrammar;
6
use Illuminate\Support\Fluent;
7
use Illuminate\Database\Schema\Blueprint;
8
9
/**
10
 * Class PostgresGrammar
11
 *
12
 * @package LaravelSpatial\Schema\Grammars
13
 */
14
class PostgresGrammar extends BasePostgresGrammar
15
{
16 13
    /**
17
     * @inheritDoc
18 13
     */
19
    public function typePoint(Fluent $column)
20
    {
21
        return parent::typePoint($column);
22
    }
23
24
    /**
25
     * @inheritDoc
26
     */
27 13
    public function typeMultiPoint(Fluent $column)
28
    {
29 13
        return parent::typeMultiPoint($column);
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35
    public function typePolygon(Fluent $column)
36
    {
37
        return parent::typePolygon($column);
38 13
    }
39
40 13
    /**
41
     * @inheritDoc
42
     */
43
    public function typeMultiPolygon(Fluent $column)
44
    {
45
        return parent::typeMultiPolygon($column);
46
    }
47
48
    /**
49 13
     * @inheritDoc
50
     */
51 13
    public function typeLineString(Fluent $column)
52
    {
53
        return parent::typeLineString($column);
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59
    public function typeMultiLineString(Fluent $column)
60 13
    {
61
        return parent::typeMultiLineString($column);
62 13
    }
63
64
    /**
65
     * @inheritDoc
66
     */
67
    public function typeGeography(Fluent $column)
68
    {
69
        return 'GEOGRAPHY';
70
    }
71 13
72
    /**
73 13
     * Adds a statement to add a geometry geometry column
74
     *
75
     * @param Fluent $column
76
     * @return string
77
     */
78
    public function typeGeometry(Fluent $column)
79
    {
80
        return 'GEOGRAPHY(GEOMETRY, 4326)';
81
    }
82
83
    /**
84
     * @inheritDoc
85
     */
86
    public function typeGeometryCollection(Fluent $column)
87
    {
88
        return parent::typeGeometryCollection($column);
89
    }
90
91
    /**
92
     * Adds a statement to create the postgis extension
93 13
     *
94
     * @param Blueprint $blueprint
95 13
     * @param Fluent $command
96
     *
97
     * @return string
98
     */
99
    public function compileEnablePostgis(Blueprint $blueprint, Fluent $command)
100
    {
101
        return 'CREATE EXTENSION postgis';
102
    }
103
104 13
    /**
105
     * Adds a statement to drop the postgis extension
106 13
     *
107
     * @param Blueprint $blueprint
108
     * @param Fluent $command
109
     * @return string
110
     */
111
    public function compileDisablePostgis(Blueprint $blueprint, Fluent $command)
112
    {
113
        return 'DROP EXTENSION postgis';
114
    }
115
}
116