diff --git a/changelog/change_db_migration_file_pattern.md b/changelog/change_db_migration_file_pattern.md new file mode 100644 index 0000000000..46a35cb611 --- /dev/null +++ b/changelog/change_db_migration_file_pattern.md @@ -0,0 +1 @@ +* [#1019](https://github.com/rubocop/rubocop-rails/pull/1019): Change db migration file pattern so that it supports multiple db. ([@r7kamura][]) diff --git a/config/default.yml b/config/default.yml index a406ce90e9..7f8e0fdaba 100644 --- a/config/default.yml +++ b/config/default.yml @@ -160,8 +160,9 @@ Rails/AddColumnIndex: index might be used. Enabled: pending VersionAdded: '2.11' + VersionChanged: '<>' Include: - - db/migrate/*.rb + - db/**/*.rb Rails/AfterCommitOverride: Description: >- @@ -249,12 +250,13 @@ Rails/BulkChangeTable: - https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html Enabled: true VersionAdded: '0.57' + VersionChanged: '<>' Database: null SupportedDatabases: - mysql - postgresql Include: - - db/migrate/*.rb + - db/**/*.rb Rails/CompactBlank: Description: 'Checks if collection can be blank-compacted with `compact_blank`.' @@ -284,14 +286,15 @@ Rails/CreateTableWithTimestamps: when creating a new table. Enabled: true VersionAdded: '0.52' + VersionChanged: '<>' 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: >- @@ -648,8 +651,9 @@ Rails/MigrationClassName: Description: 'The class name of the migration should match its file name.' Enabled: pending VersionAdded: '2.14' + VersionChanged: '<>' Include: - - db/migrate/*.rb + - db/**/*.rb Rails/NegateInclude: Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.' @@ -663,8 +667,9 @@ Rails/NotNullColumn: Description: 'Do not add a NOT NULL column without a default value.' Enabled: true VersionAdded: '0.43' + VersionChanged: '<>' Include: - - db/migrate/*.rb + - db/**/*.rb Rails/OrderById: Description: >-