baza 0.0.21 → 0.0.22

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: 4dc4209add2522108f9c69de529168208afb5f22
4
- data.tar.gz: 16c14dfd76ca60e17f4b3a04c41f91a040454662
3
+ metadata.gz: 8369c9293d5a5bc7d773f2d0b433851dfbfd7357
4
+ data.tar.gz: 536bc2b56f0483e5df1f778552651afa91f0cce1
5
5
  SHA512:
6
- metadata.gz: b6072099f859db6159e8e22ec87bd4adb2bd08bcee2bb77333fd81251513d1ea6426a324ed563872418a3b6cffd6ff13286f3d3d79e3313c305c6ba08994d283
7
- data.tar.gz: b3de0fcbf50b3bb927f2aa8891092abb7d3ba7d1b97de98cad8572da7cd264f8cac11cff28625f2b7ab0028da478e748450c5b9425e77aa43e8c65d9cecb5b2f
6
+ metadata.gz: 2ace04b5dc91c6379d5764cd6229c6519dfec9aff794778a6e1192359b7d3de68b3006d6be48895fa633982762d440fb4ef6908d316a6891bd9c15828d391e4b
7
+ data.tar.gz: 3dd8ab58ffc4e7bef9d7439bb57df231c03f81ed7b6d7a9a754973d4ce94326f266e73b60de82489e8622d4998d6850bccf4db2c02f8a6dd1e7eb7e0a2d000ed
data/Gemfile CHANGED
@@ -3,9 +3,9 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
 
6
- gem "datet", "~> 0.0.25"
7
6
  gem "array_enumerator", "~> 0.0.10"
8
7
  gem "auto_autoloader", "~> 0.0.1"
8
+ gem "datet", "~> 0.0.25"
9
9
  gem "event_handler", "~> 0.0.0"
10
10
  gem "simple_delegate", "~> 0.0.2"
11
11
  gem "string-cases", "~> 0.0.4"
@@ -14,21 +14,21 @@ gem "wref", "~> 0.0.8"
14
14
  # Add dependencies to develop your gem here.
15
15
  # Include everything needed to run rake, tests, features, etc.
16
16
  group :development, :test do
17
- gem "rspec", "3.4.0"
18
- gem "rdoc"
17
+ gem "activerecord", "4.2.5"
18
+ gem "activerecord-jdbc-adapter", platform: :jruby
19
+ gem "best_practice_project", "0.0.9", require: false
19
20
  gem "bundler"
20
- gem "jeweler"
21
- gem "pry"
22
- gem "jdbc-sqlite3", platform: :jruby
23
21
  gem "jdbc-mysql", platform: :jruby
24
- gem "activerecord-jdbc-adapter", platform: :jruby
25
- gem "sqlite3", platform: :ruby
22
+ gem "jdbc-sqlite3", platform: :jruby
23
+ gem "jeweler", "2.3.3"
26
24
  gem "mysql", "2.9.1", platform: :ruby
27
25
  gem "mysql2", "0.4.2", platform: :ruby
28
26
  gem "pg", "0.18.4", platform: :ruby
29
- gem "activerecord", "4.2.5"
30
- gem "best_practice_project", "0.0.9", require: false
27
+ gem "pry"
28
+ gem "rdoc"
29
+ gem "rspec", "3.4.0"
31
30
  gem "rubocop", "0.39.0", require: false
31
+ gem "sqlite3", platform: :ruby
32
32
  end
33
33
 
34
34
  gem "codeclimate-test-reporter", group: :test, require: nil
@@ -16,7 +16,8 @@ GEM
16
16
  minitest (~> 5.1)
17
17
  thread_safe (~> 0.3, >= 0.3.4)
18
18
  tzinfo (~> 1.1)
19
- addressable (2.3.8)
19
+ addressable (2.5.0)
20
+ public_suffix (~> 2.0, >= 2.0.2)
20
21
  arel (6.0.3)
21
22
  array_enumerator (0.0.10)
22
23
  ast (2.2.0)
@@ -34,52 +35,55 @@ GEM
34
35
  diff-lcs (1.2.5)
35
36
  docile (1.1.5)
36
37
  event_handler (0.0.0)
37
- faraday (0.9.1)
38
+ faraday (0.9.2)
38
39
  multipart-post (>= 1.2, < 3)
39
40
  ffi (1.9.10-java)
40
- git (1.2.9.1)
41
- github_api (0.12.3)
41
+ git (1.3.0)
42
+ github_api (0.11.3)
42
43
  addressable (~> 2.3)
43
- descendants_tracker (~> 0.0.4)
44
+ descendants_tracker (~> 0.0.1)
44
45
  faraday (~> 0.8, < 0.10)
45
- hashie (>= 3.3)
46
+ hashie (>= 1.2)
46
47
  multi_json (>= 1.7.5, < 2.0)
47
- nokogiri (~> 1.6.3)
48
+ nokogiri (~> 1.6.0)
48
49
  oauth2
49
- hashie (3.4.2)
50
- highline (1.7.2)
50
+ hashie (3.4.6)
51
+ highline (1.7.8)
51
52
  i18n (0.7.0)
53
+ jar-dependencies (0.3.9)
52
54
  jdbc-mysql (5.1.37)
53
55
  jdbc-sqlite3 (3.8.11.2)
54
- jeweler (2.0.1)
56
+ jeweler (2.3.3)
55
57
  builder
56
58
  bundler (>= 1.0)
57
59
  git (>= 1.2.5)
58
- github_api
60
+ github_api (~> 0.11.0)
59
61
  highline (>= 1.6.15)
60
62
  nokogiri (>= 1.5.10)
63
+ psych (~> 2.2)
61
64
  rake
62
65
  rdoc
66
+ semver2
63
67
  json (1.8.3)
64
68
  json (1.8.3-java)
