rubocop-migration 0.2.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +58 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +11 -1
  6. data/Gemfile.lock +89 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +43 -18
  9. data/Rakefile +9 -3
  10. data/config/default.yml +151 -0
  11. data/data/reserved_words_mysql.txt +750 -0
  12. data/lib/rubocop/cop/migration/add_check_constraint.rb +111 -0
  13. data/lib/rubocop/cop/migration/add_column_with_default_value.rb +229 -0
  14. data/lib/rubocop/cop/migration/add_foreign_key.rb +166 -0
  15. data/lib/rubocop/cop/migration/add_index_columns_count.rb +114 -0
  16. data/lib/rubocop/cop/migration/add_index_concurrently.rb +164 -0
  17. data/lib/rubocop/cop/migration/add_index_duplicate.rb +183 -0
  18. data/lib/rubocop/cop/migration/batch_in_batches.rb +95 -0
  19. data/lib/rubocop/cop/migration/batch_in_transaction.rb +83 -0
  20. data/lib/rubocop/cop/migration/batch_with_throttling.rb +108 -0
  21. data/lib/rubocop/cop/migration/change_column.rb +113 -0
  22. data/lib/rubocop/cop/migration/change_column_null.rb +128 -0
  23. data/lib/rubocop/cop/migration/create_table_force.rb +89 -0
  24. data/lib/rubocop/cop/migration/jsonb.rb +131 -0
  25. data/lib/rubocop/cop/migration/remove_column.rb +246 -0
  26. data/lib/rubocop/cop/migration/rename_column.rb +81 -0
  27. data/lib/rubocop/cop/migration/rename_table.rb +79 -0
  28. data/lib/rubocop/cop/migration/reserved_word_mysql.rb +232 -0
  29. data/lib/rubocop/migration/config_loader.rb +51 -0
  30. data/lib/rubocop/migration/cop_concerns/batch_processing.rb +34 -0
  31. data/lib/rubocop/migration/cop_concerns/column_type_method.rb +28 -0
  32. data/lib/rubocop/migration/cop_concerns/disable_ddl_transaction.rb +51 -0
  33. data/lib/rubocop/migration/cop_concerns.rb +11 -0
  34. data/lib/rubocop/migration/rubocop_extension.rb +15 -0
  35. data/lib/rubocop/migration/version.rb +4 -2
  36. data/lib/rubocop/migration.rb +23 -0
  37. data/rubocop-migration.gemspec +25 -31
  38. metadata +50 -137
  39. data/.gitignore +0 -15
  40. data/bin/console +0 -14
  41. data/bin/setup +0 -8
  42. data/circle.yml +0 -6
  43. data/lib/rubocop/cop/migration/unsafe_migration.rb +0 -69
  44. data/lib/rubocop/migration/strong_migrations_checker.rb +0 -47
  45. data/lib/rubocop-migration.rb +0 -16
  46. data/vendor/.gitkeep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2f5d900885e38728ea16270cdb724f90d3b95b9e
4
- data.tar.gz: e2a245aa7c577b066b2081cf73607cab961b8ada
2
+ SHA256:
3
+ metadata.gz: 7d5fe85da04542f564b53e8c0d779c4258ca907f99a7583919aa02007d719f33
4
+ data.tar.gz: 06bd03d9e0afdf5618ad2bdfffbfa2ac465821f65009e2c949051bd04e3defae
5
5
  SHA512:
6
- metadata.gz: cf48675fc5ac8d96584cacbe6b30eae4f0f8a289679fd9ac1cbbd1fcebe9b87cd01fee9f166727085161f40ba1d79029ee69c6801bb465725dfbcca9c7de7159
7
- data.tar.gz: b30e87bf96055a935fa57f07c24d9aa6e3a47e205baf9fe4225a5ce36f1547d6fb5e1ef560ee3ae6e0e151a370d54da786e59b2a0209ffda143173da7594ae47
6
+ metadata.gz: 5943d60b5a214eecc77d326cf94b7f44fb270592822687f05b7165ca4b6165086ae6491f523a27dab620fb3e83ee6c7e03058d14b93cbecbc9dcf1334c47f333
7
+ data.tar.gz: 7b20c8d2766ff2803ae32a31f598e447fa5fd4282c9507fded7181d5c85d139fe8de603f6000e4dbe49c73b963a07f6cef12b8ec248eba925a621024086c2b86
data/.rubocop.yml ADDED
@@ -0,0 +1,58 @@
1
+ require:
2
+ - rubocop/cop/internal_affairs
3
+ - rubocop-migration
4
+ - rubocop-performance
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+ - sevencop
8
+
9
+ AllCops:
10
+ NewCops: enable
11
+ TargetRubyVersion: 2.7
12
+
13
+ # To automate release workflow.
14
+ Gemspec/RequireMFA:
15
+ Enabled: false
16
+
17
+ Layout/LineLength:
18
+ Enabled: false
19
+
20
+ Metrics:
21
+ Enabled: false
22
+
23
+ RSpec:
24
+ Language:
25
+ Expectations:
26
+ - expect_correction
27
+ - expect_no_offenses
28
+ - expect_offense
29
+
30
+ RSpec/ExampleLength:
31
+ Enabled: false
32
+
33
+ RSpec/MultipleExpectations:
34
+ Enabled: false
35
+
36
+ Sevencop/AutoloadOrdered:
37
+ Enabled: true
38
+
39
+ Sevencop/HashElementOrdered:
40
+ Enabled: true
41
+
42
+ Sevencop/MethodDefinitionArgumentsMultiline:
43
+ Enabled: true
44
+
45
+ Sevencop/MethodDefinitionKeywordArgumentOrdered:
46
+ Enabled: true
47
+
48
+ Sevencop/MethodDefinitionOrdered:
49
+ Enabled: true
50
+
51
+ Sevencop/RequireOrdered:
52
+ Enabled: true
53
+
54
+ Style/Documentation:
55
+ Enabled: false
56
+
57
+ Style/MultilineBlockChain:
58
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-10-17
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at r7kamura@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile CHANGED
@@ -1,4 +1,14 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in rubocop-migration.gemspec
4
6
  gemspec
