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

Use default_sequence_name to identify sequence when rename a table #2283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chriger
Copy link
Contributor

@chriger chriger commented Mar 30, 2022

I encountered a problem when renaming a table with a sequence that has a shortened table name in it to meet the 30 character limit.

Because errors when renaming a sequence are rescued with nil i recognized the error after executing the migration on my running test environment.

Example:
Table name: HERE_IS_MY_LOOONG_TABLE_NAME
Sequence name: HERE_IS_MY_LOOONG_TABLE_NA_SEQ

When executing a rename as follow:

rename_table :here_is_my_looong_table_name :short_table_name

The adapter try to change a sequence named HERE_IS_MY_LOOONG_TABLE_NAME_SEQ instead of HERE_IS_MY_LOOONG_TABLE_NA_SEQ

@yahonda
Copy link
Collaborator

yahonda commented Jun 7, 2022

Thank you for opening a pull request. Would you add some specs for this change?

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.

2 participants