Bug Description
Database migration issue is arising when we are trying to use an upgraded version of rudder-server on our self hosted plane. We were using an older version of rudder-server and thought of upgrading it to the latest versions. After successfully upgrading we started the server by connecting to the old db that we had since we saw proper migration files. But the issue occurred in a way that the workspace_id column was not getting added in the db and prior to that indexing of columns were taking place. This is happening because we are trying to create a new read for errDBForRead before writing. What is happening in turn is that we are not migrating the dbs before indexing.
Steps to reproduce the bug
- Use an older version of the service
- Create a db with that version
- Upgrade the service to a newer version but use the existing database
- Start the service by running
go run
Expected behavior
Successful migration of the old database after which service starts normally.
Screenshots

Desktop (please complete the following information):
- OS: MacOS - 13.4.1(Ventura)
- Browser - Chrome
- Version - 114.0.5735.198