)]}'
{"keystone/common/sql/contract_repo/versions/055_contract_add_domain_to_limit.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"44f6471e9a55393519683e90f160c2d367f32ea6","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # In sqlite case, the \"registered_limit\" and \"limit\" tables were dropped"},{"line_number":24,"context_line":"    # and recreated in 047 migration script. So after 047, once either of them"},{"line_number":25,"context_line":"    # is changed, we should make sure the newly change is addressed."},{"line_number":26,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":27,"context_line":"        if not hasattr(limit_table.c, \u0027domain_id\u0027):"},{"line_number":28,"context_line":"            domain_id \u003d sql.Column(\u0027domain_id\u0027, sql.String(64), nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_92679724","line":25,"updated":"2018-12-12 22:03:32.000000000","message":"Dumb question: why wouldn\u0027t this get applied like any other migration?","commit_id":"c68793b6a4111940dd1c93ca96727771d51c4df5"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4069847c458ea7b9046c26de5631022d212e9a6c","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # In sqlite case, the \"registered_limit\" and \"limit\" tables were dropped"},{"line_number":24,"context_line":"    # and recreated in 047 migration script. So after 047, once either of them"},{"line_number":25,"context_line":"    # is changed, we should make sure the newly change is addressed."},{"line_number":26,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":27,"context_line":"        if not hasattr(limit_table.c, \u0027domain_id\u0027):"},{"line_number":28,"context_line":"            domain_id \u003d sql.Column(\u0027domain_id\u0027, sql.String(64), nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_3769a75a","line":25,"in_reply_to":"3f79a3b5_2c9c276e","updated":"2018-12-14 17:25:39.000000000","message":"Ah interesting... I suppose it\u0027s an ordering issue. If we did something like:\n\n* expand N\n* data_migrate N\n* contract N\n* expand N + 1\n* data_migrate N + 1\n* contract N + 1\n\nWe wouldn\u0027t need this step. Doesn\u0027t look like we describe how this works in our contributor documentation either [0].\n\n[0] https://docs.openstack.org/keystone/latest/contributor/database-migrations.html","commit_id":"c68793b6a4111940dd1c93ca96727771d51c4df5"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"c937428ca1c4c9d81f2992d260b46b2a0f4d5642","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # In sqlite case, the \"registered_limit\" and \"limit\" tables were dropped"},{"line_number":24,"context_line":"    # and recreated in 047 migration script. So after 047, once either of them"},{"line_number":25,"context_line":"    # is changed, we should make sure the newly change is addressed."},{"line_number":26,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":27,"context_line":"        if not hasattr(limit_table.c, \u0027domain_id\u0027):"},{"line_number":28,"context_line":"            domain_id \u003d sql.Column(\u0027domain_id\u0027, sql.String(64), nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_7ac93484","line":25,"in_reply_to":"3f79a3b5_3769a75a","updated":"2018-12-17 07:50:42.000000000","message":"yeah, correct. But our test run it in a way as I mentioned.\n\nexample: https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_sql_upgrade.py#L2433","commit_id":"c68793b6a4111940dd1c93ca96727771d51c4df5"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d6f42f3fd47217ff82e20d66761f531c44de16b0","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # In sqlite case, the \"registered_limit\" and \"limit\" tables were dropped"},{"line_number":24,"context_line":"    # and recreated in 047 migration script. So after 047, once either of them"},{"line_number":25,"context_line":"    # is changed, we should make sure the newly change is addressed."},{"line_number":26,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":27,"context_line":"        if not hasattr(limit_table.c, \u0027domain_id\u0027):"},{"line_number":28,"context_line":"            domain_id \u003d sql.Column(\u0027domain_id\u0027, sql.String(64), nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bfdaf3ff_c42e69a4","line":25,"in_reply_to":"3f79a3b5_7ac93484","updated":"2019-01-15 21:21:31.000000000","message":"I suppose only SQLite is susceptible to this because we special-case the migration (contract_47). It looks like this part of the comment wasn\u0027t implemented [0]?\n\n[0] https://git.openstack.org/cgit/openstack/keystone/tree/keystone/common/sql/contract_repo/versions/047_contract_expand_update_pk_for_unified_limit.py#n23","commit_id":"c68793b6a4111940dd1c93ca96727771d51c4df5"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"fc52c9b39aa4a3336b42e264848f34915da72a08","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    # In sqlite case, the \"registered_limit\" and \"limit\" tables were dropped"},{"line_number":24,"context_line":"    # and recreated in 047 migration script. So after 047, once either of them"},{"line_number":25,"context_line":"    # is changed, we should make sure the newly change is addressed."},{"line_number":26,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":27,"context_line":"        if not hasattr(limit_table.c, \u0027domain_id\u0027):"},{"line_number":28,"context_line":"            domain_id \u003d sql.Column(\u0027domain_id\u0027, sql.String(64), nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_2c9c276e","line":25,"in_reply_to":"3f79a3b5_92679724","updated":"2018-12-13 02:27:41.000000000","message":"in 047, for sqlite case, we dropped \"registered_limit\" and \"limit\" tables and recreated new ones in contract script. Then we migrate the database in the step like:\n\nexpand_01 -\u003e ... -\u003e expand_055 -\u003e data_migreate_01 -\u003e ... -\u003e date_migrate_055 -\u003e contract_01 -\u003e contract_055\n\nWe can see that the new \"domain_id\" column is added in expand_055, but after that, the table is dropped in contract_047. So we should add it back in contract_055.","commit_id":"c68793b6a4111940dd1c93ca96727771d51c4df5"}]}