65
- jwt (1.5.1)
69
+ jwt (1.5.6)
66
70
  method_source (0.8.2)
67
- mini_portile (0.6.2)
71
+ mini_portile2 (2.1.0)
68
72
  minitest (5.8.3)
69
- multi_json (1.11.2)
70
- multi_xml (0.5.5)
73
+ multi_json (1.12.1)
74
+ multi_xml (0.6.0)
71
75
  multipart-post (2.0.0)
72
76
  mysql (2.9.1)
73
77
  mysql2 (0.4.2)
74
- nokogiri (1.6.6.2)
75
- mini_portile (~> 0.6.0)
76
- nokogiri (1.6.6.2-java)
77
- oauth2 (1.0.0)
78
- faraday (>= 0.8, < 0.10)
78
+ nokogiri (1.6.8.1)
79
+ mini_portile2 (~> 2.1.0)
80
+ nokogiri (1.6.8.1-java)
81
+ oauth2 (1.3.0)
82
+ faraday (>= 0.8, < 0.11)
79
83
  jwt (~> 1.0)
80
84
  multi_json (~> 1.3)
81
85
  multi_xml (~> 0.5)
82
- rack (~> 1.2)
86
+ rack (>= 1.2, < 3)
83
87
  parser (2.3.0.7)
84
88
  ast (~> 2.2)
85
89
  pg (0.18.4)
@@ -93,9 +97,13 @@ GEM
93
97
  method_source (~> 0.8.1)
94
98
  slop (~> 3.4)
95
99
  spoon (~> 0.0)
96
- rack (1.6.4)
100
+ psych (2.2.2)
101
+ psych (2.2.2-java)
102
+ jar-dependencies (>= 0.1.7)
103
+ public_suffix (2.0.5)
104
+ rack (2.0.1)
97
105
  rainbow (2.1.0)
98
- rake (10.4.2)
106
+ rake (12.0.0)
99
107
  rdoc (4.2.0)
100
108
  json (~> 1.4)
101
109
  rspec (3.4.0)
@@ -118,6 +126,7 @@ GEM
118
126
  ruby-progressbar (~> 1.7)
119
127
  unicode-display_width (~> 1.0, >= 1.0.1)
120
128
  ruby-progressbar (1.7.5)
129
+ semver2 (3.4.2)
121
130
  simple_delegate (0.0.2)
122
131
  simplecov (0.10.0)
123
132
  docile (~> 1.1.0)
@@ -152,7 +161,7 @@ DEPENDENCIES
152
161
  event_handler (~> 0.0.0)
153
162
  jdbc-mysql
154
163
  jdbc-sqlite3
155
- jeweler
164
+ jeweler (= 2.3.3)
156
165
  mysql (= 2.9.1)
157
166
  mysql2 (= 0.4.2)
158
167
  pg (= 0.18.4)
@@ -166,4 +175,4 @@ DEPENDENCIES
166
175
  wref (~> 0.0.8)
167
176
 
168
177
  BUNDLED WITH
169
- 1.11.2
178
+ 1.13.7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.21
1
+ 0.0.22
@@ -2,18 +2,18 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: baza 0.0.21 ruby lib
5
+ # stub: baza 0.0.22 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "baza"
9
- s.version = "0.0.21"
8
+ s.name = "baza".freeze
9
+ s.version = "0.0.22"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Kasper Johansen"]
14
- s.date = "2016-04-09"
15
- s.description = "A database abstraction layer, model framework and database framework."
16
- s.email = "kj@gfish.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Kasper Johansen".freeze]
14
+ s.date = "2017-01-22"
15
+ s.description = "A database abstraction layer, model framework and database framework.".freeze
16
+ s.email = "kj@gfish.com".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.md"
@@ -58,6 +58,7 @@ Gem::Specification.new do |s|
58
58
  "lib/baza/driver/mysql/commands.rb",
59
59
  "lib/baza/driver/mysql/database.rb",
60
60
  "lib/baza/driver/mysql/databases.rb",
61
+ "lib/baza/driver/mysql/foreign_key.rb",
61
62
  "lib/baza/driver/mysql/index.rb",
62
63
  "lib/baza/driver/mysql/indexes.rb",
63
64
  "lib/baza/driver/mysql/result.rb",
@@ -99,6 +100,7 @@ Gem::Specification.new do |s|
99
100
  "lib/baza/driver/pg/create_index_sql_creator.rb",
100
101
  "lib/baza/driver/pg/database.rb",
101
102
  "lib/baza/driver/pg/databases.rb",
103
+ "lib/baza/driver/pg/foreign_key.rb",
102
104
  "lib/baza/driver/pg/index.rb",
103
105
  "lib/baza/driver/pg/indexes.rb",
104
106
  "lib/baza/driver/pg/result.rb",
@@ -130,6 +132,7 @@ Gem::Specification.new do |s|
130
132
  "lib/baza/driver/sqlite3_rhodes.rb",
131
133
  "lib/baza/dump.rb",
132
134
  "lib/baza/errors.rb",
135
+ "lib/baza/foreign_key.rb",
133
136
  "lib/baza/idquery.rb",
134
137
  "lib/baza/index.rb",
135
138
  "lib/baza/jdbc_driver.rb",
@@ -179,88 +182,89 @@ Gem::Specification.new do |s|
179
182
  "spec/support/driver_collection.rb",
180
183
  "spec/support/driver_columns_collection.rb",
181
184
  "spec/support/driver_databases_collection.rb",
185
+ "spec/support/driver_foreign_keys_collection.rb",
182
186
  "spec/support/driver_indexes_collection.rb",
183
187
  "spec/support/driver_tables_collection.rb",
184
188
  "spec/support/driver_users_collection.rb"
185
189
  ]
