Rails database chicken and egg error-Collection of common programming errors
Running the migration crashes because the dynamic method find_by_configuration_set_and_key
is undefined. This dynamic method will only be defined after the migration is executed as the migration is renaming column set
to configuration_set
.
I have now found a way to execute the migration although it’s not perfect.
The code where method find_by_configuration_set_and_key
is called lays within a plugin. I changed environment.rb so that the plugin is not loaded and that allowed me to run the Rails database migration. Then I put it back and restarted the app.
This solution is better then using the mysql client but still a hack. Thanks to everyone for the nice ideas and discussion.