Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change db migration file pattern so that it supports multiple db #1019

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/change_db_migration_file_pattern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1019](https://github.com/rubocop/rubocop-rails/pull/1019): Change db migration file pattern so that it supports multiple db. ([@r7kamura][])
19 changes: 12 additions & 7 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ Rails/AddColumnIndex:
index might be used.
Enabled: pending
VersionAdded: '2.11'
VersionChanged: '<<next>>'
Include:
- db/migrate/*.rb
- db/**/*.rb

Rails/AfterCommitOverride:
Description: >-
Expand Down Expand Up @@ -249,12 +250,13 @@ Rails/BulkChangeTable:
- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html
Enabled: true
VersionAdded: '0.57'
VersionChanged: '<<next>>'
Database: null
SupportedDatabases:
- mysql
- postgresql
Include:
- db/migrate/*.rb
- db/**/*.rb

Rails/CompactBlank:
Description: 'Checks if collection can be blank-compacted with `compact_blank`.'
Expand Down Expand Up @@ -284,14 +286,15 @@ Rails/CreateTableWithTimestamps:
when creating a new table.
Enabled: true
VersionAdded: '0.52'
VersionChanged: '<<next>>'
Include:
- db/migrate/*.rb
- db/**/*.rb
Exclude:
# Respect the `active_storage_variant_records` table of `*_create_active_storage_tables.active_storage.rb`
# and `*_create_active_storage_variant_records.active_storage.rb`
# auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified.
- db/migrate/*_create_active_storage_tables.active_storage.rb
- db/migrate/*_create_active_storage_variant_records.active_storage.rb
- db/**/*_create_active_storage_tables.active_storage.rb
- db/**/*_create_active_storage_variant_records.active_storage.rb

Rails/Date:
Description: >-
Expand Down Expand Up @@ -648,8 +651,9 @@ Rails/MigrationClassName:
Description: 'The class name of the migration should match its file name.'
Enabled: pending
VersionAdded: '2.14'
VersionChanged: '<<next>>'
Include:
- db/migrate/*.rb
- db/**/*.rb

Rails/NegateInclude:
Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.'
Expand All @@ -663,8 +667,9 @@ Rails/NotNullColumn:
Description: 'Do not add a NOT NULL column without a default value.'
Enabled: true
VersionAdded: '0.43'
VersionChanged: '<<next>>'
Include:
- db/migrate/*.rb
- db/**/*.rb

Rails/OrderById:
Description: >-
Expand Down