)]}'
{"cinder/db/sqlalchemy/migrate_repo/versions/136_make_vol_type_col_non_nullable.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9f940a7e04b7b08e5462686f5cf761d2f0d64327","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":34,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027 \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_511a7118","line":33,"range":{"start_line":33,"start_character":39,"end_line":33,"end_character":51},"updated":"2019-11-27 17:13:15.000000000","message":"What is the \"api database\"?","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"0197e2b161a925980043eddacf350a5362d121db","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":34,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027 \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_8c2212a3","line":33,"range":{"start_line":33,"start_character":39,"end_line":33,"end_character":51},"in_reply_to":"3fa7e38b_511a7118","updated":"2019-11-27 17:44:06.000000000","message":"Done","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9f940a7e04b7b08e5462686f5cf761d2f0d64327","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":34,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027 \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":37,"context_line":"        raise exception.ValidationError(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_311d7510","line":34,"range":{"start_line":34,"start_character":58,"end_line":34,"end_character":60},"updated":"2019-11-27 17:13:15.000000000","message":"Shouldn\u0027t this be a `","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"0197e2b161a925980043eddacf350a5362d121db","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":34,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027 \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":37,"context_line":"        raise exception.ValidationError(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_2c375ee7","line":34,"range":{"start_line":34,"start_character":58,"end_line":34,"end_character":60},"in_reply_to":"3fa7e38b_311d7510","updated":"2019-11-27 17:44:06.000000000","message":"Done","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9f940a7e04b7b08e5462686f5cf761d2f0d64327","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    if count \u003e 0:"},{"line_number":47,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all snapshots have \u0027"},{"line_number":48,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":49,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027\u0027"},{"line_number":50,"context_line":"                 \u0027There are still %(count)i untyped snapshots \u0027"},{"line_number":51,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":52,"context_line":"        raise exception.ValidationError(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_1114f9e8","line":49,"range":{"start_line":49,"start_character":58,"end_line":49,"end_character":60},"updated":"2019-11-27 17:13:15.000000000","message":"`","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"0197e2b161a925980043eddacf350a5362d121db","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    if count \u003e 0:"},{"line_number":47,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all snapshots have \u0027"},{"line_number":48,"context_line":"                 \u0027been migrated to the api database. Please run \u0027"},{"line_number":49,"context_line":"                 \u0027`cinder-manage db online_data_migrations\\\u0027\u0027"},{"line_number":50,"context_line":"                 \u0027There are still %(count)i untyped snapshots \u0027"},{"line_number":51,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":52,"context_line":"        raise exception.ValidationError(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_4c341ae0","line":49,"range":{"start_line":49,"start_character":58,"end_line":49,"end_character":60},"in_reply_to":"3fa7e38b_1114f9e8","updated":"2019-11-27 17:44:06.000000000","message":"Done","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"17acc52bf7ca73a092d4bf3d62beadd41d0e7fd5","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    # Update volume_type columns in tables to not allow null value"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    volumes \u003d Table(\u0027volumes\u0027, meta, autoload\u003dTrue)"},{"line_number":27,"context_line":"    count \u003d select([func.count()]).select_from(volumes).where(and_("},{"line_number":28,"context_line":"        volumes.c.deleted \u003d\u003d False,"},{"line_number":29,"context_line":"        volumes.c.volume_type_id \u003d\u003d None)).execute().scalar()  # NOQA"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the `__DEFAULT__` volume type. Please \u0027"},{"line_number":34,"context_line":"                 \u0027run `cinder-manage db online_data_migrations`. \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":37,"context_line":"        raise exception.ValidationError(msg)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    volumes.c.volume_type_id.alter(nullable\u003dFalse)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    snapshots \u003d Table(\u0027snapshots\u0027, meta, autoload\u003dTrue)"},{"line_number":42,"context_line":"    count \u003d select([func.count()]).select_from(snapshots).where(and_("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_7886e267","line":39,"range":{"start_line":26,"start_character":4,"end_line":39,"end_character":50},"updated":"2019-12-09 10:35:58.000000000","message":"Can we just get something like:\ntry:\n    volumes.c.volume_type_id.alter(nullable\u003dFalse)\nexcept SomeExceptionClass:\n    msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027\n                 \u0027been migrated to the `__DEFAULT__` volume type. Please \u0027\n                 \u0027run `cinder-manage db online_data_migrations`. \u0027\n                 \u0027There are still %(count)i untyped volumes \u0027\n                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})\n        raise exception.ValidationError(msg)\n?","commit_id":"fbd5a015945c91ec0ec6b2cb0509e8ad26d1aaba"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8b0da774d8cb9a115383104eb843abb2ab99c609","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    # Update volume_type columns in tables to not allow null value"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    volumes \u003d Table(\u0027volumes\u0027, meta, autoload\u003dTrue)"},{"line_number":27,"context_line":"    count \u003d select([func.count()]).select_from(volumes).where(and_("},{"line_number":28,"context_line":"        volumes.c.deleted \u003d\u003d False,"},{"line_number":29,"context_line":"        volumes.c.volume_type_id \u003d\u003d None)).execute().scalar()  # NOQA"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    if count \u003e 0:"},{"line_number":32,"context_line":"        msg \u003d (_(\u0027Migration cannot continue until all volumes have \u0027"},{"line_number":33,"context_line":"                 \u0027been migrated to the `__DEFAULT__` volume type. Please \u0027"},{"line_number":34,"context_line":"                 \u0027run `cinder-manage db online_data_migrations`. \u0027"},{"line_number":35,"context_line":"                 \u0027There are still %(count)i untyped volumes \u0027"},{"line_number":36,"context_line":"                 \u0027unmigrated.\u0027) % {\u0027count\u0027: count})"},{"line_number":37,"context_line":"        raise exception.ValidationError(msg)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    volumes.c.volume_type_id.alter(nullable\u003dFalse)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    snapshots \u003d Table(\u0027snapshots\u0027, meta, autoload\u003dTrue)"},{"line_number":42,"context_line":"    count \u003d select([func.count()]).select_from(snapshots).where(and_("}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_3a49692e","line":39,"range":{"start_line":26,"start_character":4,"end_line":39,"end_character":50},"in_reply_to":"3fa7e38b_7886e267","updated":"2020-01-21 08:58:40.000000000","message":"This is also a way to do it just it doesn\u0027t tell the count of pending volume/snapshots unmigrated.\nOn second thought, the count doesn\u0027t add much value and i see the same being done in other migrations so this seems to be a good approach.","commit_id":"fbd5a015945c91ec0ec6b2cb0509e8ad26d1aaba"}],"cinder/tests/unit/db/test_migrations.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9f940a7e04b7b08e5462686f5cf761d2f0d64327","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                 .execute().first())"},{"line_number":192,"context_line":"        self.assertIsNotNone(vtype)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _check_136(self, engine, data):"},{"line_number":195,"context_line":"        \"\"\"Test alter volume_type_id columns.\"\"\""},{"line_number":196,"context_line":"        vol_table \u003d db_utils.get_table(engine, \u0027volumes\u0027)"},{"line_number":197,"context_line":"        snap_table \u003d db_utils.get_table(engine, \u0027snapshots\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_31e25504","line":194,"updated":"2019-11-27 17:13:15.000000000","message":"Might be good to have tests for the negative case as well, but I don\u0027t think we\u0027ve done that much.","commit_id":"51067cf50e941d6b7fa041d6f2d3b641b4fb2064"}]}
