db_schema_checker 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +37 -0
- data/.gitignore +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/README.md +5 -1
- data/Rakefile +0 -5
- data/db_schema_checker.gemspec +1 -5
- data/lib/db_schema_checker/version.rb +1 -1
- data/lib/tasks/db_schema_checker_tasks.rake +11 -5
- metadata +10 -39
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674654cbce4cd496b42c910881c5b898e33fb088ffafa5db69c999b47cb8299d
|
4
|
+
data.tar.gz: f6d3c82f55a62d0dc3a7258ce9d888289ae1b0e20d34d9b83803ecd6f9c6d0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf9056c7b134a930ab2d41876a5e8bcca07d7acbc548088af13afc8bc4af0be614d319885a11288b5857450c02fded636a16cc42bbe52582b8eb2c8dbdb176b
|
7
|
+
data.tar.gz: fdbe114002060c13452ce3f11d483a174c5178304de8180ae5c2a7d1d03387a8a9d12ca0c2e29b95e116298b6bb60836d93be43479304387b58b18968a729def
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# This is a comment.
|
2
|
+
# Each line is a file pattern followed by one or more owners.
|
3
|
+
|
4
|
+
# These owners will be the default owners for everything in
|
5
|
+
# the repo. Unless a later match takes precedence,
|
6
|
+
# @global-owner1 and @global-owner2 will be requested for
|
7
|
+
# review when someone opens a pull request.
|
8
|
+
* @meganemura
|
9
|
+
|
10
|
+
# Order is important; the last matching pattern takes the most
|
11
|
+
# precedence. When someone opens a pull request that only
|
12
|
+
# modifies JS files, only @js-owner and not the global
|
13
|
+
# owner(s) will be requested for a review.
|
14
|
+
# *.js @js-owner
|
15
|
+
|
16
|
+
# You can also use email addresses if you prefer. They'll be
|
17
|
+
# used to look up users just like we do for commit author
|
18
|
+
# emails.
|
19
|
+
# *.go docs@example.com
|
20
|
+
|
21
|
+
# In this example, @doctocat owns any files in the build/logs
|
22
|
+
# directory at the root of the repository and any of its
|
23
|
+
# subdirectories.
|
24
|
+
# /build/logs/ @doctocat
|
25
|
+
|
26
|
+
# The `docs/*` pattern will match files like
|
27
|
+
# `docs/getting-started.md` but not further nested files like
|
28
|
+
# `docs/build-app/troubleshooting.md`.
|
29
|
+
# docs/* docs@example.com
|
30
|
+
|
31
|
+
# In this example, @octocat owns any file in an apps directory
|
32
|
+
# anywhere in your repository.
|
33
|
+
# apps/ @octocat
|
34
|
+
|
35
|
+
# In this example, @doctocat owns any file in the `/docs`
|
36
|
+
# directory in the root of your repository.
|
37
|
+
# /docs/ @doctocat
|
data/.gitignore
CHANGED
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 dev@smarthr.jp. 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/README.md
CHANGED
@@ -26,6 +26,10 @@ ERROR: Generated schema is not consistent with db/schema.rb
|
|
26
26
|
|
27
27
|
Bug reports and pull requests are welcome on GitHub at https://github.com/kufu/db_schema_checker.
|
28
28
|
|
29
|
+
## Code of Conduct
|
30
|
+
|
31
|
+
Everyone interacting in the db_schema_checker project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kufu/db_schema_checker/blob/master/CODE_OF_CONDUCT.md).
|
32
|
+
|
29
33
|
## License
|
30
34
|
|
31
|
-
The gem is available as open source under the terms of the [MIT License](https://
|
35
|
+
The gem is available as open source under the terms of the [MIT License](https://github.com/kufu/db_schema_checker/blob/master/LICENSE.txt).
|
data/Rakefile
CHANGED
data/db_schema_checker.gemspec
CHANGED
@@ -16,11 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
17
|
f.match(%r{^(test|spec|features)/})
|
18
18
|
end
|
19
|
-
spec.bindir = "exe"
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
19
|
spec.require_paths = ["lib"]
|
22
20
|
|
23
|
-
spec.add_development_dependency "
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
21
|
+
spec.add_development_dependency "rake"
|
26
22
|
end
|
@@ -10,23 +10,29 @@ namespace :db do
|
|
10
10
|
original_env_schema = ENV['SCHEMA']
|
11
11
|
original_env_verbose = ENV['VERBOSE']
|
12
12
|
|
13
|
+
schema_path = if ActiveRecord.schema_format == :ruby
|
14
|
+
'db/schema.rb'
|
15
|
+
else
|
16
|
+
'db/structure.sql'
|
17
|
+
end
|
18
|
+
|
13
19
|
consistent = nil
|
14
20
|
diff = ''
|
15
21
|
Dir.mktmpdir(nil, Rails.root.join('tmp')) do |dir|
|
16
|
-
|
17
|
-
|
22
|
+
old_schema = Rails.root.join(schema_path)
|
23
|
+
new_schema = File.join(dir, File.basename(schema_path))
|
18
24
|
|
19
|
-
ENV['SCHEMA'] =
|
25
|
+
ENV['SCHEMA'] = new_schema
|
20
26
|
ENV['VERBOSE'] = 'false'
|
21
27
|
|
22
28
|
Rake::Task['db:migrate:reset'].invoke
|
23
29
|
|
24
|
-
consistent = FileUtils.compare_file(
|
30
|
+
consistent = FileUtils.compare_file(old_schema, new_schema)
|
25
31
|
|
26
32
|
next if consistent
|
27
33
|
next if `which diff`.empty?
|
28
34
|
|
29
|
-
diff = `diff -u #{
|
35
|
+
diff = `diff -u #{old_schema} #{new_schema}`
|
30
36
|
end
|
31
37
|
|
32
38
|
ENV['SCHEMA'] = original_env_schema
|
metadata
CHANGED
@@ -1,57 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db_schema_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meganemura
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
12
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.16'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.16'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
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
|
-
- - "~>"
|
17
|
+
- - ">="
|
46
18
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
19
|
+
version: '0'
|
48
20
|
type: :development
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
|
-
- - "
|
24
|
+
- - ">="
|
53
25
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
26
|
+
version: '0'
|
55
27
|
description: Check the consistency of generated schema.rb
|
56
28
|
email:
|
57
29
|
- meganemura@users.noreply.github.com
|
@@ -59,15 +31,15 @@ executables: []
|
|
59
31
|
extensions: []
|
60
32
|
extra_rdoc_files: []
|
61
33
|
files:
|
34
|
+
- ".github/CODEOWNERS"
|
62
35
|
- ".gitignore"
|
63
36
|
- ".rspec"
|
64
37
|
- ".travis.yml"
|
38
|
+
- CODE_OF_CONDUCT.md
|
65
39
|
- Gemfile
|
66
40
|
- LICENSE.txt
|
67
41
|
- README.md
|
68
42
|
- Rakefile
|
69
|
-
- bin/console
|
70
|
-
- bin/setup
|
71
43
|
- db_schema_checker.gemspec
|
72
44
|
- lib/db_schema_checker.rb
|
73
45
|
- lib/db_schema_checker/railtie.rb
|
@@ -92,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
64
|
- !ruby/object:Gem::Version
|
93
65
|
version: '0'
|
94
66
|
requirements: []
|
95
|
-
|
96
|
-
rubygems_version: 2.7.6
|
67
|
+
rubygems_version: 3.1.6
|
97
68
|
signing_key:
|
98
69
|
specification_version: 4
|
99
70
|
summary: Check the consistency of generated schema.rb
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "db_schema_checker"
|
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__)
|