186
- s.homepage = "http://github.com/kaspernj/baza"
187
- s.licenses = ["MIT"]
188
- s.rubygems_version = "2.2.2"
189
- s.summary = "A database abstraction layer, model framework and database framework."
190
+ s.homepage = "http://github.com/kaspernj/baza".freeze
191
+ s.licenses = ["MIT".freeze]
192
+ s.rubygems_version = "2.6.8".freeze
193
+ s.summary = "A database abstraction layer, model framework and database framework.".freeze
190
194
 
191
195
  if s.respond_to? :specification_version then
192
196
  s.specification_version = 4
193
197
 
194
198
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
195
- s.add_runtime_dependency(%q<datet>, ["~> 0.0.25"])
196
- s.add_runtime_dependency(%q<array_enumerator>, ["~> 0.0.10"])
197
- s.add_runtime_dependency(%q<auto_autoloader>, ["~> 0.0.1"])
198
- s.add_runtime_dependency(%q<event_handler>, ["~> 0.0.0"])
199
- s.add_runtime_dependency(%q<simple_delegate>, ["~> 0.0.2"])
200
- s.add_runtime_dependency(%q<string-cases>, ["~> 0.0.4"])
201
- s.add_runtime_dependency(%q<wref>, ["~> 0.0.8"])
202
- s.add_development_dependency(%q<rspec>, ["= 3.4.0"])
203
- s.add_development_dependency(%q<rdoc>, [">= 0"])
204
- s.add_development_dependency(%q<bundler>, [">= 0"])
205
- s.add_development_dependency(%q<jeweler>, [">= 0"])
206
- s.add_development_dependency(%q<pry>, [">= 0"])
207
- s.add_development_dependency(%q<jdbc-sqlite3>, [">= 0"])
208
- s.add_development_dependency(%q<jdbc-mysql>, [">= 0"])
209
- s.add_development_dependency(%q<activerecord-jdbc-adapter>, [">= 0"])
210
- s.add_development_dependency(%q<sqlite3>, [">= 0"])
211
- s.add_development_dependency(%q<mysql>, ["= 2.9.1"])
212
- s.add_development_dependency(%q<mysql2>, ["= 0.4.2"])
213
- s.add_development_dependency(%q<pg>, ["= 0.18.4"])
214
- s.add_development_dependency(%q<activerecord>, ["= 4.2.5"])
215
- s.add_development_dependency(%q<best_practice_project>, ["= 0.0.9"])
216
- s.add_development_dependency(%q<rubocop>, ["= 0.39.0"])
199
+ s.add_runtime_dependency(%q<array_enumerator>.freeze, ["~> 0.0.10"])
200
+ s.add_runtime_dependency(%q<auto_autoloader>.freeze, ["~> 0.0.1"])
201
+ s.add_runtime_dependency(%q<datet>.freeze, ["~> 0.0.25"])
202
+ s.add_runtime_dependency(%q<event_handler>.freeze, ["~> 0.0.0"])
203
+ s.add_runtime_dependency(%q<simple_delegate>.freeze, ["~> 0.0.2"])
204
+ s.add_runtime_dependency(%q<string-cases>.freeze, ["~> 0.0.4"])
205
+ s.add_runtime_dependency(%q<wref>.freeze, ["~> 0.0.8"])
206
+ s.add_development_dependency(%q<activerecord>.freeze, ["= 4.2.5"])
207
+ s.add_development_dependency(%q<activerecord-jdbc-adapter>.freeze, [">= 0"])
208
+ s.add_development_dependency(%q<best_practice_project>.freeze, ["= 0.0.9"])
209
+ s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
210
+ s.add_development_dependency(%q<jdbc-mysql>.freeze, [">= 0"])
211
+ s.add_development_dependency(%q<jdbc-sqlite3>.freeze, [">= 0"])
212
+ s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.3"])
213
+ s.add_development_dependency(%q<mysql>.freeze, ["= 2.9.1"])
214
+ s.add_development_dependency(%q<mysql2>.freeze, ["= 0.4.2"])
215
+ s.add_development_dependency(%q<pg>.freeze, ["= 0.18.4"])
216
+ s.add_development_dependency(%q<pry>.freeze, [">= 0"])
217
+ s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
218
+ s.add_development_dependency(%q<rspec>.freeze, ["= 3.4.0"])
219
+ s.add_development_dependency(%q<rubocop>.freeze, ["= 0.39.0"])
220
+ s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
217
221
  else
