schema_plus_core 2.0.1 → 2.1.0

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: 86e2ba87b085b72dbc2117b25926b21cd17c900f
4
- data.tar.gz: 3449adbeb2caf2405162f70aab282a117aa81260
3
+ metadata.gz: 6bc2ae1c5d8dc9ed272efc4ac0df330ef2671f04
4
+ data.tar.gz: 58490b0c286338615c6ec80c2772151a671fd039
5
5
  SHA512:
6
- metadata.gz: f9972320f4d103ed11fb2a2f4e2951d95b47b8212bf9d30f31b61ca0edf137abc01d6590c338a2425922144483848dcf3677378c3d5bff05f4418d316d973d70
7
- data.tar.gz: 8c2a28d46bd37562699a33e5a690c8cfd38cce492693bb08bde076ff2b06ce691f12e101d8f9f6f8bb913006524a598415259183c7d02520b7e17845b88d7f5c
6
+ metadata.gz: abae93a5c70f6c46b3e7781b2c40ab6a44d029066d9e8c37777b8ded5cffc5c79a5d8f1e8a06821b57b02a1f7ea5c4add33136de79720b8ec015a23715dbf390
7
+ data.tar.gz: bbefabcfd1fa2bacec01a185ee4b3e689515962ad167809dc9b53458285b3d709fc7668b7b3081ec82f780a74de7a02a25895966e60dc111d1d09a7e0e621487
@@ -5,11 +5,14 @@
5
5
  ---
6
6
  sudo: false
7
7
  rvm:
8
- - 2.3.0
8
+ - 2.3.1
9
9
  gemfile:
10
10
  - gemfiles/activerecord-5.0/Gemfile.mysql2
11
11
  - gemfiles/activerecord-5.0/Gemfile.postgresql
12
12
  - gemfiles/activerecord-5.0/Gemfile.sqlite3
13
+ - gemfiles/activerecord-5.1/Gemfile.mysql2
14
+ - gemfiles/activerecord-5.1/Gemfile.postgresql
15
+ - gemfiles/activerecord-5.1/Gemfile.sqlite3
13
16
  env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
14
17
  addons:
15
18
  postgresql: '9.4'
data/README.md CHANGED
@@ -23,7 +23,8 @@ SchemaPlus::Core is tested on:
23
23
 
24
24
  <!-- SCHEMA_DEV: MATRIX - begin -->
25
25
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
26
- * ruby **2.3.0** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
26
+ * ruby **2.3.1** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
27
+ * ruby **2.3.1** with activerecord **5.1**, using **mysql2**, **sqlite3** or **postgresql**
27
28
 
28
29
  <!-- SCHEMA_DEV: MATRIX - end -->
29
30
 
@@ -438,8 +439,9 @@ SchemaPlus::Core provides a state object and of callbacks to various phases of t
438
439
  1. When the stack is called, `env.dump.tables[env.table.name]` contains the `env.table` object.
439
440
  2. The base method sets *both* `env.table.columns` and `env.tables.indexes`.
440
441
 
441
- ## History
442
+ ## Release Notes
442
443
 
