schema_plus_core 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/gemfiles/activerecord-5.0/Gemfile.postgresql +2 -2
- data/gemfiles/activerecord-5.1/Gemfile.postgresql +2 -2
- data/lib/schema_plus/core.rb +1 -1
- data/lib/schema_plus/core/active_record/connection_adapters/postgresql/schema_dumper.rb +1 -2
- data/lib/schema_plus/core/version.rb +1 -1
- data/spec/dumper_spec.rb +9 -0
- data/spec/spec_helper.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a77d048b0af1593358c7a3a3a65eb57eddb2e8088fa5ac0d1704a65d0fe90ea
|
4
|
+
data.tar.gz: 6509557c46101b4fccf4f8cf51100a2c00980a31d4b273523ad3e5be15b470cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 666b330c46324e8b198b649cffa95fce5cba396ca2897919ed05ee93dcf03e5ea52ed6698a2567dd851a2ce18ca06f4e47c5d7da53429623afe20a513da0f786
|
7
|
+
data.tar.gz: 38188d56fc44dcd55bb200f732dec9625d6aa0e22dac55a534c5062d127f59224fe93d05b250b2dda161e85ba611067977e73f104230ca112936d7454d6aa37b
|
data/README.md
CHANGED
@@ -444,6 +444,7 @@ SchemaPlus::Core provides a state object and of callbacks to various phases of t
|
|
444
444
|
|
445
445
|
## Release Notes
|
446
446
|
|
447
|
+
* 2.2.2 Fixed dumping tables in postgresql in AR 5.2 when the PK is not a bigint.
|
447
448
|
* 2.2.1 Fixed expression index handling in AR5.x.
|
448
449
|
* 2.2.0 Added AR5.2 support. Thanks to [@jeremyyap](https://github.com/jeremyyap)
|
449
450
|
* 2.1.1 Bug fix: Don't lose habtm options. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
|
data/lib/schema_plus/core.rb
CHANGED
@@ -26,7 +26,7 @@ require_relative "core/schema_dump"
|
|
26
26
|
require_relative "core/sql_struct"
|
27
27
|
require_relative "core/version"
|
28
28
|
|
29
|
-
if ActiveRecord.version >= Gem::Version.new('5.2
|
29
|
+
if ActiveRecord.version >= Gem::Version.new('5.2')
|
30
30
|
require_relative "core/active_record/connection_adapters/postgresql/schema_dumper"
|
31
31
|
end
|
32
32
|
|
@@ -5,7 +5,6 @@ module SchemaPlus
|
|
5
5
|
module PostgreSQL
|
6
6
|
module PostgreSQL # need two PostgreSQLs because the first gets stripped by schema_monkey
|
7
7
|
module SchemaDumper
|
8
|
-
|
9
8
|
# quick hack fix quoting of column default functions to allow eval() when we
|
10
9
|
# capture the stream.
|
11
10
|
#
|
@@ -20,7 +19,7 @@ module SchemaPlus
|
|
20
19
|
#
|
21
20
|
def prepare_column_options(column, *) # :nodoc:
|
22
21
|
spec = super
|
23
|
-
spec[:default] = "%q{#{column.default_function}}" if column.default_function
|
22
|
+
spec[:default] = "%q{#{column.default_function}}" if column.default_function && !column.serial?
|
24
23
|
spec
|
25
24
|
end
|
26
25
|
|
data/spec/dumper_spec.rb
CHANGED
@@ -82,6 +82,15 @@ describe SchemaMonkey::Middleware::Dumper do
|
|
82
82
|
|
83
83
|
context TestDumper::Middleware::Dumper::Tables do
|
84
84
|
Then { expect(dump).to match(/create_table "other".*create_table "#{middleware}".*create_table "things"/m) }
|
85
|
+
|
86
|
+
context 'int PK handling in rails 5.2+', postgresql: :only, rails: ['>= 5.2.0'] do
|
87
|
+
before(:each) do
|
88
|
+
migration.create_table "inttable", id: :serial do |t|
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
Then { expect(dump).to_not match(/create_table "inttable", id: :serial.*default:/m) }
|
93
|
+
end
|
85
94
|
end
|
86
95
|
|
87
96
|
context TestDumper::Middleware::Dumper::Table do
|
data/spec/spec_helper.rb
CHANGED
@@ -16,6 +16,12 @@ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
|
|
16
16
|
SchemaDev::Rspec.setup
|
17
17
|
|
18
18
|
RSpec.configure do |config|
|
19
|
+
|
20
|
+
config.filter_run_excluding rails: -> (v) {
|
21
|
+
rails_version = Gem::Version.new(ActiveRecord::VERSION::STRING)
|
22
|
+
test = Gem::Requirement.new(v)
|
23
|
+
!test.satisfied_by?(rails_version)
|
24
|
+
}
|
19
25
|
config.warnings = true
|
20
26
|
config.around(:each) do |example|
|
21
27
|
ActiveRecord::Migration.suppress_messages do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_plus_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
238
|
rubyforge_project:
|
239
|
-
rubygems_version: 2.7.
|
239
|
+
rubygems_version: 2.7.8
|
240
240
|
signing_key:
|
241
241
|
specification_version: 4
|
242
242
|
summary: Provides an internal extension API to ActiveRecord
|