218
- s.add_dependency(%q<datet>, ["~> 0.0.25"])
219
- s.add_dependency(%q<array_enumerator>, ["~> 0.0.10"])
220
- s.add_dependency(%q<auto_autoloader>, ["~> 0.0.1"])
221
- s.add_dependency(%q<event_handler>, ["~> 0.0.0"])
222
- s.add_dependency(%q<simple_delegate>, ["~> 0.0.2"])
223
- s.add_dependency(%q<string-cases>, ["~> 0.0.4"])
224
- s.add_dependency(%q<wref>, ["~> 0.0.8"])
225
- s.add_dependency(%q<rspec>, ["= 3.4.0"])
226
- s.add_dependency(%q<rdoc>, [">= 0"])
227
- s.add_dependency(%q<bundler>, [">= 0"])
228
- s.add_dependency(%q<jeweler>, [">= 0"])
229
- s.add_dependency(%q<pry>, [">= 0"])
230
- s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
231
- s.add_dependency(%q<jdbc-mysql>, [">= 0"])
232
- s.add_dependency(%q<activerecord-jdbc-adapter>, [">= 0"])
233
- s.add_dependency(%q<sqlite3>, [">= 0"])
234
- s.add_dependency(%q<mysql>, ["= 2.9.1"])
235
- s.add_dependency(%q<mysql2>, ["= 0.4.2"])
236
- s.add_dependency(%q<pg>, ["= 0.18.4"])
237
- s.add_dependency(%q<activerecord>, ["= 4.2.5"])
238
- s.add_dependency(%q<best_practice_project>, ["= 0.0.9"])
239
- s.add_dependency(%q<rubocop>, ["= 0.39.0"])
222
+ s.add_dependency(%q<array_enumerator>.freeze, ["~> 0.0.10"])
223
+ s.add_dependency(%q<auto_autoloader>.freeze, ["~> 0.0.1"])
224
+ s.add_dependency(%q<datet>.freeze, ["~> 0.0.25"])
225
+ s.add_dependency(%q<event_handler>.freeze, ["~> 0.0.0"])
226
+ s.add_dependency(%q<simple_delegate>.freeze, ["~> 0.0.2"])
227
+ s.add_dependency(%q<string-cases>.freeze, ["~> 0.0.4"])
228
+ s.add_dependency(%q<wref>.freeze, ["~> 0.0.8"])
229
+ s.add_dependency(%q<activerecord>.freeze, ["= 4.2.5"])
230
+ s.add_dependency(%q<activerecord-jdbc-adapter>.freeze, [">= 0"])
231
+ s.add_dependency(%q<best_practice_project>.freeze, ["= 0.0.9"])
232
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
233
+ s.add_dependency(%q<jdbc-mysql>.freeze, [">= 0"])
234
+ s.add_dependency(%q<jdbc-sqlite3>.freeze, [">= 0"])
235
+ s.add_dependency(%q<jeweler>.freeze, ["= 2.3.3"])
236
+ s.add_dependency(%q<mysql>.freeze, ["= 2.9.1"])
237
+ s.add_dependency(%q<mysql2>.freeze, ["= 0.4.2"])
238
+ s.add_dependency(%q<pg>.freeze, ["= 0.18.4"])
239
+ s.add_dependency(%q<pry>.freeze, [">= 0"])
240
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
241
+ s.add_dependency(%q<rspec>.freeze, ["= 3.4.0"])
242
+ s.add_dependency(%q<rubocop>.freeze, ["= 0.39.0"])
243
+ s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
240
244
  end
241
245
  else
242
- s.add_dependency(%q<datet>, ["~> 0.0.25"])
243
- s.add_dependency(%q<array_enumerator>, ["~> 0.0.10"])
244
- s.add_dependency(%q<auto_autoloader>, ["~> 0.0.1"])
245
- s.add_dependency(%q<event_handler>, ["~> 0.0.0"])
246
- s.add_dependency(%q<simple_delegate>, ["~> 0.0.2"])
247
- s.add_dependency(%q<string-cases>, ["~> 0.0.4"])
248
- s.add_dependency(%q<wref>, ["~> 0.0.8"])
249
- s.add_dependency(%q<rspec>, ["= 3.4.0"])
250
- s.add_dependency(%q<rdoc>, [">= 0"])
251
- s.add_dependency(%q<bundler>, [">= 0"])
252
- s.add_dependency(%q<jeweler>, [">= 0"])
253
- s.add_dependency(%q<pry>, [">= 0"])
254
- s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
255
- s.add_dependency(%q<jdbc-mysql>, [">= 0"])
256
- s.add_dependency(%q<activerecord-jdbc-adapter>, [">= 0"])
257
- s.add_dependency(%q<sqlite3>, [">= 0"])
258
- s.add_dependency(%q<mysql>, ["= 2.9.1"])
259
- s.add_dependency(%q<mysql2>, ["= 0.4.2"])
260
- s.add_dependency(%q<pg>, ["= 0.18.4"])
261
- s.add_dependency(%q<activerecord>, ["= 4.2.5"])
262
- s.add_dependency(%q<best_practice_project>, ["= 0.0.9"])
263
- s.add_dependency(%q<rubocop>, ["= 0.39.0"])
246
+ s.add_dependency(%q<array_enumerator>.freeze, ["~> 0.0.10"])
247
+ s.add_dependency(%q<auto_autoloader>.freeze, ["~> 0.0.1"])
248
+ s.add_dependency(%q<datet>.freeze, ["~> 0.0.25"])
249
+ s.add_dependency(%q<event_handler>.freeze, ["~> 0.0.0"])
250
+ s.add_dependency(%q<simple_delegate>.freeze, ["~> 0.0.2"])
251
+ s.add_dependency(%q<string-cases>.freeze, ["~> 0.0.4"])
252
+ s.add_dependency(%q<wref>.freeze, ["~> 0.0.8"])
253
+ s.add_dependency(%q<activerecord>.freeze, ["= 4.2.5"])
254
+ s.add_dependency(%q<activerecord-jdbc-adapter>.freeze, [">= 0"])
255
+ s.add_dependency(%q<best_practice_project>.freeze, ["= 0.0.9"])
256
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
257
+ s.add_dependency(%q<jdbc-mysql>.freeze, [">= 0"])
258
+ s.add_dependency(%q<jdbc-sqlite3>.freeze, [">= 0"])
259
+ s.add_dependency(%q<jeweler>.freeze, ["= 2.3.3"])
260
+ s.add_dependency(%q<mysql>.freeze, ["= 2.9.1"])
261
+ s.add_dependency(%q<mysql2>.freeze, ["= 0.4.2"])
262
+ s.add_dependency(%q<pg>.freeze, ["= 0.18.4"])
263
+ s.add_dependency(%q<pry>.freeze, [">= 0"])
264
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
265
+ s.add_dependency(%q<rspec>.freeze, ["= 3.4.0"])
266
+ s.add_dependency(%q<rubocop>.freeze, ["= 0.39.0"])
267
+ s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
264
268
  end
265
269
  end
266
270
 
@@ -15,6 +15,25 @@ class Baza::Driver::Mysql::Column < Baza::Column
15
15
  @name
16
16
  end
17
17
 
