Skip to content

Rename migration files when renaming migration class#690

Open
sucicfilip wants to merge 1 commit intoShopify:mainfrom
sucicfilip:feature/rename-migration-files
Open

Rename migration files when renaming migration class#690
sucicfilip wants to merge 1 commit intoShopify:mainfrom
sucicfilip:feature/rename-migration-files

Conversation

@sucicfilip
Copy link

Automatically rename migration files when renaming the migration class via textDocument/rename.

For example, renaming CreateFoos to CreateBars will also rename 20210901000000_create_foos.rb to 20210901000000_create_bars.rb.

Depends on Shopify/ruby-lsp#3958 which adds the collect_file_renames addon hook.

Closes #497

@sucicfilip sucicfilip requested a review from a team as a code owner February 15, 2026 11:10
@sucicfilip sucicfilip force-pushed the feature/rename-migration-files branch from 3076af5 to 7428f4a Compare February 15, 2026 11:58
@sucicfilip
Copy link
Author

After testing this on a bigger codebase, I think it would be better to implement it like the "Run migrations" pop up, because currently it is quite slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Automatically rename migration file to follow class name

1 participant