yeet_dba 1.0.0 → 1.0.1
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 +4 -4
- data/.yeet_dba.example.yml +3 -0
- data/CHANGELOG.md +33 -29
- data/Gemfile +0 -2
- data/Gemfile.lock +113 -118
- data/README.md +11 -2
- data/lib/yeet_dba/missing_foreign_keys.rb +17 -1
- data/lib/yeet_dba/tasks/bad_data/find_orphaned_rows.rake +1 -1
- data/lib/yeet_dba/verify_data.rb +35 -37
- data/lib/yeet_dba/version.rb +3 -3
- data/yeet_dba.gemspec +45 -45
- metadata +9 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52cc31e276691be6f75f50eef374d4511c108fd5e4d9abcce296c36bf810e481
|
|
4
|
+
data.tar.gz: 0c6fb6686fbe35055dc7be0f3bd2456988efe20acc7c8da404e6f5e594bee2da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39709844b54331b0a73002c4ca7085fccc83d7cdfc97a54af40c7bf895df30890d65ee68473e64fea92e13bef56bb3ea872c64238e22497b453f622b0aad1847
|
|
7
|
+
data.tar.gz: 00c8ec4a3d6182ce6fff3112ded9eba2b55bb9291ecf96b8258fa3e3d1341166468525d6b2327b3d9eb79e04034a5a3ea8b35f03c1bac1c893314d8cd72de359
|
data/CHANGELOG.md
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
# 1.0.1 (unreleased, master)
|
|
2
|
-
|
|
3
|
-
## Minor changes
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# 0.1.
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
# 1.0.1 (unreleased, master)
|
|
2
|
+
|
|
3
|
+
## Minor changes
|
|
4
|
+
|
|
5
|
+
Support Rails 6
|
|
6
|
+
Update gems and remove pry
|
|
7
|
+
Fix bug in `find_orphaned_rows` rake task for [Issue #10](https://github.com/KevinColemanInc/yeet_dba/issues/10)
|
|
8
|
+
|
|
9
|
+
# 1.0.0
|
|
10
|
+
|
|
11
|
+
## Minor changes
|
|
12
|
+
|
|
13
|
+
Improved test coverage
|
|
14
|
+
|
|
15
|
+
# 0.1.2
|
|
16
|
+
|
|
17
|
+
## Major changes
|
|
18
|
+
|
|
19
|
+
Added rake task to find invalid data
|
|
20
|
+
Added rake task to nullify and delete invalid data
|
|
21
|
+
|
|
22
|
+
## Minor changes
|
|
23
|
+
|
|
24
|
+
Add rubocop
|
|
25
|
+
Add rspec tests
|
|
26
|
+
|
|
27
|
+
# 0.1.1
|
|
28
|
+
|
|
29
|
+
Patch bug with skipping invalid columns that have orphaned data
|
|
30
|
+
|
|
31
|
+
# 0.1.0
|
|
32
|
+
|
|
33
|
+
Initial release
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,118 +1,113 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
yeet_dba (0.
|
|
5
|
-
actionpack (>= 3.0, <
|
|
6
|
-
activerecord (>= 3.0, <
|
|
7
|
-
railties (>= 3.0, <
|
|
8
|
-
|
|
9
|
-
GEM
|
|
10
|
-
remote: https://rubygems.org/
|
|
11
|
-
specs:
|
|
12
|
-
actionpack (
|
|
13
|
-
actionview (=
|
|
14
|
-
activesupport (=
|
|
15
|
-
rack (~> 2.0)
|
|
16
|
-
rack-test (>= 0.6.3)
|
|
17
|
-
rails-dom-testing (~> 2.0)
|
|
18
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
|
19
|
-
actionview (
|
|
20
|
-
activesupport (=
|
|
21
|
-
builder (~> 3.1)
|
|
22
|
-
erubi (~> 1.4)
|
|
23
|
-
rails-dom-testing (~> 2.0)
|
|
24
|
-
rails-html-sanitizer (~> 1.
|
|
25
|
-
activemodel (
|
|
26
|
-
activesupport (=
|
|
27
|
-
activerecord (
|
|
28
|
-
activemodel (=
|
|
29
|
-
activesupport (=
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
rspec-
|
|
76
|
-
rspec-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
rspec-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
test-unit
|
|
115
|
-
yeet_dba!
|
|
116
|
-
|
|
117
|
-
BUNDLED WITH
|
|
118
|
-
1.17.3
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
yeet_dba (1.0.1)
|
|
5
|
+
actionpack (>= 3.0, < 7.0)
|
|
6
|
+
activerecord (>= 3.0, < 7.0)
|
|
7
|
+
railties (>= 3.0, < 7.0)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
actionpack (6.0.0)
|
|
13
|
+
actionview (= 6.0.0)
|
|
14
|
+
activesupport (= 6.0.0)
|
|
15
|
+
rack (~> 2.0)
|
|
16
|
+
rack-test (>= 0.6.3)
|
|
17
|
+
rails-dom-testing (~> 2.0)
|
|
18
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
19
|
+
actionview (6.0.0)
|
|
20
|
+
activesupport (= 6.0.0)
|
|
21
|
+
builder (~> 3.1)
|
|
22
|
+
erubi (~> 1.4)
|
|
23
|
+
rails-dom-testing (~> 2.0)
|
|
24
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
25
|
+
activemodel (6.0.0)
|
|
26
|
+
activesupport (= 6.0.0)
|
|
27
|
+
activerecord (6.0.0)
|
|
28
|
+
activemodel (= 6.0.0)
|
|
29
|
+
activesupport (= 6.0.0)
|
|
30
|
+
activesupport (6.0.0)
|
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
32
|
+
i18n (>= 0.7, < 2)
|
|
33
|
+
minitest (~> 5.1)
|
|
34
|
+
tzinfo (~> 1.1)
|
|
35
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
|
36
|
+
builder (3.2.3)
|
|
37
|
+
concurrent-ruby (1.1.5)
|
|
38
|
+
crass (1.0.4)
|
|
39
|
+
diff-lcs (1.3)
|
|
40
|
+
erubi (1.8.0)
|
|
41
|
+
i18n (1.6.0)
|
|
42
|
+
concurrent-ruby (~> 1.0)
|
|
43
|
+
loofah (2.2.3)
|
|
44
|
+
crass (~> 1.0.2)
|
|
45
|
+
nokogiri (>= 1.5.9)
|
|
46
|
+
method_source (0.9.2)
|
|
47
|
+
mini_portile2 (2.4.0)
|
|
48
|
+
minitest (5.11.3)
|
|
49
|
+
nokogiri (1.10.4)
|
|
50
|
+
mini_portile2 (~> 2.4.0)
|
|
51
|
+
power_assert (1.1.5)
|
|
52
|
+
rack (2.0.7)
|
|
53
|
+
rack-test (1.1.0)
|
|
54
|
+
rack (>= 1.0, < 3)
|
|
55
|
+
rails-dom-testing (2.0.3)
|
|
56
|
+
activesupport (>= 4.2.0)
|
|
57
|
+
nokogiri (>= 1.6)
|
|
58
|
+
rails-html-sanitizer (1.2.0)
|
|
59
|
+
loofah (~> 2.2, >= 2.2.2)
|
|
60
|
+
railties (6.0.0)
|
|
61
|
+
actionpack (= 6.0.0)
|
|
62
|
+
activesupport (= 6.0.0)
|
|
63
|
+
method_source
|
|
64
|
+
rake (>= 0.8.7)
|
|
65
|
+
thor (>= 0.20.3, < 2.0)
|
|
66
|
+
rake (10.5.0)
|
|
67
|
+
rspec (3.8.0)
|
|
68
|
+
rspec-core (~> 3.8.0)
|
|
69
|
+
rspec-expectations (~> 3.8.0)
|
|
70
|
+
rspec-mocks (~> 3.8.0)
|
|
71
|
+
rspec-core (3.8.2)
|
|
72
|
+
rspec-support (~> 3.8.0)
|
|
73
|
+
rspec-expectations (3.8.4)
|
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
75
|
+
rspec-support (~> 3.8.0)
|
|
76
|
+
rspec-mocks (3.8.1)
|
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
78
|
+
rspec-support (~> 3.8.0)
|
|
79
|
+
rspec-rails (3.8.2)
|
|
80
|
+
actionpack (>= 3.0)
|
|
81
|
+
activesupport (>= 3.0)
|
|
82
|
+
railties (>= 3.0)
|
|
83
|
+
rspec-core (~> 3.8.0)
|
|
84
|
+
rspec-expectations (~> 3.8.0)
|
|
85
|
+
rspec-mocks (~> 3.8.0)
|
|
86
|
+
rspec-support (~> 3.8.0)
|
|
87
|
+
rspec-support (3.8.2)
|
|
88
|
+
sqlite3 (1.4.1)
|
|
89
|
+
test-unit (3.3.3)
|
|
90
|
+
power_assert
|
|
91
|
+
thor (0.20.3)
|
|
92
|
+
thread_safe (0.3.6)
|
|
93
|
+
tzinfo (1.2.5)
|
|
94
|
+
thread_safe (~> 0.1)
|
|
95
|
+
zeitwerk (2.1.10)
|
|
96
|
+
|
|
97
|
+
PLATFORMS
|
|
98
|
+
ruby
|
|
99
|
+
|
|
100
|
+
DEPENDENCIES
|
|
101
|
+
actionpack
|
|
102
|
+
activerecord
|
|
103
|
+
bundler (~> 1.17)
|
|
104
|
+
railties
|
|
105
|
+
rake (~> 10.0)
|
|
106
|
+
rspec (~> 3.0)
|
|
107
|
+
rspec-rails
|
|
108
|
+
sqlite3
|
|
109
|
+
test-unit
|
|
110
|
+
yeet_dba!
|
|
111
|
+
|
|
112
|
+
BUNDLED WITH
|
|
113
|
+
1.17.3
|
data/README.md
CHANGED
|
@@ -21,7 +21,7 @@ But this doesn't work if you don't nullify the `company_id` when the company is
|
|
|
21
21
|
|
|
22
22
|
### But what is the difference between yeet_db and [lol_dba](https://github.com/plentz/lol_dba)?
|
|
23
23
|
|
|
24
|
-
lol_dba will only add indexes for RoR models. yeet_dba looks at every table (including join tables) to add foreign key constraints
|
|
24
|
+
lol_dba will only add indexes for RoR models. yeet_dba looks at every table (including join tables) to add foreign key constraints.
|
|
25
25
|
|
|
26
26
|
## Installation
|
|
27
27
|
|
|
@@ -63,6 +63,16 @@ SELECT "notifications".* FROM "notifications" left join active_storage_attachmen
|
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
If you need to ignore certain tables from being checked simply add a `.yeet_dba.yml` in the Rails.root directory.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
---
|
|
70
|
+
exclude_tables:
|
|
71
|
+
- table_to_be_ignored
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For a sample configuration file check `.yeet_dba.example.yml`.
|
|
75
|
+
|
|
66
76
|
### 2. Fix invalid rows
|
|
67
77
|
|
|
68
78
|
You can either manually repair your data via rails console or direct SQL queries, or you can run a rake task to resolve failures.
|
|
@@ -154,4 +164,3 @@ Foreign Key by Ary Prasetyo from the Noun Project
|
|
|
154
164
|
## Author
|
|
155
165
|
|
|
156
166
|
Kevin Coleman, [https://kcoleman.me/](https://kcoleman.me)
|
|
157
|
-
|
|
@@ -21,7 +21,23 @@ module YeetDba
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.tables
|
|
24
|
-
ActiveRecord::Base.connection.tables
|
|
24
|
+
ActiveRecord::Base.connection.tables - self.ignored_tables
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.ignored_tables
|
|
28
|
+
config['exclude_tables'] || []
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.config
|
|
32
|
+
@config ||= begin
|
|
33
|
+
config_file = Pathname.new(Rails.root).join('.yeet_dba.yml')
|
|
34
|
+
|
|
35
|
+
if File.exist?(config_file)
|
|
36
|
+
YAML.load(File.read(config_file))
|
|
37
|
+
else
|
|
38
|
+
{}
|
|
39
|
+
end
|
|
40
|
+
end
|
|
25
41
|
end
|
|
26
42
|
end
|
|
27
43
|
end
|
|
@@ -11,7 +11,7 @@ namespace :yeet_dba do
|
|
|
11
11
|
puts "🚨Houston, we have a problem 🚨. We found #{columns.length} invalid column#{columns.length == 1 ? '' : 's'}."
|
|
12
12
|
puts
|
|
13
13
|
columns.each do |invalid_column|
|
|
14
|
-
puts "-> #{invalid_column.
|
|
14
|
+
puts "-> #{invalid_column.table_name}.#{invalid_column.column}"
|
|
15
15
|
puts "Invalid rows: #{invalid_column.orphaned_rows_count}"
|
|
16
16
|
puts "Foreign table: #{invalid_column.association_table_name}"
|
|
17
17
|
puts
|
data/lib/yeet_dba/verify_data.rb
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
end
|
|
37
|
-
end
|
|
1
|
+
module YeetDba
|
|
2
|
+
class VerifyData
|
|
3
|
+
attr_accessor :column
|
|
4
|
+
|
|
5
|
+
def initialize(column:)
|
|
6
|
+
@column = column
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def orphaned_rows?
|
|
10
|
+
orphaned_rows.first
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def orphaned_rows_count
|
|
14
|
+
orphaned_rows.count
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def query
|
|
18
|
+
orphaned_rows.to_sql
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def orphaned_rows
|
|
22
|
+
association = column.association
|
|
23
|
+
|
|
24
|
+
column_name = column.db_column.name
|
|
25
|
+
table_name = column.table_name
|
|
26
|
+
association_table = column.association_table_name
|
|
27
|
+
model = column.model
|
|
28
|
+
|
|
29
|
+
# Check to see there could be rows with bad data
|
|
30
|
+
model.joins("left join #{association_table} as association_table on association_table.id = #{table_name}.#{column_name}")
|
|
31
|
+
.where.not(column_name => nil)
|
|
32
|
+
.where('association_table.id is null')
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/yeet_dba/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module YeetDba
|
|
2
|
-
VERSION = '1.0.
|
|
3
|
-
end
|
|
1
|
+
module YeetDba
|
|
2
|
+
VERSION = '1.0.1'.freeze
|
|
3
|
+
end
|
data/yeet_dba.gemspec
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
lib = File.expand_path('lib', __dir__)
|
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
-
require 'yeet_dba/version'
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = 'yeet_dba'
|
|
7
|
-
spec.version = YeetDba::VERSION
|
|
8
|
-
spec.platform = Gem::Platform::RUBY
|
|
9
|
-
spec.authors = ['Kevin Coleman']
|
|
10
|
-
spec.email = ['kevin.coleman@sparkstart.io']
|
|
11
|
-
|
|
12
|
-
spec.summary = 'Generates foreign key constraint migrations for rails databases'
|
|
13
|
-
spec.description = "This scan every ActiveRecord model looking for relationships ('has_many', 'belongs_to', etc.) and adds foreign key constraints."
|
|
14
|
-
spec.homepage = 'http://rubygems.org/gems/yeet_dba'
|
|
15
|
-
spec.license = 'MIT'
|
|
16
|
-
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
18
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
19
|
-
if spec.respond_to?(:metadata)
|
|
20
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
|
21
|
-
spec.metadata['source_code_uri'] = 'https://github.com/kevincolemaninc/yeet_dba'
|
|
22
|
-
spec.metadata['changelog_uri'] = 'https://github.com/kevincolemaninc/yeet_dba/master/CHANGELOG.md'
|
|
23
|
-
else
|
|
24
|
-
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
25
|
-
'public gem pushes.'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Specify which files should be added to the gem when it is released.
|
|
29
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
30
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
31
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
32
|
-
end
|
|
33
|
-
spec.bindir = 'exe'
|
|
34
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
|
-
spec.require_paths = ['lib']
|
|
36
|
-
|
|
37
|
-
spec.add_development_dependency 'bundler', '~> 1.17'
|
|
38
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
|
39
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
40
|
-
|
|
41
|
-
spec.required_ruby_version = '>= 2.4.0'
|
|
42
|
-
spec.add_dependency 'actionpack', '>= 3.0', '<
|
|
43
|
-
spec.add_dependency 'activerecord', '>= 3.0', '<
|
|
44
|
-
spec.add_dependency 'railties', '>= 3.0', '<
|
|
45
|
-
end
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require 'yeet_dba/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'yeet_dba'
|
|
7
|
+
spec.version = YeetDba::VERSION
|
|
8
|
+
spec.platform = Gem::Platform::RUBY
|
|
9
|
+
spec.authors = ['Kevin Coleman']
|
|
10
|
+
spec.email = ['kevin.coleman@sparkstart.io']
|
|
11
|
+
|
|
12
|
+
spec.summary = 'Generates foreign key constraint migrations for rails databases'
|
|
13
|
+
spec.description = "This scan every ActiveRecord model looking for relationships ('has_many', 'belongs_to', etc.) and adds foreign key constraints."
|
|
14
|
+
spec.homepage = 'http://rubygems.org/gems/yeet_dba'
|
|
15
|
+
spec.license = 'MIT'
|
|
16
|
+
|
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
19
|
+
if spec.respond_to?(:metadata)
|
|
20
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
21
|
+
spec.metadata['source_code_uri'] = 'https://github.com/kevincolemaninc/yeet_dba'
|
|
22
|
+
spec.metadata['changelog_uri'] = 'https://github.com/kevincolemaninc/yeet_dba/master/CHANGELOG.md'
|
|
23
|
+
else
|
|
24
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
25
|
+
'public gem pushes.'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Specify which files should be added to the gem when it is released.
|
|
29
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
30
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
31
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
32
|
+
end
|
|
33
|
+
spec.bindir = 'exe'
|
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
|
+
spec.require_paths = ['lib']
|
|
36
|
+
|
|
37
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
40
|
+
|
|
41
|
+
spec.required_ruby_version = '>= 2.4.0'
|
|
42
|
+
spec.add_dependency 'actionpack', '>= 3.0', '< 7.0'
|
|
43
|
+
spec.add_dependency 'activerecord', '>= 3.0', '< 7.0'
|
|
44
|
+
spec.add_dependency 'railties', '>= 3.0', '< 7.0'
|
|
45
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yeet_dba
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kevin Coleman
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -61,7 +61,7 @@ dependencies:
|
|
|
61
61
|
version: '3.0'
|
|
62
62
|
- - "<"
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: '
|
|
64
|
+
version: '7.0'
|
|
65
65
|
type: :runtime
|
|
66
66
|
prerelease: false
|
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -71,7 +71,7 @@ dependencies:
|
|
|
71
71
|
version: '3.0'
|
|
72
72
|
- - "<"
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '
|
|
74
|
+
version: '7.0'
|
|
75
75
|
- !ruby/object:Gem::Dependency
|
|
76
76
|
name: activerecord
|
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +81,7 @@ dependencies:
|
|
|
81
81
|
version: '3.0'
|
|
82
82
|
- - "<"
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: '
|
|
84
|
+
version: '7.0'
|
|
85
85
|
type: :runtime
|
|
86
86
|
prerelease: false
|
|
87
87
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -91,7 +91,7 @@ dependencies:
|
|
|
91
91
|
version: '3.0'
|
|
92
92
|
- - "<"
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version: '
|
|
94
|
+
version: '7.0'
|
|
95
95
|
- !ruby/object:Gem::Dependency
|
|
96
96
|
name: railties
|
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -101,7 +101,7 @@ dependencies:
|
|
|
101
101
|
version: '3.0'
|
|
102
102
|
- - "<"
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '
|
|
104
|
+
version: '7.0'
|
|
105
105
|
type: :runtime
|
|
106
106
|
prerelease: false
|
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -111,7 +111,7 @@ dependencies:
|
|
|
111
111
|
version: '3.0'
|
|
112
112
|
- - "<"
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '
|
|
114
|
+
version: '7.0'
|
|
115
115
|
description: This scan every ActiveRecord model looking for relationships ('has_many',
|
|
116
116
|
'belongs_to', etc.) and adds foreign key constraints.
|
|
117
117
|
email:
|
|
@@ -125,6 +125,7 @@ files:
|
|
|
125
125
|
- ".rspec"
|
|
126
126
|
- ".rubocop"
|
|
127
127
|
- ".travis.yml"
|
|
128
|
+
- ".yeet_dba.example.yml"
|
|
128
129
|
- CHANGELOG.md
|
|
129
130
|
- CODE_OF_CONDUCT.md
|
|
130
131
|
- Gemfile
|