seed-fu 2.3.6 → 2.3.7

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: c653cddd52f8d49733c3725d7f985698d2846214
4
- data.tar.gz: 86e785e8d5e3d19d48fe45808aa392c45065bd90
3
+ metadata.gz: 9e6088097d2c661a122bb7e45b22c42d7977762b
4
+ data.tar.gz: ed6f3905960a6c9ea1c39642edfda83abe6b2cd4
5
5
  SHA512:
6
- metadata.gz: f2138d8bc33cb593819e7abbb08ad214f658dc16e277dc2784ae3d62f7fe64393e55028dccfdc5f643d059fbc582dc0a2e4e1486304afe37d1a44458023a6ead
7
- data.tar.gz: cfbb3e44bf36479c9f2914350ec9a5767470e79cd0901310feae3bdbfbffd43bda595f588efed17ab5a8d9e8461db89d10328a0d30a09286542acaa60148e683
6
+ metadata.gz: 05f47a07938cb3371fbd94b2136c4fe237879fa607baae0ad68cd455581b28c6b8a301f99bfdc408b3b7a212490cc22828c5966a216bad27a8d71cacdf35883e
7
+ data.tar.gz: f891abb4e51a7d3568efdd8deed6d514658f9e271922a9490c7469c192bfd2731c1abde1550b2622180b3f2305882e3d2fe941956a8a0476332abca8ec67b803
@@ -1,3 +1,10 @@
1
+ Version 2.3.7
2
+ -------------
3
+
4
+ Features:
5
+
6
+ * Postgresql >= 10.0 support
7
+
1
8
  Version 2.3.6
2
9
  -------------
3
10
 
@@ -85,15 +85,23 @@ module SeedFu
85
85
  end
86
86
 
87
87
  def update_id_sequence
88
- if @model_class.connection.adapter_name == "PostgreSQL"
88
+ if @model_class.connection.adapter_name == "PostgreSQL" or @model_class.connection.adapter_name == "PostGIS"
89
89
  return if @model_class.primary_key.nil? || @model_class.sequence_name.nil?
90
90
 
91
91
  quoted_id = @model_class.connection.quote_column_name(@model_class.primary_key)
92
92
  sequence = @model_class.sequence_name
93
93
 
94
- @model_class.connection.execute <<-EOS
95
- SELECT setval('#{sequence}', (SELECT GREATEST(MAX(#{quoted_id})+(SELECT increment_by FROM #{sequence}), (SELECT min_value FROM #{sequence})) FROM #{@model_class.quoted_table_name}), false)
96
- EOS
94
+ if @model_class.connection.postgresql_version >= 100000
95
+ sql =<<-EOS
96
+ SELECT setval('#{sequence}', (SELECT GREATEST(MAX(#{quoted_id})+(SELECT seqincrement FROM pg_sequence WHERE seqrelid = '#{sequence}'::regclass), (SELECT seqmin FROM pg_sequence WHERE seqrelid = '#{sequence}'::regclass)) FROM #{@model_class.quoted_table_name}), false)
97
+ EOS
98
+ else
99
+ sql =<<-EOS
100
+ SELECT setval('#{sequence}', (SELECT GREATEST(MAX(#{quoted_id})+(SELECT increment_by FROM #{sequence}), (SELECT min_value FROM #{sequence})) FROM #{@model_class.quoted_table_name}), false)
101
+ EOS
102
+ end
103
+
104
+ @model_class.connection.execute sql
97
105
  end
98
106
  end
99
107
  end
@@ -1,4 +1,4 @@
1
1
  module SeedFu
2
2
  # The current version of Seed Fu
3
- VERSION = '2.3.6'
3
+ VERSION = '2.3.7'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed-fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.6
4
+ version: 2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-01 00:00:00.000000000 Z
12
+ date: 2017-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord