postgres_ext-postgis 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0249f0e74ab37125453139a6dfbacaacfc41949d
|
4
|
+
data.tar.gz: 2590696b3a4a761ce7ddce79ee37a9eb0d5cde2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09d2c4474a3ef99b59168258a3e032ff913d6fa391c992540b680c206127ae613d171ba8ec824fc3d04447026388be5064c7fe2ae33a769477ddc27094772c2
|
7
|
+
data.tar.gz: a1297753c17dc788e4085cffd815bf45bf3852051572441ef6dd794647044bc5b762a97938b686f61911dd2ca42348d9cf8a1ae8fba4d8271bb8d52b92d8b121
|
@@ -53,6 +53,15 @@ module PostgresExt::Postgis::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
|
|
53
53
|
|
54
54
|
self
|
55
55
|
end
|
56
|
+
|
57
|
+
def new_column_definition(name, type, options)
|
58
|
+
column = super
|
59
|
+
|
60
|
+
column.srid = options[:srid]
|
61
|
+
column.spatial_type = options[:spatial_type]
|
62
|
+
|
63
|
+
column
|
64
|
+
end
|
56
65
|
end
|
57
66
|
|
58
67
|
module Quoting
|
@@ -30,4 +30,28 @@ describe 'Geometry Migrations' do
|
|
30
30
|
geo_1.sql_type.must_equal 'geometry(LineString,4326)'
|
31
31
|
geo_2.sql_type.must_equal 'geometry(LineString,4326)'
|
32
32
|
end
|
33
|
+
|
34
|
+
it 'adds geometry columns with type and SRID' do
|
35
|
+
connection.create_table :data_types do |t|
|
36
|
+
end
|
37
|
+
|
38
|
+
connection.add_column :data_types, :geo_1, :geometry
|
39
|
+
|
40
|
+
columns = connection.columns(:data_types)
|
41
|
+
geo_1 = columns.find { |c| c.name == 'geo_1' }
|
42
|
+
|
43
|
+
geo_1.sql_type.must_equal 'geometry'
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'adds geometry columns with type and SRID' do
|
47
|
+
connection.create_table :data_types do |t|
|
48
|
+
end
|
49
|
+
|
50
|
+
connection.add_column :data_types, :geo_1, :geometry, spatial_type: :linestring, srid: 4326
|
51
|
+
|
52
|
+
columns = connection.columns(:data_types)
|
53
|
+
geo_1 = columns.find { |c| c.name == 'geo_1' }
|
54
|
+
|
55
|
+
geo_1.sql_type.must_equal 'geometry(LineString,4326)'
|
56
|
+
end
|
33
57
|
end
|