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 +4 -4
- data/.travis.yml +4 -1
- data/README.md +4 -2
- data/gemfiles/activerecord-5.0/Gemfile.base +1 -1
- data/gemfiles/activerecord-5.1/Gemfile.base +3 -0
- data/gemfiles/activerecord-5.1/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-5.1/Gemfile.postgresql +10 -0
- data/gemfiles/activerecord-5.1/Gemfile.sqlite3 +10 -0
- data/lib/schema_plus/core/version.rb +1 -1
- data/schema_dev.yml +2 -1
- data/spec/column_spec.rb +16 -7
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc2ae1c5d8dc9ed272efc4ac0df330ef2671f04
|
4
|
+
data.tar.gz: 58490b0c286338615c6ec80c2772151a671fd039
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abae93a5c70f6c46b3e7781b2c40ab6a44d029066d9e8c37777b8ded5cffc5c79a5d8f1e8a06821b57b02a1f7ea5c4add33136de79720b8ec015a23715dbf390
|
7
|
+
data.tar.gz: bbefabcfd1fa2bacec01a185ee4b3e689515962ad167809dc9b53458285b3d709fc7668b7b3081ec82f780a74de7a02a25895966e60dc111d1d09a7e0e621487
|
data/.travis.yml
CHANGED
@@ -5,11 +5,14 @@
|
|
5
5
|
---
|
6
6
|
sudo: false
|
7
7
|
rvm:
|
8
|
-
- 2.3.
|
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.
|
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
|
-
##
|
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
|
data/schema_dev.yml
CHANGED
data/spec/column_spec.rb
CHANGED
@@ -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:
|
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:
|
65
|
-
{ column_name: "test_reference_type", type: :string, implements_reference:
|
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:
|
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:
|
93
|
-
{ column_name: "test_reference_type", type: :string, implements_reference:
|
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
|
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:
|
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
|