schema_plus_foreign_keys 0.1.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/prs.yml +134 -0
  3. data/.gitignore +1 -0
  4. data/.simplecov +20 -0
  5. data/Gemfile +4 -1
  6. data/README.md +25 -18
  7. data/Rakefile +3 -1
  8. data/gemfiles/Gemfile.base +1 -1
  9. data/gemfiles/activerecord-5.2/Gemfile.base +2 -1
  10. data/gemfiles/activerecord-5.2/Gemfile.mysql2 +2 -2
  11. data/gemfiles/activerecord-5.2/Gemfile.postgresql +2 -2
  12. data/gemfiles/activerecord-5.2/Gemfile.sqlite3 +3 -3
  13. data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
  14. data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
  15. data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
  16. data/gemfiles/{activerecord-4.2.0 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
  17. data/lib/schema_plus/foreign_keys/active_record/base.rb +2 -0
  18. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/abstract/schema_creation.rb +2 -11
  19. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/abstract_adapter.rb +7 -47
  20. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/foreign_key_definition.rb +4 -35
  21. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/mysql2_adapter.rb +15 -16
  22. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/postgresql_adapter.rb +8 -6
  23. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/sqlite3_adapter.rb +8 -6
  24. data/lib/schema_plus/foreign_keys/active_record/connection_adapters/table_definition.rb +7 -46
  25. data/lib/schema_plus/foreign_keys/active_record/migration/command_recorder.rb +4 -2
  26. data/lib/schema_plus/foreign_keys/middleware/dumper.rb +4 -2
  27. data/lib/schema_plus/foreign_keys/middleware/migration.rb +13 -5
  28. data/lib/schema_plus/foreign_keys/middleware/model.rb +2 -0
  29. data/lib/schema_plus/foreign_keys/middleware/mysql.rb +3 -1
  30. data/lib/schema_plus/foreign_keys/middleware/sql.rb +2 -16
  31. data/lib/schema_plus/foreign_keys/version.rb +3 -1
  32. data/lib/schema_plus/foreign_keys.rb +2 -1
  33. data/lib/schema_plus_foreign_keys.rb +2 -0
  34. data/schema_dev.yml +4 -6
  35. data/schema_plus_foreign_keys.gemspec +10 -9
  36. data/spec/deprecation_spec.rb +11 -110
  37. data/spec/foreign_key_definition_spec.rb +5 -3
  38. data/spec/foreign_key_spec.rb +22 -20
  39. data/spec/migration_spec.rb +35 -59
  40. data/spec/named_schemas_spec.rb +16 -14
  41. data/spec/schema_dumper_spec.rb +13 -13
  42. data/spec/spec_helper.rb +4 -2
  43. data/spec/support/reference.rb +3 -2
  44. metadata +31 -89
  45. data/.travis.yml +0 -33
  46. data/gemfiles/activerecord-4.2.0/Gemfile.base +0 -3
  47. data/gemfiles/activerecord-4.2.0/Gemfile.mysql2 +0 -10
  48. data/gemfiles/activerecord-4.2.0/Gemfile.postgresql +0 -10
  49. data/gemfiles/activerecord-4.2.1/Gemfile.base +0 -3
  50. data/gemfiles/activerecord-4.2.1/Gemfile.mysql2 +0 -10
  51. data/gemfiles/activerecord-4.2.1/Gemfile.postgresql +0 -10
  52. data/gemfiles/activerecord-4.2.1/Gemfile.sqlite3 +0 -10
  53. data/gemfiles/activerecord-4.2.6/Gemfile.base +0 -3
  54. data/gemfiles/activerecord-4.2.6/Gemfile.mysql2 +0 -10
  55. data/gemfiles/activerecord-4.2.6/Gemfile.postgresql +0 -10
  56. data/gemfiles/activerecord-4.2.6/Gemfile.sqlite3 +0 -10
  57. data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
  58. data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
  59. data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
  60. data/gemfiles/activerecord-5.0/Gemfile.sqlite3 +0 -10
  61. data/gemfiles/activerecord-5.1/Gemfile.base +0 -3
  62. data/gemfiles/activerecord-5.1/Gemfile.mysql2 +0 -10
  63. data/gemfiles/activerecord-5.1/Gemfile.postgresql +0 -10
  64. data/gemfiles/activerecord-5.1/Gemfile.sqlite3 +0 -10
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus_foreign_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-05 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,48 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.3'
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.3'
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: schema_plus_core
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0'
39
+ version: 3.0.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: 3.0.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: schema_plus_compatibility
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.2'
53
+ version: 1.0.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.2'
60
+ version: 1.0.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: valuable
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -72,48 +72,34 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: its-it
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.2'
82
- type: :runtime
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.2'
89
75
  - !ruby/object:Gem::Dependency
90
76
  name: bundler
91
77
  requirement: !ruby/object:Gem::Requirement
92
78
  requirements:
93
- - - "~>"
79
+ - - ">="
94
80
  - !ruby/object:Gem::Version
95
- version: '1.7'
81
+ version: '0'
96
82
  type: :development
97
83
  prerelease: false
98
84
  version_requirements: !ruby/object:Gem::Requirement
99
85
  requirements:
100
- - - "~>"
86
+ - - ">="
101
87
  - !ruby/object:Gem::Version
102
- version: '1.7'
88
+ version: '0'
103
89
  - !ruby/object:Gem::Dependency
104
90
  name: rake
105
91
  requirement: !ruby/object:Gem::Requirement
106
92
  requirements:
107
93
  - - "~>"
108
94
  - !ruby/object:Gem::Version
109
- version: '10.0'
95
+ version: '13.0'
110
96
  type: :development
111
97
  prerelease: false
112
98
  version_requirements: !ruby/object:Gem::Requirement
113
99
  requirements:
114
100
  - - "~>"
115
101
  - !ruby/object:Gem::Version
116
- version: '10.0'
102
+ version: '13.0'
117
103
  - !ruby/object:Gem::Dependency
118
104
  name: rspec
119
105
  requirement: !ruby/object:Gem::Requirement
@@ -134,42 +120,14 @@ dependencies:
134
120
  requirements:
135
121
  - - "~>"
136
122
  - !ruby/object:Gem::Version
137
- version: '3.5'
123
+ version: '4.1'
138
124
  type: :development
139
125
  prerelease: false
140
126
  version_requirements: !ruby/object:Gem::Requirement
141
127
  requirements:
142
128
  - - "~>"
143
129
  - !ruby/object:Gem::Version
144
- version: '3.5'
145
- - !ruby/object:Gem::Dependency
146
- name: simplecov
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
- - !ruby/object:Gem::Dependency
160
- name: simplecov-gem-profile
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
130
+ version: '4.1'
173
131
  description: 'Extended support for foreign key constraints in ActiveRecord, including:
174
132
  definition as column attribute; deferrable; and SQLite3 support; cleaner dumps;
175
133
  and more!'
@@ -179,37 +137,22 @@ executables: []
179
137
  extensions: []
180
138
  extra_rdoc_files: []
181
139
  files:
140
+ - ".github/workflows/prs.yml"
182
141
  - ".gitignore"
183
- - ".travis.yml"
142
+ - ".simplecov"
184
143
  - Gemfile
185
144
  - LICENSE.txt
186
145
  - README.md
187
146
  - Rakefile
188
147
  - gemfiles/Gemfile.base
189
- - gemfiles/activerecord-4.2.0/Gemfile.base
190
- - gemfiles/activerecord-4.2.0/Gemfile.mysql2
191
- - gemfiles/activerecord-4.2.0/Gemfile.postgresql
192
- - gemfiles/activerecord-4.2.0/Gemfile.sqlite3
193
- - gemfiles/activerecord-4.2.1/Gemfile.base
194
- - gemfiles/activerecord-4.2.1/Gemfile.mysql2
195
- - gemfiles/activerecord-4.2.1/Gemfile.postgresql
196
- - gemfiles/activerecord-4.2.1/Gemfile.sqlite3
197
- - gemfiles/activerecord-4.2.6/Gemfile.base
198
- - gemfiles/activerecord-4.2.6/Gemfile.mysql2
199
- - gemfiles/activerecord-4.2.6/Gemfile.postgresql
200
- - gemfiles/activerecord-4.2.6/Gemfile.sqlite3
201
- - gemfiles/activerecord-5.0/Gemfile.base
202
- - gemfiles/activerecord-5.0/Gemfile.mysql2
203
- - gemfiles/activerecord-5.0/Gemfile.postgresql
204
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
205
- - gemfiles/activerecord-5.1/Gemfile.base
206
- - gemfiles/activerecord-5.1/Gemfile.mysql2
207
- - gemfiles/activerecord-5.1/Gemfile.postgresql
208
- - gemfiles/activerecord-5.1/Gemfile.sqlite3
209
148
  - gemfiles/activerecord-5.2/Gemfile.base
210
149
  - gemfiles/activerecord-5.2/Gemfile.mysql2
211
150
  - gemfiles/activerecord-5.2/Gemfile.postgresql
212
151
  - gemfiles/activerecord-5.2/Gemfile.sqlite3
152
+ - gemfiles/activerecord-6.0/Gemfile.base
153
+ - gemfiles/activerecord-6.0/Gemfile.mysql2
154
+ - gemfiles/activerecord-6.0/Gemfile.postgresql
155
+ - gemfiles/activerecord-6.0/Gemfile.sqlite3
213
156
  - lib/schema_plus/foreign_keys.rb
214
157
  - lib/schema_plus/foreign_keys/active_record/base.rb
215
158
  - lib/schema_plus/foreign_keys/active_record/connection_adapters/abstract/schema_creation.rb
@@ -241,7 +184,7 @@ homepage: https://github.com/SchemaPlus/schema_plus_foreign_keys
241
184
  licenses:
242
185
  - MIT
243
186
  metadata: {}
244
- post_install_message:
187
+ post_install_message:
245
188
  rdoc_options: []
246
189
  require_paths:
247
190
  - lib
@@ -249,16 +192,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
192
  requirements:
250
193
  - - ">="
251
194
  - !ruby/object:Gem::Version
252
- version: '0'
195
+ version: 2.5.0
253
196
  required_rubygems_version: !ruby/object:Gem::Requirement
254
197
  requirements:
255
198
  - - ">="
256
199
  - !ruby/object:Gem::Version
257
200
  version: '0'
258
201
  requirements: []
259
- rubyforge_project:
260
- rubygems_version: 2.7.8
261
- signing_key:
202
+ rubygems_version: 3.0.8
203
+ signing_key:
262
204
  specification_version: 4
263
205
  summary: Extended support for foreign key constraints in ActiveRecord
264
206
  test_files:
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- # This file was auto-generated by the schema_dev tool, based on the data in
2
- # ./schema_dev.yml
3
- # Please do not edit this file; any changes will be overwritten next time
4
- # schema_dev gets run.
5
- ---
6
- sudo: false
7
- rvm:
8
- - 2.3.1
9
- gemfile:
10
- - gemfiles/activerecord-4.2.0/Gemfile.mysql2
11
- - gemfiles/activerecord-4.2.0/Gemfile.postgresql
12
- - gemfiles/activerecord-4.2.0/Gemfile.sqlite3
13
- - gemfiles/activerecord-4.2.1/Gemfile.mysql2
14
- - gemfiles/activerecord-4.2.1/Gemfile.postgresql
15
- - gemfiles/activerecord-4.2.1/Gemfile.sqlite3
16
- - gemfiles/activerecord-4.2.6/Gemfile.mysql2
17
- - gemfiles/activerecord-4.2.6/Gemfile.postgresql
18
- - gemfiles/activerecord-4.2.6/Gemfile.sqlite3
19
- - gemfiles/activerecord-5.0/Gemfile.mysql2
20
- - gemfiles/activerecord-5.0/Gemfile.postgresql
21
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
22
- - gemfiles/activerecord-5.1/Gemfile.mysql2
23
- - gemfiles/activerecord-5.1/Gemfile.postgresql
24
- - gemfiles/activerecord-5.1/Gemfile.sqlite3
25
- - gemfiles/activerecord-5.2/Gemfile.mysql2
26
- - gemfiles/activerecord-5.2/Gemfile.postgresql
27
- - gemfiles/activerecord-5.2/Gemfile.sqlite3
28
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
29
- addons:
30
- postgresql: '9.4'
31
- before_script: bundle exec rake create_databases
32
- after_script: bundle exec rake drop_databases
33
- script: bundle exec rake travis
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "4.2.0"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem 'mysql2', '~> 0.3.13'
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "4.2.1"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem 'mysql2', '~> 0.3.13'
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,10 +0,0 @@
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,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "4.2.6"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2", '>= 0.3.18', '< 0.5'
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,10 +0,0 @@
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,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 5.0.1"
@@ -1,10 +0,0 @@
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
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,10 +0,0 @@
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,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 5.1.0"
@@ -1,10 +0,0 @@
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
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,10 +0,0 @@
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