18
+ def create_foreign_key(args)
19
+ fk_name = args[:name]
20
+ fk_name ||= "fk_#{table_name}_#{name}"
21
+
22
+ other_column = args.fetch(:column)
23
+ other_table = other_column.table
24
+
25
+ sql = "
26
+ ALTER TABLE #{@db.escape_table(table_name)}
27
+ ADD CONSTRAINT #{@db.escape_table(fk_name)}
28
+ FOREIGN KEY (#{@db.escape_table(name)})
29
+ REFERENCES #{@db.escape_table(other_table.name)} (#{@db.escape_column(other_column.name)})
30
+ "
31
+
32
+ @db.query(sql)
33
+
34
+ true
35
+ end
36
+
18
37
  def table_name
19
38
  @args.fetch(:table_name)
20
39
  end
@@ -0,0 +1,19 @@
1
+ class Baza::Driver::Mysql::ForeignKey < Baza::ForeignKey
2
+ def initialize(args)
3
+ @db = args.fetch(:db)
4
+
5
+ data = args.fetch(:data)
6
+
7
+ @column_name = data.fetch(:COLUMN_NAME)
8
+ @name = data.fetch(:CONSTRAINT_NAME)
9
+ @table_name = data.fetch(:TABLE_NAME)
10
+ end
11
+
12
+ def drop
13
+ @db.query("
14
+ ALTER TABLE `#{@db.escape_table(table_name)}`
15
+ DROP FOREIGN KEY `#{@db.escape_table(name)}`
16
+ ")
17
+ true
18
+ end
19
+ end
@@ -95,15 +95,60 @@ class Baza::Driver::Mysql::Table < Baza::Table
95
95
  end
96
96
  end
97
97
 
98
- def indexes(args = nil)
99
- @db.indexes
100
- ret = []
98
+ def foreign_keys(args = {})
99
+ sql = "
100
+ SELECT
101
+ TABLE_NAME,
102
+ COLUMN_NAME,
103
+ CONSTRAINT_NAME,
104
+ REFERENCED_TABLE_NAME,
105
+ REFERENCED_COLUMN_NAME
106
+
107
+ FROM
108
+ INFORMATION_SCHEMA.KEY_COLUMN_USAGE
109
+
110
+ WHERE
111
+ REFERENCED_TABLE_SCHEMA = '#{@db.escape_database(@db.current_database_name)}' AND
112
+ TABLE_NAME = '#{@db.escape_table(name)}'
113
+ "
114
+
115
+ sql << " AND CONSTRAINT_NAME = '#{@db.escape(args.fetch(:name))}'" if args[:name]
116
+
117
+ result = [] unless block_given?
118
+
119
+ @db.query(sql) do |data|
120
+ foreign_key = Baza::Driver::Mysql::ForeignKey.new(
121
+ db: @db,
122
+ data: data
123
+ )
124
+
125
+ if block_given?
126
+ yield foreign_key
127
+ else
128
+ result << foreign_key
129
+ end
130
+ end
131
+
132
+ result
133
+ end
134
+
135
+ def foreign_key(name)
136
+ foreign_keys(name: name) do |foreign_key|
137
+ return foreign_key
138
+ end
139
+
140
+ raise Baza::Errors::ForeignKeyNotFound, "Foreign key not found: #{name}"
141
+ end
142
+
143
+ def indexes(args = nil, &blk)
144
+ ret = {}
101
145
 
102
146
  sql = "SHOW INDEX FROM `#{@db.escape_table(name)}`"
103
147
  sql << " WHERE `Key_name` = '#{@db.esc(args.fetch(:name))}'" if args && args.key?(:name)
104
148
 
105
149
  @db.query(sql) do |d_indexes|
106
150
  next if d_indexes[:Key_name] == "PRIMARY"
151
+
107
152
  index_name = d_indexes.fetch(:Key_name)
108
153
  obj = @indexes_list.get(index_name)
109
154
 
@@ -113,21 +158,17 @@ class Baza::Driver::Mysql::Table < Baza::Table
113
158
  db: @db,
114
159
  data: d_indexes
115
160
  )
116
- obj.columns << d_indexes.fetch(:Column_name)
117
161
  @indexes_list[index_name] = obj
118
162
  end
119
163
 
120
- if block_given?
121
- yield obj
122
- else
123
- ret << obj
124
- end
164
+ obj.columns << d_indexes.fetch(:Column_name) unless obj.columns.include?(d_indexes.fetch(:Column_name))
165
+ ret[obj.name] = obj unless ret.key?(obj.name)
125
166
  end
126
167
 
127
- if block_given?
128
- return nil
168
+ if blk
169
+ ret.values.each(&blk)
129
170
  else
130
- return ret
171
+ return ret.values
131
172
  end
132
173
  end
133
174
 
@@ -8,7 +8,26 @@ class Baza::Driver::Pg::Column < Baza::Column
8
8
  end
9
9
 
10
10
  def table_name
11
- @data.fetch(:table_name)
11
+ @_table_name ||= @data.fetch(:table_name)
12
+ end
13
+
14
+ def create_foreign_key(args)
15
+ fk_name = args[:name]
16
+ fk_name ||= "fk_#{table_name}_#{name}"
17
+
18
+ other_column = args.fetch(:column)
19
+ other_table = other_column.table
20
+
21
+ sql = "
22
+ ALTER TABLE #{@db.escape_table(table_name)}
23
+ ADD CONSTRAINT #{@db.escape_table(fk_name)}
24
+ FOREIGN KEY (#{@db.escape_table(name)})
25
+ REFERENCES #{@db.escape_table(other_table.name)} (#{@db.escape_column(other_column.name)})
26
+ "
27
+
28
+ @db.query(sql)
29
+
30
+ true
12
31
  end
13
32
 
14
33
  def type
@@ -0,0 +1,19 @@
1
+ class Baza::Driver::Pg::ForeignKey < Baza::ForeignKey
2
+ def initialize(args)
3
+ @db = args.fetch(:db)
4
+
5
+ data = args.fetch(:data)
6
+
7
+ @column_name = data.fetch(:column_name)
8
+ @name = data.fetch(:constraint_name)
9
+ @table_name = data.fetch(:table_name)
10
+ end
11
+
12
+ def drop
13
+ @db.query("
14
+ ALTER TABLE #{@db.escape_table(table_name)}
15
+ DROP CONSTRAINT #{@db.escape_table(name)}
16
+ ")
17
+ true
18
+ end
19
+ end
@@ -49,7 +49,7 @@ class Baza::Driver::Pg::Table < Baza::Table
49
49
 
50
50
  def column(name)
51
51
  column = columns(name: name).first
52
- raise Baza::Errors::ColumnNotFound unless column
52
+ raise Baza::Errors::ColumnNotFound, "Column not found: #{name}" unless column
53
53
  column
54
54
  end
55
55
 
@@ -58,6 +58,57 @@ class Baza::Driver::Pg::Table < Baza::Table
58
58
  self
59
59
  end
60
60
 
61
+ def foreign_keys(args = {})
62
+ sql = "
63
+ SELECT
64
+ tc.constraint_name,
65
+ tc.table_name,
66
+ kcu.column_name,
67
+ ccu.table_name AS foreign_table_name,
68
+ ccu.column_name AS foreign_column_name
69
+
70
+ FROM
71
+ information_schema.table_constraints AS tc
72
+
73
+ JOIN information_schema.key_column_usage AS kcu ON
74
+ tc.constraint_name = kcu.constraint_name
75
+
76
+ JOIN information_schema.constraint_column_usage AS ccu
77
+ ON ccu.constraint_name = tc.constraint_name
78
+
79
+ WHERE
80
+ constraint_type = 'FOREIGN KEY' AND
81
+ tc.table_name = '#{@db.escape(name)}'
82
+ "
83
+
84
+ sql << " AND tc.constraint_name = '#{@db.escape(args.fetch(:name))}'" if args[:name]
85
+
86
+ result = [] unless block_given?
87
+
88
+ @db.query(sql) do |data|
89
+ foreign_key = Baza::Driver::Pg::ForeignKey.new(
90
+ db: @db,
91
+ data: data
92
+ )
93
+
94
+ if block_given?
95
+ yield foreign_key
96
+ else
97
+ result << foreign_key
98
+ end
99
+ end
100
+
101
+ result
102
+ end
103
+
104
+ def foreign_key(name)
105
+ foreign_keys(name: name) do |foreign_key|
106
+ return foreign_key
107
+ end
108
+
109
+ raise Baza::Errors::ForeignKeyNotFound, "Foreign key not found: #{name}"
110
+ end
111
+
61
112
  def indexes(args = {})
62
113
  where_args = {
63
114
  tablename: name
@@ -1,6 +1,7 @@
1
1
  class Baza::Errors
2
2
  class DatabaseNotFound < RuntimeError; end
3
3
  class ColumnNotFound < RuntimeError; end
4
+ class ForeignKeyNotFound < RuntimeError; end
4
5
  class IndexNotFound < RuntimeError; end
5
6
  class UserNotFound < RuntimeError; end
6
7
  class NotImplemented < RuntimeError; end
@@ -0,0 +1,17 @@
1
+ class Baza::ForeignKey
2
+ include Baza::DatabaseModelFunctionality
3
+
4
+ attr_reader :column_name, :db, :name, :table_name
5
+
6
+ def column
7
+ @_column ||= table.column(column_name)
8
+ end
9
+
10
+ def table
11
+ @_table ||= db.tables[table_name]
12
+ end
13
+
14
+ def to_param
15
+ name
16
+ end
17
+ end
@@ -8,7 +8,7 @@ class Baza::SqlQueries::PostgresUpsertDuplicateKey
8
8
  end
9
9
 
10
10
  def execute
11
- if @db.commands.version.to_f >= 9.5
11
+ if @db.commands.version.to_f >= 9.5 && @db.commands.version.to_f <= 9.5
12
12
  @db.query(on_conflict_sql)
13
13
  elsif @terms.empty?
14
14
  return insert_and_register_conflict
@@ -54,7 +54,21 @@ private
54
54
  end
55
55
 
56
56
  def on_conflict_sql
57
- "#{insert_sql} ON CONFLICT DO UPDATE #{update_set_sql}"
57
+ "#{insert_sql} ON CONFLICT (#{conflict_column_sql}) DO UPDATE #{update_set_sql}"
58
+ end
59
+
60
+ def conflict_column_sql
61
+ sql = ""
62
+
63
+ first = true
64
+ @updates.keys.each do |column_name|
65
+ sql << ", " if first
66
+ first = false if first
67
+
68
+ sql << "'#{@db.escape_column(column_name)}'"
69
+ end
70
+
71
+ sql
58
72
  end
59
73
 
60
74
  def insert_sql
@@ -13,6 +13,7 @@ unless RUBY_PLATFORM == "java"
13
13
  it_behaves_like "a baza driver"
14
14
  it_should_behave_like "a baza tables driver"
15
15
  it_should_behave_like "a baza columns driver"
16
+ it_should_behave_like "a baza foreign keys driver"
16
17
  it_should_behave_like "a baza indexes driver"
17
18
  it_should_behave_like "a baza users driver"
18
19
  it_should_behave_like "an active record driver"
@@ -11,6 +11,7 @@ describe Baza::Driver::ActiveRecord do
11
11
  it_behaves_like "a baza driver"
12
12
  it_should_behave_like "a baza tables driver"
13
13
  it_should_behave_like "a baza columns driver"
14
+ it_should_behave_like "a baza foreign keys driver"
14
15
  it_should_behave_like "a baza indexes driver"
15
16
  it_should_behave_like "a baza users driver"
16
17
  it_should_behave_like "an active record driver"
@@ -14,6 +14,7 @@ unless RUBY_PLATFORM == "java"
14
14
  it_behaves_like "a baza driver"
15
15
  it_should_behave_like "a baza tables driver"
16
16
  it_should_behave_like "a baza columns driver"
17
+ it_should_behave_like "a baza foreign keys driver"
17
18
  it_should_behave_like "a baza indexes driver"
18
19
  it_should_behave_like "an active record driver"
19
20
  end
@@ -12,6 +12,7 @@ describe Baza::Driver::Mysql2 do
12
12
  it_should_behave_like "a baza databases driver"
13
13
  it_should_behave_like "a baza tables driver"
14
14
  it_should_behave_like "a baza columns driver"
15
+ it_should_behave_like "a baza foreign keys driver"
15
16
  it_should_behave_like "a baza indexes driver"
16
17
  it_should_behave_like "a baza users driver"
17
18
  end
@@ -12,6 +12,7 @@ describe Baza.const_get(:Driver).const_get(:Mysql) do
12
12
  it_should_behave_like "a baza databases driver"
13
13
  it_should_behave_like "a baza tables driver"
14
14
  it_should_behave_like "a baza columns driver"
15
+ it_should_behave_like "a baza foreign keys driver"
15
16
  it_should_behave_like "a baza indexes driver"
16
17
  it_should_behave_like "a baza users driver"
17
18
 
@@ -13,6 +13,7 @@ unless RUBY_PLATFORM == "java"
13
13
  it_should_behave_like "a baza databases driver"
14
14
  it_should_behave_like "a baza tables driver"
15
15
  it_should_behave_like "a baza columns driver"
16
+ it_should_behave_like "a baza foreign keys driver"
16
17
  it_should_behave_like "a baza indexes driver"
17
18
  end
18
19
  end
@@ -0,0 +1,54 @@
1
+ shared_examples_for "a baza foreign keys driver" do
2
+ let(:driver) { constant.new }
3
+ let(:db) { driver.db }
4
+ let(:posts_table) do
5
+ db.tables.create(
6
+ "posts",
7
+ columns: [
8
+ {name: "id", type: :int, autoincr: true, primarykey: true},
9
+ {name: "user_id", type: :int},
10
+ {name: "text", type: :varchar}
11
+ ]
12
+ )
13
+ db.tables[:posts]
14
+ end
15
+ let(:users_table) do
16
+ db.tables.create(
17
+ "users",
18
+ columns: [
19
+ {name: "id", type: :int, autoincr: true, primarykey: true},
20
+ {name: "email", type: :varchar}
21
+ ]
22
+ )
23
+ db.tables[:users]
24
+ end
25
+ let(:users_id_column) { users_table.column("id") }
26
+ let(:user_id_foreign_key) do
27
+ posts_table.column("user_id").create_foreign_key(
28
+ column: users_id_column,
29
+ name: "test_column_key"
30
+ )
31
+ posts_table.foreign_key("test_column_key")
32
+ end
33
+
34
+ before do
35
+ driver.before
36
+ end
37
+
38
+ after do
39
+ driver.after
40
+ end
41
+
42
+ it "creates foreign keys" do
43
+ user_id_foreign_key
44
+
45
+ expect(posts_table.foreign_keys.length).to eq 1
46
+ expect(posts_table.foreign_key("test_column_key").name).to eq "test_column_key"
47
+ end
48
+
49
+ it "destroys foreign keys" do
50
+ user_id_foreign_key.drop
51
+
52
+ expect { posts_table.foreign_key("test_column_key") }.to raise_error(Baza::Errors::ForeignKeyNotFound)
53
+ end
54
+ end
@@ -11,7 +11,8 @@ shared_examples_for "a baza indexes driver" do
11
11
  ],
12
12
  indexes: [
13
13
  :text,
14
- {name: :email, unique: true, columns: [:email]}
14
+ {name: :email, unique: true, columns: [:email]},
15
+ {name: :two_columns, columns: [:text, :email]}
15
16
  ]
16
17
  )
17
18
  db.tables[:test]
@@ -45,13 +46,21 @@ shared_examples_for "a baza indexes driver" do
45
46
  end.to raise_error(Baza::Errors::IndexNotFound)
46
47
  end
47
48
 
48
- describe "#unique?" do
49
- it "returns true when it is unique" do
50
- expect(test_table.index("email").unique?).to eq true
49
+ describe Baza::Index do
50
+ describe "#unique?" do
51
+ it "returns true when it is unique" do
52
+ expect(test_table.index("email").unique?).to eq true
53
+ end
54
+
55
+ it "returns false when it isn't unique" do
56
+ expect(test_table.index("text").unique?).to eq false
57
+ end
51
58
  end
52
59
 
53
- it "returns false when it isn't unique" do
54
- expect(test_table.index("text").unique?).to eq false
60
+ describe "#columns" do
61
+ it "returns the correct columns" do
62
+ expect(test_table.index("two_columns").columns).to eq %w(text email)
63
+ end
55
64
  end
56
65
  end
57
66
  end
@@ -24,7 +24,7 @@ shared_examples_for "a baza tables driver" do
24
24
 
25
25
  it "creates tables" do
26
26
  expect(test_table.name).to eq "test"
27
- expect(db.tables[:test]).to_not eq nil
27
+ expect(db.tables[:test].name).to eq "test"
28
28
  end
29
29
 
30
30
  it "#list" do
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-09 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: datet
14
+ name: array_enumerator
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.25
19
+ version: 0.0.10
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.25
26
+ version: 0.0.10
27
27
  - !ruby/object:Gem::Dependency
28
- name: array_enumerator
28
+ name: auto_autoloader
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.10
33
+ version: 0.0.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.10
40
+ version: 0.0.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: auto_autoloader
42
+ name: datet
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.1
47
+ version: 0.0.25
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.1
54
+ version: 0.0.25
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: event_handler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -109,21 +109,21 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.0.8
111
111
  - !ruby/object:Gem::Dependency
112
- name: rspec
112
+ name: activerecord
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 3.4.0
117
+ version: 4.2.5
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 3.4.0
124
+ version: 4.2.5
125
125
  - !ruby/object:Gem::Dependency
126
- name: rdoc
126
+ name: activerecord-jdbc-adapter
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,21 +137,21 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: bundler
140
+ name: best_practice_project
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 0.0.9
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 0.0.9
153
153
  - !ruby/object:Gem::Dependency
154
- name: jeweler
154
+ name: bundler
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -165,7 +165,7 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: pry
168
+ name: jdbc-mysql
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
@@ -193,131 +193,131 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: jdbc-mysql
196
+ name: jeweler
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - '='
200
200
  - !ruby/object:Gem::Version
201
- version: '0'
201
+ version: 2.3.3
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - '='
207
207
  - !ruby/object:Gem::Version
208
- version: '0'
208
+ version: 2.3.3
209
209
  - !ruby/object:Gem::Dependency
210
- name: activerecord-jdbc-adapter
210
+ name: mysql
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 2.9.1
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 2.9.1
223
223
  - !ruby/object:Gem::Dependency
224
- name: sqlite3
224
+ name: mysql2
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ">="
227
+ - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: '0'
229
+ version: 0.4.2
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ">="
234
+ - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: '0'
236
+ version: 0.4.2
237
237
  - !ruby/object:Gem::Dependency
238
- name: mysql
238
+ name: pg
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 2.9.1
243
+ version: 0.18.4
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 2.9.1
250
+ version: 0.18.4
251
251
  - !ruby/object:Gem::Dependency
252
- name: mysql2
252
+ name: pry
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - '='
255
+ - - ">="
256
256
  - !ruby/object:Gem::Version
257
- version: 0.4.2
257
+ version: '0'
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - '='
262
+ - - ">="
263
263
  - !ruby/object:Gem::Version
264
- version: 0.4.2
264
+ version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
- name: pg
266
+ name: rdoc
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - '='
269
+ - - ">="
270
270
  - !ruby/object:Gem::Version
271
- version: 0.18.4
271
+ version: '0'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - '='
276
+ - - ">="
277
277
  - !ruby/object:Gem::Version
278
- version: 0.18.4
278
+ version: '0'
279
279
  - !ruby/object:Gem::Dependency
280
- name: activerecord
280
+ name: rspec
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - '='
284
284
  - !ruby/object:Gem::Version
285
- version: 4.2.5
285
+ version: 3.4.0
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - '='
291
291
  - !ruby/object:Gem::Version
292
- version: 4.2.5
292
+ version: 3.4.0
293
293
  - !ruby/object:Gem::Dependency
294
- name: best_practice_project
294
+ name: rubocop
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - '='
298
298
  - !ruby/object:Gem::Version
299
- version: 0.0.9
299
+ version: 0.39.0
300
300
  type: :development
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - '='
305
305
  - !ruby/object:Gem::Version
306
- version: 0.0.9
306
+ version: 0.39.0
307
307
  - !ruby/object:Gem::Dependency
308
- name: rubocop
308
+ name: sqlite3
309
309
  requirement: !ruby/object:Gem::Requirement
310
310
  requirements:
311
- - - '='
311
+ - - ">="
312
312
  - !ruby/object:Gem::Version
313
- version: 0.39.0
313
+ version: '0'
314
314
  type: :development
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
- - - '='
318
+ - - ">="
319
319
  - !ruby/object:Gem::Version
320
- version: 0.39.0
320
+ version: '0'
321
321
  description: A database abstraction layer, model framework and database framework.
322
322
  email: kj@gfish.com
323
323
  executables: []
@@ -365,6 +365,7 @@ files:
365
365
  - lib/baza/driver/mysql/commands.rb
366
366
  - lib/baza/driver/mysql/database.rb
367
367
  - lib/baza/driver/mysql/databases.rb
368
+ - lib/baza/driver/mysql/foreign_key.rb
368
369
  - lib/baza/driver/mysql/index.rb
369
370
  - lib/baza/driver/mysql/indexes.rb
370
371
  - lib/baza/driver/mysql/result.rb
@@ -406,6 +407,7 @@ files:
406
407
  - lib/baza/driver/pg/create_index_sql_creator.rb
407
408
  - lib/baza/driver/pg/database.rb
408
409
  - lib/baza/driver/pg/databases.rb
410
+ - lib/baza/driver/pg/foreign_key.rb
409
411
  - lib/baza/driver/pg/index.rb
410
412
  - lib/baza/driver/pg/indexes.rb
411
413
  - lib/baza/driver/pg/result.rb
@@ -437,6 +439,7 @@ files:
437
439
  - lib/baza/driver/sqlite3_rhodes.rb
438
440
  - lib/baza/dump.rb
439
441
  - lib/baza/errors.rb
442
+ - lib/baza/foreign_key.rb
440
443
  - lib/baza/idquery.rb
441
444
  - lib/baza/index.rb
442
445
  - lib/baza/jdbc_driver.rb
@@ -486,6 +489,7 @@ files:
486
489
  - spec/support/driver_collection.rb
487
490
  - spec/support/driver_columns_collection.rb
488
491
  - spec/support/driver_databases_collection.rb
492
+ - spec/support/driver_foreign_keys_collection.rb
489
493
  - spec/support/driver_indexes_collection.rb
490
494
  - spec/support/driver_tables_collection.rb
491
495
  - spec/support/driver_users_collection.rb
@@ -509,7 +513,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
509
513
  version: '0'
510
514
  requirements: []
511
515
  rubyforge_project:
512
- rubygems_version: 2.2.2
516
+ rubygems_version: 2.6.8
513
517
  signing_key:
514
518
  specification_version: 4
515
519
  summary: A database abstraction layer, model framework and database framework.