Previous to v2.0.0 of ResultsDB, the table that was checked was "job". In v2.0.0,
that table was replaced with the "group" table. The initialize_db function first
checks to see if the database has been initialized by checking if a certain expected table exists,
and if it doesn't, it creates the tables. If it does find it, it then upgrades the database to the
latest Alembic revision. This was a handy function/command to run whether you were initializing the
database or just migrating to the latest version. The change in v2.0.0 however, made upgrading from a
v1.x.x database to a v2.x.x database using this function a mess (which I used in my Ansible role).
It would check for the "group" table, which was only available in v2.0.0, and it would see it wasn't
there and it would run the db.create_all() function, and stamp the database as the latest revision.
I would end up with the legacy job table and the new group table coexisting and all the alterations made
in the migrations beyond that were not present. Using a table to check that exists in both v1.x.x and v2.x.x
is a solution to this problem in the future.
Details
Details
NA
Diff Detail
Diff Detail
- Repository
- rRSDB resultsdb
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Makes sense. Weird thing is that we did not hit any troubles with the migration, but whatever.
Good catch, thanks!