7
+
8
+ gem 'rake'
9
+ gem 'rspec'
10
+ gem 'rubocop'
11
+ gem 'rubocop-performance'
12
+ gem 'rubocop-rake'
13
+ gem 'rubocop-rspec'
14
+ gem 'sevencop'
data/Gemfile.lock ADDED
@@ -0,0 +1,89 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubocop-migration (0.3.2)
5
+ activesupport
6
+ rubocop (>= 1.34)
7
+ rubocop-rails
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activesupport (7.0.4)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ ast (2.4.2)
18
+ concurrent-ruby (1.1.10)
19
+ diff-lcs (1.5.0)
20
+ i18n (1.12.0)
21
+ concurrent-ruby (~> 1.0)
22
+ json (2.6.2)
23
+ minitest (5.16.3)
24
+ parallel (1.22.1)
25
+ parser (3.1.2.1)
26
+ ast (~> 2.4.1)
27
+ rack (3.0.0)
28
+ rainbow (3.1.1)
29
+ rake (13.0.6)
30
+ regexp_parser (2.6.0)
31
+ rexml (3.2.5)
32
+ rspec (3.11.0)
33
+ rspec-core (~> 3.11.0)
34
+ rspec-expectations (~> 3.11.0)
35
+ rspec-mocks (~> 3.11.0)
36
+ rspec-core (3.11.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-expectations (3.11.1)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-mocks (3.11.1)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-support (3.11.1)
45
+ rubocop (1.36.0)
46
+ json (~> 2.3)
47
+ parallel (~> 1.10)
48
+ parser (>= 3.1.2.1)
49
+ rainbow (>= 2.2.2, < 4.0)
50
+ regexp_parser (>= 1.8, < 3.0)
51
+ rexml (>= 3.2.5, < 4.0)
52
+ rubocop-ast (>= 1.20.1, < 2.0)
53
+ ruby-progressbar (~> 1.7)
54
+ unicode-display_width (>= 1.4.0, < 3.0)
55
+ rubocop-ast (1.21.0)
56
+ parser (>= 3.1.1.0)
57
+ rubocop-performance (1.15.0)
58
+ rubocop (>= 1.7.0, < 2.0)
59
+ rubocop-ast (>= 0.4.0)
60
+ rubocop-rails (2.16.1)
61
+ activesupport (>= 4.2.0)
62
+ rack (>= 1.1)
63
+ rubocop (>= 1.33.0, < 2.0)
64
+ rubocop-rake (0.6.0)
65
+ rubocop (~> 1.0)
66
+ rubocop-rspec (2.13.2)
67
+ rubocop (~> 1.33)
68
+ ruby-progressbar (1.11.0)
69
+ sevencop (0.21.0)
70
+ rubocop
71
+ tzinfo (2.0.5)
72
+ concurrent-ruby (~> 1.0)
73
+ unicode-display_width (2.3.0)
74
+
75
+ PLATFORMS
76
+ x86_64-linux
77
+
78
+ DEPENDENCIES
79
+ rake
80
+ rspec
81
+ rubocop
82
+ rubocop-migration!
83
+ rubocop-performance
84
+ rubocop-rake
85
+ rubocop-rspec
86
+ sevencop
87
+
88
+ BUNDLED WITH
89
+ 2.3.23
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Ryo Nakamura
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 CHANGED
@@ -1,33 +1,58 @@
1
- # rubocop-migration [![CircleCI](https://circleci.com/gh/wealthsimple/rubocop-migration.svg?style=svg)](https://circleci.com/gh/wealthsimple/rubocop-migration) [![Gem Version](https://badge.fury.io/rb/rubocop-migration.svg)](https://rubygems.org/gems/rubocop-migration)
1
+ # rubocop-migration
2
2
 
3
- RuboCop extension to catch common pitfalls in ActiveRecord migrations.
3
+ [![test](https://github.com/r7kamura/rubocop-migration/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/rubocop-migration/actions/workflows/test.yml)
4
4
 
5
- ## Installation
5
+ RuboCop extension focused on ActiveRecord migration.
6
6
 
7
- Add this line to your application's Gemfile and then execute `bundle`:
7
+ ## Usage
8
+
9
+ ~~Install `rubocop-migration` gem:~~
10
+
11
+ This gem is not yet published to rubygems.org.
12
+ See [#1](https://github.com/r7kamura/rubocop-migration/issues/1) for more details.
8
13
 
9
14
  ```ruby
10
- group :development do
11
- gem 'rubocop-migration'
12
- end
15
+ # Gemfile
16
+ gem 'rubocop-migration', require: false, github: 'r7kamura/rubocop-migration', tag: 'v0.3.1'
13
17
  ```
14
18
 
15
- ## Usage
16
-
17
- Configure RuboCop to load the extension in `.rubocop.yml`.
19
+ then require `rubocop-migration` and enable the cops you want to use in your .rubocop.yml:
18
20
 
19
21
  ```yaml
20
- require: rubocop-migration
22
+ # .rubocop.yml
23
+ require:
24
+ - rubocop-migration
25
+
26
+ Migration/AddCheckConstraint:
27
+ Enabled: false
21
28
  ```
22
29
 
23
- ## Development
30
+ Note that all cops are `Enabled: false` by default.
24
31
 
25
- For running the spec files, this project depends on RuboCop's spec helpers. This means that in order to run the specs locally, you need a (shallow) clone of the RuboCop repository:
32
+ ## Cops
26
33
 
27
- ```
28
- git clone --depth 1 git://github.com/bbatsov/rubocop.git vendor/rubocop
29
- ```
34
+ Please read the comments of the respective cop classes for more information.
35
+
36
+ - [Migration/AddCheckConstraint](lib/rubocop/cop/migration/add_check_constraint.rb)
37
+ - [Migration/AddColumnWithDefaultValue](lib/rubocop/cop/migration/add_column_with_default_value.rb)
38
+ - [Migration/AddForeignKey](lib/rubocop/cop/migration/add_foreign_key.rb)
39
+ - [Migration/AddIndexColumnsCount](lib/rubocop/cop/migration/add_index_columns_count.rb)
40
+ - [Migration/AddIndexConcurrently](lib/rubocop/cop/migration/add_index_concurrently.rb)
41
+ - [Migration/AddIndexDuplicate](lib/rubocop/cop/migration/add_index_duplicate.rb)
42
+ - [Migration/BatchInBatches](lib/rubocop/cop/migration/batch_in_batches.rb)
43
+ - [Migration/BatchInTransaction](lib/rubocop/cop/migration/batch_in_transaction.rb)
44
+ - [Migration/BatchWithThrottling](lib/rubocop/cop/migration/batch_with_throttling.rb)
45
+ - [Migration/ChangeColumn](lib/rubocop/cop/migration/change_column.rb)
46
+ - [Migration/ChangeColumnNull](lib/rubocop/cop/migration/change_column_null.rb)
47
+ - [Migration/CreateTableForce](lib/rubocop/cop/migration/create_table_force.rb)
48
+ - [Migration/Jsonb](lib/rubocop/cop/migration/jsonb.rb)
49
+ - [Migration/RemoveColumn](lib/rubocop/cop/migration/remove_column.rb)
50
+ - [Migration/RenameColumn](lib/rubocop/cop/migration/rename_column.rb)
51
+ - [Migration/RenameTable](lib/rubocop/cop/migration/rename_table.rb)
52
+ - [Migration/ReservedWordMysql](lib/rubocop/cop/migration/reserved_word_mysql.rb)
53
+
54
+ ## Acknowledgements
30
55
 
31
- 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.
56
+ This gem was heavily inspired by the following gem:
32
57
 
33
- 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).
58
+ - [ankane/strong_migrations](https://github.com/ankane/strong_migrations)
data/Rakefile CHANGED
@@ -1,6 +1,12 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,151 @@
1
+ Migration/AddCheckConstraint:
2
+ Description: |
3
+ Activate a check constraint in a separate migration in PostgreSQL.
4
+ Enabled: false
5
+ Safe: false
6
+ VersionAdded: '0.22'
7
+ Include:
8
+ - db/migrate/**/*.rb
9
+
10
+ Migration/AddColumnWithDefaultValue:
11
+ Description: |
12
+ Add the column without a default value then change the default.
13
+ Enabled: false
14
+ Safe: false
15
+ VersionAdded: '0.22'
16
+ Include:
17
+ - db/migrate/**/*.rb
18
+
19
+ Migration/AddForeignKey:
20
+ Description: |
21
+ Activate a foreign key validation in a separate migration in PostgreSQL.
22
+ Enabled: false
23
+ Safe: false
24
+ VersionAdded: '0.22'
25
+ Include:
26
+ - db/migrate/**/*.rb
27
+
28
+ Migration/AddIndexColumnsCount:
29
+ Description: |
30
+ Keep non-unique index columns count less than a specified number.
31
+ Enabled: false
32
+ VersionAdded: '0.22'
33
+ MaxColumnsCount: 3
34
+ Include:
35
+ - db/migrate/**/*.rb
36
+
37
+ Migration/AddIndexConcurrently:
38
+ Description: |
39
+ Use `algorithm: :concurrently` on adding indexes to existing tables in PostgreSQL.
40
+ Enabled: false
41
+ Safe: false
42
+ VersionAdded: '0.22'
43
+ Include:
44
+ - db/migrate/**/*.rb
45
+
46
+ Migration/AddIndexDuplicate:
47
+ Description: |
48
+ Avoid adding duplicate indexes.
49
+ Enabled: false
50
+ Safe: false
51
+ VersionAdded: '0.22'
52
+ Include:
53
+ - db/migrate/**/*.rb
54
+
55
+ Migration/BatchInBatches:
56
+ Description: |
57
+ Use `in_batches` in batch processing.
58
+ Enabled: false
59
+ Safe: false
60
+ VersionAdded: '0.22'
61
+ Include:
62
+ - db/migrate/**/*.rb
63
+
64
+ Migration/BatchInTransaction:
65
+ Description: |
66
+ Disable transaction in batch processing.
67
+ Enabled: false
68
+ Safe: false
69
+ VersionAdded: '0.22'
70
+ Include:
71
+ - db/migrate/**/*.rb
72
+
73
+ Migration/BatchWithThrottling:
74
+ Description: |
75
+ Use throttling in batch processing.
76
+ Enabled: false
77
+ Safe: false
78
+ VersionAdded: '0.22'
79
+ Include:
80
+ - db/migrate/**/*.rb
81
+
82
+ Migration/CreateTableForce:
83
+ Description: |
84
+ Create tables without `force: true` option.
85
+ Enabled: false
86
+ VersionAdded: '0.22'
87
+ Include:
88
+ - db/migrate/**/*.rb
89
+
90
+ Migration/Jsonb:
91
+ Description: |
92
+ Prefer `jsonb` to `json`.
93
+ Enabled: false
94
+ Safe: false
95
+ VersionAdded: '0.22'
96
+ Include:
97
+ - db/migrate/**/*.rb
98
+
99
+ Migration/ChangeColumn:
100
+ Description: |
101
+ Avoid changing column type that is in use.
102
+ Enabled: false
103
+ Safe: false
104
+ VersionAdded: '0.22'
105
+ Include:
106
+ - db/migrate/**/*.rb
107
+
108
+ Migration/ChangeColumnNull:
109
+ Description: |
110
+ Avoid simply setting `NOT NULL` constraint on an existing column in PostgreSQL.
111
+ Enabled: false
112
+ Safe: false
113
+ VersionAdded: '0.22'
114
+ Include:
115
+ - db/migrate/**/*.rb
116
+
117
+ Migration/RemoveColumn:
118
+ Description: |
119
+ Add to `ignored_columns` and then remove the column.
120
+ Enabled: false
121
+ Safe: false
122
+ VersionAdded: '0.22'
123
+ Include:
124
+ - db/migrate/**/*.rb
125
+
126
+ Migration/RenameColumn:
127
+ Description: |
128
+ Avoid renaming columns that are in use.
129
+ Enabled: false
130
+ Safe: false
131
+ VersionAdded: '0.22'
132
+ Include:
133
+ - db/migrate/**/*.rb
134
+
135
+ Migration/RenameTable:
136
+ Description: |
137
+ Avoid removing tables that are in use.
138
+ Enabled: false
139
+ Safe: false
140
+ VersionAdded: '0.22'
141
+ Include:
142
+ - db/migrate/**/*.rb
143
+
144
+ Migration/ReservedWordMysql:
145
+ Description: |
146
+ Avoid using MySQL reserved words as identifiers.
147
+ Enabled: false
148
+ Safe: false
149
+ VersionAdded: '0.20'
150
+ Include:
151
+ - db/migrate/**/*.rb