Open chriger opened 2 years ago
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.
nil
Example: Table name: HERE_IS_MY_LOOONG_TABLE_NAME Sequence name: HERE_IS_MY_LOOONG_TABLE_NA_SEQ
HERE_IS_MY_LOOONG_TABLE_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
HERE_IS_MY_LOOONG_TABLE_NAME_SEQ
Thank you for opening a pull request. Would you add some specs for this change?
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:
The adapter try to change a sequence named
HERE_IS_MY_LOOONG_TABLE_NAME_SEQ
instead ofHERE_IS_MY_LOOONG_TABLE_NA_SEQ