Skip to content

Commit 6f1a411

Browse files
authored
Merge pull request #1019 from r7kamura/db-wildcard-migrate
Change db migration file pattern so that it supports multiple db
2 parents cbf9caf + b3bbe8c commit 6f1a411

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#1019](https://github.com/rubocop/rubocop-rails/pull/1019): Change db migration file pattern so that it supports multiple db. ([@r7kamura][])

config/default.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ Rails/AddColumnIndex:
160160
index might be used.
161161
Enabled: pending
162162
VersionAdded: '2.11'
163+
VersionChanged: '<<next>>'
163164
Include:
164-
- db/migrate/*.rb
165+
- db/**/*.rb
165166

166167
Rails/AfterCommitOverride:
167168
Description: >-
@@ -249,12 +250,13 @@ Rails/BulkChangeTable:
249250
- https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html
250251
Enabled: true
251252
VersionAdded: '0.57'
253+
VersionChanged: '<<next>>'
252254
Database: null
253255
SupportedDatabases:
254256
- mysql
255257
- postgresql
256258
Include:
257-
- db/migrate/*.rb
259+
- db/**/*.rb
258260

259261
Rails/CompactBlank:
260262
Description: 'Checks if collection can be blank-compacted with `compact_blank`.'
@@ -284,14 +286,15 @@ Rails/CreateTableWithTimestamps:
284286
when creating a new table.
285287
Enabled: true
286288
VersionAdded: '0.52'
289+
VersionChanged: '<<next>>'
287290
Include:
288-
- db/migrate/*.rb
291+
- db/**/*.rb
289292
Exclude:
290293
# Respect the `active_storage_variant_records` table of `*_create_active_storage_tables.active_storage.rb`
291294
# and `*_create_active_storage_variant_records.active_storage.rb`
292295
# auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified.
293-
- db/migrate/*_create_active_storage_tables.active_storage.rb
294-
- db/migrate/*_create_active_storage_variant_records.active_storage.rb
296+
- db/**/*_create_active_storage_tables.active_storage.rb
297+
- db/**/*_create_active_storage_variant_records.active_storage.rb
295298

296299
Rails/Date:
297300
Description: >-
@@ -648,8 +651,9 @@ Rails/MigrationClassName:
648651
Description: 'The class name of the migration should match its file name.'
649652
Enabled: pending
650653
VersionAdded: '2.14'
654+
VersionChanged: '<<next>>'
651655
Include:
652-
- db/migrate/*.rb
656+
- db/**/*.rb
653657

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

669674
Rails/OrderById:
670675
Description: >-

0 commit comments

Comments
 (0)