schema_plus_core 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfc1ffe7f432c8e74c488bcf10f95dbe2f2050a7d2b8981a90b154689a635965
4
- data.tar.gz: 01dc5cb4e3dccaacd7c9fe1eb800dab7646fc001e82ec12bcd1cac90b0d47db3
3
+ metadata.gz: 7a77d048b0af1593358c7a3a3a65eb57eddb2e8088fa5ac0d1704a65d0fe90ea
4
+ data.tar.gz: 6509557c46101b4fccf4f8cf51100a2c00980a31d4b273523ad3e5be15b470cb
5
5
  SHA512:
6
- metadata.gz: 675a1ccf6531d7bacc97e1354772c77690fa2ba956402f8054bdb47e60f8c32363a9c54287acf24019b66a74270ac3e39d06a8d8d803f57827d6a2f7eee68d6d
7
- data.tar.gz: '09513084a2643ec5a9a1bb30a9f6aaa308f3e2ed6dc065067b9f2bcec956ef954a9db19ca20ec51cce17794f3a5e4b027bc58b2d44abfbd11c8ffbc1085662af'
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)
@@ -2,9 +2,9 @@ require "pathname"
2
2
  eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
3
 
4
4
  platform :ruby do
5
- gem "pg"
5
+ gem "pg", "< 1"
6
6
  end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcpostgresql-adapter'
10
- end
10
+ end
@@ -2,9 +2,9 @@ require "pathname"
2
2
  eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
3
 
4
4
  platform :ruby do
5
- gem "pg"
5
+ gem "pg", "< 1"
6
6
  end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcpostgresql-adapter'
10
- end
10
+ end
@@ -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.0.rc1')
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
 
@@ -1,5 +1,5 @@
1
1
  module SchemaPlus
2
2
  module Core
3
- VERSION = "2.2.1"
3
+ VERSION = "2.2.2"
4
4
  end
5
5
  end
@@ -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
@@ -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.1
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-04 00:00:00.000000000 Z
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.6
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