Passed
Push — v0.1 ( 3df3e6...c4cb79 )
by Hennik
03:52
created

PostgresGrammar::typePoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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 2
cts 2
cp 1
crap 1
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
    /**
17
     * @inheritDoc
18
     */
19 13
    public function typePoint(Fluent $column)
20
    {
21 13
        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 13
    public function typePolygon(Fluent $column)
36
    {
37 13
        return parent::typePolygon($column);
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43 13
    public function typeMultiPolygon(Fluent $column)
44
    {
45 13
        return parent::typeMultiPolygon($column);
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51 13
    public function typeLineString(Fluent $column)
52
    {
53 13
        return parent::typeLineString($column);
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59 13
    public function typeMultiLineString(Fluent $column)
60
    {
61 13
        return parent::typeMultiLineString($column);
62
    }
63
64
    /**
65
     * @inheritDoc
66
     */
67
    public function typeGeography(Fluent $column)
68
    {
69
        return 'GEOGRAPHY';
70
    }
71
72
    /**
73
     * Adds a statement to add a geometry geometry column
74
     *
75
     * @param Fluent $column
76
     * @return string
77
     */
78 13
    public function typeGeometry(Fluent $column)
79
    {
80 13
        return 'GEOGRAPHY(GEOMETRY, 4326)';
81
    }
82
83
    /**
84
     * @inheritDoc
85
     */
86 13
    public function typeGeometryCollection(Fluent $column)
87
    {
88 13
        return parent::typeGeometryCollection($column);
89
    }
90
91
    /**
92
     * Adds a statement to create the postgis extension
93
     *
94
     * @param Blueprint $blueprint
95
     * @param Fluent $command
96
     *
97
     * @return string
98
     */
99 1
    public function compileEnablePostgis(Blueprint $blueprint, Fluent $command)
100
    {
101 1
        return 'CREATE EXTENSION postgis';
102
    }
103
104
    /**
105
     * Adds a statement to drop the postgis extension
106
     *
107
     * @param Blueprint $blueprint
108
     * @param Fluent $command
109
     * @return string
110
     */
111 1
    public function compileDisablePostgis(Blueprint $blueprint, Fluent $command)
112
    {
113 1
        return 'DROP EXTENSION postgis';
114
    }
115
}
116