444
+ * 2.1.0 Added AR5.1 support. Thanks to [@iagopiimenta ](https://github.com/iagopiimenta)
443
445
  * 2.0.1 Tighten up AR dependency. Thanks to [@myabc](https://github.com/myabc).
444
446
  * 2.0.0 Added AR5 support, removed AR4.2 support. Thanks to [@boazy](https://github.com/boazy).
445
447
  * 1.0.2 Missing require
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "activerecord", ">= 5.0.0.beta1", "< 5.1"
3
+ gem "activerecord", "~> 5.0.1"
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "activerecord", "~> 5.1.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -1,5 +1,5 @@
1
1
  module SchemaPlus
2
2
  module Core
3
- VERSION = "2.0.1"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
1
  ruby:
2
- - 2.3.0
2
+ - 2.3.1
3
3
  activerecord:
4
4
  - 5.0
5
+ - 5.1
5
6
  db:
6
7
  - mysql2
7
8
  - sqlite3
@@ -26,6 +26,15 @@ describe SchemaMonkey::Middleware::Migration::Column do
26
26
  context TestImplementsReference::Middleware::Migration::Column do
27
27
  let (:spy) { described_class.const_get(:SPY) }
28
28
 
29
+ let (:pk_type) do
30
+ if ActiveRecord.version >= Gem::Version.new('5.1') &&
31
+ ActiveRecord::Base.connection.adapter_name =~ /mysql|postgresql/i
32
+ :bigint
33
+ else
34
+ :integer
35
+ end
36
+ end
37
+
29
38
  around(:each) do |example|
30
39
  middleware = described_class
31
40
  begin
@@ -52,17 +61,17 @@ describe SchemaMonkey::Middleware::Migration::Column do
52
61
  Then { expect(spy).to match_array [
53
62
  { column_name: "id", type: :primary_key, implements_reference: nil },
54
63
  { column_name: "test_reference_id", type: :reference, implements_reference: nil },
55
- { column_name: "test_reference_id", type: :integer, implements_reference: true }
64
+ { column_name: "test_reference_id", type: pk_type, implements_reference: true }
56
65
  ] }
57
66
  end
58
67
 
59
68
  context "when add polymorphic reference using t.#{method}" do
60
- When { migration.create_table("things") { |t| t.send method, "test_reference", polymorphic: true } }
69
+ When { migration.create_table("things") { |t| t.send method, "test_reference", polymorphic: true, index: true } }
61
70
  Then { expect(spy).to match_array [
62
71
  { column_name: "id", type: :primary_key, implements_reference: nil },
63
72
  { column_name: "test_reference_id", type: :reference, implements_reference: nil },
64
- { column_name: "test_reference_id", type: :integer, implements_reference: true },
65
- { column_name: "test_reference_type", type: :string, implements_reference: true }
73
+ { column_name: "test_reference_id", type: pk_type, implements_reference: true },
74
+ { column_name: "test_reference_type", type: :string, implements_reference: nil }
66
75
  ] }
67
76
  end
68
77
  end
@@ -78,7 +87,7 @@ describe SchemaMonkey::Middleware::Migration::Column do
78
87
  When { migration.add_reference("things", "test_reference") }
79
88
  Then { expect(spy).to match_array [
80
89
  { column_name: "test_reference_id", type: :reference, implements_reference: nil },
81
- { column_name: "test_reference_id", type: :integer, implements_reference: true }
90
+ { column_name: "test_reference_id", type: pk_type, implements_reference: true }
82
91
  ] }
83
92
  end
84
93
 
@@ -89,8 +98,8 @@ describe SchemaMonkey::Middleware::Migration::Column do
89
98
  }
90
99
  Then { expect(spy).to match_array [
91
100
  { column_name: "test_reference_id", type: :reference, implements_reference: nil },
92
- { column_name: "test_reference_id", type: :integer, implements_reference: true },
93
- { column_name: "test_reference_type", type: :string, implements_reference: true }
101
+ { column_name: "test_reference_id", type: pk_type, implements_reference: true },
102
+ { column_name: "test_reference_type", type: :string, implements_reference: nil }
94
103
  ] }
95
104
  end
96
105
 
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.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2017-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -183,6 +183,10 @@ files:
183
183
  - gemfiles/activerecord-5.0/Gemfile.mysql2
184
184
  - gemfiles/activerecord-5.0/Gemfile.postgresql
185
185
  - gemfiles/activerecord-5.0/Gemfile.sqlite3
186
+ - gemfiles/activerecord-5.1/Gemfile.base
187
+ - gemfiles/activerecord-5.1/Gemfile.mysql2
188
+ - gemfiles/activerecord-5.1/Gemfile.postgresql
189
+ - gemfiles/activerecord-5.1/Gemfile.sqlite3
186
190
  - lib/schema_plus/core.rb
187
191
  - lib/schema_plus/core/active_record/base.rb
188
192
  - lib/schema_plus/core/active_record/connection_adapters/abstract_adapter.rb