yeet_db 0.1.0
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +75 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/generators/yeet_db/foreign_key_migration_generator.rb +30 -0
- data/lib/generators/yeet_db/generator_helpers.rb +5 -0
- data/lib/generators/yeet_db/templates/add_foreign_keys_yeet_db.rb +10 -0
- data/lib/yeet_db/ar_column.rb +47 -0
- data/lib/yeet_db/ar_table.rb +45 -0
- data/lib/yeet_db/foreign_key.rb +13 -0
- data/lib/yeet_db/missing_foreign_keys.rb +11 -0
- data/lib/yeet_db/verify_data.rb +35 -0
- data/lib/yeet_db/version.rb +3 -0
- data/lib/yeet_db.rb +10 -0
- data/yeet_db.gemspec +40 -0
- data/yeet_db.png +0 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7e71e7e7fb74ddf4213f433033223462415c8b89a1e073d6121ccfc003936502
|
4
|
+
data.tar.gz: ff1bd69f2c3e8297a66225e616bcce8f5fefaf9e5bebeac7860496d7df071cf9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae85df15bf889bae95de1caaae5f515ff81c340a21cef83498ad6a713c4341b5da9ccfc91f52d660681eee429891b5b0f0af763dbc5b075f7dbf003f6c1938e4
|
7
|
+
data.tar.gz: '099ed8ea5a188f40d77c7e587ce758991368c1729348a88b85c41554cc4c081680817f31e1896015ed3513e1c146050518dfb32d83e012027dbfaead7db48567'
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at kevin.coleman@sparkstart.io. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Kevin Coleman
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
# yeet_db
|
4
|
+
|
5
|
+
yeet_db scans your rails tables for missing foreign key constraints. If there are no dangling records, it will create a migration to add the foreign key constraints on all the table it is safe.
|
6
|
+
|
7
|
+
If you have dangling migrations, check the generator logs to see where you have invalid orphaned rows. Orphaned row meaning a row with an id that doesn't exist in the associated table.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'yeet_db'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
This probably should run against the production database so you can know if there are dangling records. If there are records with a value, but not the corresponding table does not have an id, then the migration will fail.
|
24
|
+
|
25
|
+
```
|
26
|
+
$ RAILS_ENV=production rails g yeet_db:foreign_key_migration
|
27
|
+
```
|
28
|
+
|
29
|
+
This will create a new migration with for every foreign_key that can safely be added without running into orphaned data errors. We also warn you if active_record models that are missing association declarations (`has_many`, `belongs_to`, etc.)`
|
30
|
+
|
31
|
+
`WARNING - cannot find association for alternative_housings . supplier_id | suppliers`
|
32
|
+
|
33
|
+
We also warn if we have tables that don't have existing models attached to them. This can be safe to ignore, because join tables on many to many relations don't need models, but ideally everything should have an AR model backing it.
|
34
|
+
|
35
|
+
`WARNING - cannot find model for alternative_housings . supplier_id | suppliers`
|
36
|
+
|
37
|
+
Finnally, if there is a table that we think should have a foreign key constraint, but there are dangling values we warn you against that too.
|
38
|
+
|
39
|
+
`WARNING - orphaned rows alternative_housings . supplier_id | suppliers`
|
40
|
+
|
41
|
+
## Requirements
|
42
|
+
|
43
|
+
Rails 5.2 (but it may work with 5.0+)
|
44
|
+
|
45
|
+
## Road map to v1
|
46
|
+
|
47
|
+
[ ] add rake task identify all dangling records
|
48
|
+
|
49
|
+
[ ] add rake task to automatically nullify or destroy dangling records
|
50
|
+
|
51
|
+
[ ] run as a rake task
|
52
|
+
|
53
|
+
[ ] support "soft delete" gems
|
54
|
+
|
55
|
+
|
56
|
+
## Development
|
57
|
+
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
59
|
+
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kevincolemaninc/yeet_db. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
69
|
+
|
70
|
+
## Code of Conduct
|
71
|
+
|
72
|
+
Everyone interacting in the YeetDb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kevincolemaninc/yeet_db/blob/master/CODE_OF_CONDUCT.md).
|
73
|
+
|
74
|
+
## Logo design attribute
|
75
|
+
Foreign Key by Ary Prasetyo from the Noun Project
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "yeet_db"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# require 'generators/yeet_db/generator_helpers'
|
2
|
+
|
3
|
+
module YeetDb
|
4
|
+
# Custom scaffolding generator
|
5
|
+
class ForeignKeyMigrationGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
desc "Generates migration for adding foreign key constraints."
|
9
|
+
|
10
|
+
def copy_migration_and_spec_files
|
11
|
+
migration_template "add_foreign_keys_yeet_db.rb",
|
12
|
+
migration_file,
|
13
|
+
migration_version: migration_version
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def migration_file
|
19
|
+
File.join("db/migrate", "add_foreign_keys.rb")
|
20
|
+
end
|
21
|
+
|
22
|
+
def migration_version
|
23
|
+
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.next_migration_number(path)
|
27
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S%L")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
class AddForeignKeysYeetDb < ActiveRecord::Migration<%= migration_version %>
|
3
|
+
def change
|
4
|
+
<% ::YeetDb::MissingForeignKeys.foreign_keys.each do |foreign_key| %>
|
5
|
+
add_foreign_key :<%= foreign_key.table_a %>,
|
6
|
+
:<%= foreign_key.table_b %>,
|
7
|
+
column: :<%= foreign_key.column %>
|
8
|
+
<% end %>
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module YeetDb
|
2
|
+
class ArColumn
|
3
|
+
attr_accessor :column_name, :table_name, :tables
|
4
|
+
|
5
|
+
def initialize(column_name:, table_name:, tables:)
|
6
|
+
@column_name = column_name
|
7
|
+
@table_name = table_name
|
8
|
+
@tables = tables
|
9
|
+
end
|
10
|
+
|
11
|
+
def is_association?
|
12
|
+
column_name.name =~ /_id\z/
|
13
|
+
end
|
14
|
+
|
15
|
+
def association_klass
|
16
|
+
model && model.reflections[association_name]&.klass
|
17
|
+
end
|
18
|
+
|
19
|
+
def association_table_name
|
20
|
+
association_klass&.table_name || tables.detect { |table| table == guessed_table_name }
|
21
|
+
end
|
22
|
+
|
23
|
+
def association_name
|
24
|
+
column_name.name.gsub(/_id\z/, '')
|
25
|
+
end
|
26
|
+
|
27
|
+
def model
|
28
|
+
ActiveRecord::Base.descendants.detect { |c| c.table_name == table_name }
|
29
|
+
end
|
30
|
+
|
31
|
+
def association
|
32
|
+
model && model.reflections[association_name]
|
33
|
+
end
|
34
|
+
|
35
|
+
def polymorphic_association?
|
36
|
+
association && association.options[:polymorphic]
|
37
|
+
end
|
38
|
+
|
39
|
+
def foreign_key_exists?
|
40
|
+
ActiveRecord::Migration.foreign_key_exists?(table_name, column: column_name.name)
|
41
|
+
end
|
42
|
+
|
43
|
+
def guessed_table_name
|
44
|
+
@guessed_table_name ||= association_name.pluralize
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module YeetDb
|
2
|
+
class ArTable
|
3
|
+
attr_accessor :table_name, :tables
|
4
|
+
|
5
|
+
def initialize(table_name:, tables:)
|
6
|
+
@table_name = table_name
|
7
|
+
@tables = tables
|
8
|
+
end
|
9
|
+
|
10
|
+
def missing_keys
|
11
|
+
missing_keys_array = []
|
12
|
+
columns.each do |column_name|
|
13
|
+
column = ArColumn.new(column_name: column_name, table_name: table_name, tables: tables)
|
14
|
+
next unless column.is_association?
|
15
|
+
|
16
|
+
unless column.model
|
17
|
+
puts "WARNING - cannot find model for #{table_name} . #{column_name.name} | #{column&.association_table_name}"
|
18
|
+
end
|
19
|
+
|
20
|
+
unless column.association
|
21
|
+
puts "WARNING - cannot find association for #{table_name} . #{column_name.name} | #{column&.association_table_name}"
|
22
|
+
end
|
23
|
+
|
24
|
+
next if column.polymorphic_association?
|
25
|
+
next if column.foreign_key_exists?
|
26
|
+
next if column.association_table_name.blank?
|
27
|
+
|
28
|
+
if VerifyData.new(column: column).orphaned_rows?
|
29
|
+
puts "WARNING - orphaned rows #{table_name} . #{column_name.name} | #{column&.association_table_name}"
|
30
|
+
end
|
31
|
+
foreign_key = ForeignKey.new(table_a: table_name,
|
32
|
+
table_b: column&.association_table_name,
|
33
|
+
column: column_name.name)
|
34
|
+
missing_keys_array.push(foreign_key)
|
35
|
+
end
|
36
|
+
missing_keys_array
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def columns
|
42
|
+
ActiveRecord::Base.connection.columns(table_name)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module YeetDb
|
2
|
+
class MissingForeignKeys
|
3
|
+
def self.foreign_keys
|
4
|
+
Rails.application.eager_load!
|
5
|
+
tables = ActiveRecord::Base.connection.tables
|
6
|
+
tables.map do |table_name|
|
7
|
+
ArTable.new(table_name: table_name, tables: tables).missing_keys
|
8
|
+
end.flatten
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module YeetDb
|
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
|
+
private
|
14
|
+
|
15
|
+
def orphaned_rows
|
16
|
+
association = column.association
|
17
|
+
binding.pry if column.column_name.is_a?(String)
|
18
|
+
|
19
|
+
column_name = column.column_name.name
|
20
|
+
table_name = column.table_name
|
21
|
+
association_table = column.association_table_name
|
22
|
+
model = column.model
|
23
|
+
|
24
|
+
# Check to see there could be rows with bad data
|
25
|
+
bad_ids = model.joins("left join #{association_table} as association_table on association_table.id = #{table_name}.#{column_name}")
|
26
|
+
.where.not(column_name => nil)
|
27
|
+
.where('association_table.id is null')
|
28
|
+
.pluck(:id)
|
29
|
+
|
30
|
+
# select the rows with the invalid ids
|
31
|
+
# AR doesn't support joins with update, so the bad_ids are selected in a different query (above ^)
|
32
|
+
model.where(id: bad_ids)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/yeet_db.rb
ADDED
data/yeet_db.gemspec
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "yeet_db/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "yeet_db"
|
8
|
+
spec.version = YeetDb::VERSION
|
9
|
+
spec.authors = ["Kevin Coleman"]
|
10
|
+
spec.email = ["kevin.coleman@sparkstart.io"]
|
11
|
+
|
12
|
+
spec.summary = %q{Generates foreign key constraint migrations for rails databases}
|
13
|
+
spec.description = %q{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_db'
|
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_db"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/kevincolemaninc/yeet_db/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('..', __FILE__)) 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
|
+
end
|
data/yeet_db.png
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yeet_db
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Coleman
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.17'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.17'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: This scan every ActiveRecord model looking for relationships ('has_many',
|
56
|
+
'belongs_to', etc.) and adds foreign key constraints.
|
57
|
+
email:
|
58
|
+
- kevin.coleman@sparkstart.io
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
|
+
- CHANGELOG.md
|
67
|
+
- CODE_OF_CONDUCT.md
|
68
|
+
- Gemfile
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/console
|
73
|
+
- bin/setup
|
74
|
+
- lib/generators/yeet_db/foreign_key_migration_generator.rb
|
75
|
+
- lib/generators/yeet_db/generator_helpers.rb
|
76
|
+
- lib/generators/yeet_db/templates/add_foreign_keys_yeet_db.rb
|
77
|
+
- lib/yeet_db.rb
|
78
|
+
- lib/yeet_db/ar_column.rb
|
79
|
+
- lib/yeet_db/ar_table.rb
|
80
|
+
- lib/yeet_db/foreign_key.rb
|
81
|
+
- lib/yeet_db/missing_foreign_keys.rb
|
82
|
+
- lib/yeet_db/verify_data.rb
|
83
|
+
- lib/yeet_db/version.rb
|
84
|
+
- yeet_db.gemspec
|
85
|
+
- yeet_db.png
|
86
|
+
homepage: http://rubygems.org/gems/yeet_db
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata:
|
90
|
+
homepage_uri: http://rubygems.org/gems/yeet_db
|
91
|
+
source_code_uri: https://github.com/kevincolemaninc/yeet_db
|
92
|
+
changelog_uri: https://github.com/kevincolemaninc/yeet_db/master/CHANGELOG.md
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubygems_version: 3.0.3
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: Generates foreign key constraint migrations for rails databases
|
112
|
+
test_files: []
|