Skip to content

Commit

Permalink
Change db migration file pattern so that it supports multiple db
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura committed Jun 13, 2023
1 parent cbf9caf commit b3bbe8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
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

0 comments on commit b3bbe8c

Please sign in to comment.