)]}'
{"nova/db/sqlalchemy/migrate_repo/versions/316_resource_provider_name_aggregates.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cec9fdc050e8aa5aefcf92c1f4029590584d93aa","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    resource_providers \u003d Table(\u0027resource_providers\u0027, meta, autoload\u003dTrue)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    name \u003d Column(\u0027name\u0027, Unicode(200), nullable\u003dTrue)"},{"line_number":29,"context_line":"    generation \u003d Column(\u0027generation\u0027, Integer, default\u003d0)"},{"line_number":30,"context_line":"    can_host \u003d Column(\u0027can_host\u0027, Integer, default\u003d0)"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bae84128_b3076080","line":28,"updated":"2016-02-21 20:01:45.000000000","message":"I\u0027m unclear on how to ensure this column is charset utf8 when we have already declared the table latin1. I know what to do if we were talking to mysql directly, but not so much when in sqlalchemy.","commit_id":"1ba6d012738e7a57afeb1d5ced57c12dd65eb777"}],"nova/db/sqlalchemy/migrate_repo/versions/317_resource_provider_name_aggregates.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"67cfe2b6e3c6c57a2c42541fa2622daa50326bbb","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    resource_providers \u003d Table(\u0027resource_providers\u0027, meta, autoload\u003dTrue)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    name \u003d Column(\u0027name\u0027, Unicode(200), nullable\u003dTrue)"},{"line_number":30,"context_line":"    generation \u003d Column(\u0027generation\u0027, Integer, default\u003d0)"},{"line_number":31,"context_line":"    can_host \u003d Column(\u0027can_host\u0027, Integer, default\u003d0)"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_65a2fc4c","line":29,"updated":"2016-02-22 22:14:51.000000000","message":"Not clear how to make this column be charset utf8 in a table that has already been declared how to be latin1.","commit_id":"dad7570f94a9f108767fdfdfa62b35a556cc21a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0d69bd1dd6309b013c497dfc4f785280f48d49c6","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    resource_providers \u003d Table(\u0027resource_providers\u0027, meta, autoload\u003dTrue)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    name \u003d Column(\u0027name\u0027, Unicode(200), nullable\u003dTrue)"},{"line_number":30,"context_line":"    generation \u003d Column(\u0027generation\u0027, Integer, default\u003d0)"},{"line_number":31,"context_line":"    can_host \u003d Column(\u0027can_host\u0027, Integer, default\u003d0)"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_21c9de26","line":29,"updated":"2016-02-23 15:52:02.000000000","message":"For the name column on MySQL engines, we want to ensure that utf8 character set is used, despite the resource_providers default character set being latin1. To do that, for the MySQL engine only below you will want to do something like:\n\n name_col_ddl \u003d sqlalchemy.DDL(\"ALTER TABLE resource_providers ADD COLUMN name VARCHAR(200) NOT NULL CHARACTER SET utf8\")\n conn \u003d engine.connection()\n conn.execute(name_col_ddl)","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0d69bd1dd6309b013c497dfc4f785280f48d49c6","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    resource_providers \u003d Table(\u0027resource_providers\u0027, meta, autoload\u003dTrue)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    name \u003d Column(\u0027name\u0027, Unicode(200), nullable\u003dTrue)"},{"line_number":30,"context_line":"    generation \u003d Column(\u0027generation\u0027, Integer, default\u003d0)"},{"line_number":31,"context_line":"    can_host \u003d Column(\u0027can_host\u0027, Integer, default\u003d0)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    if not hasattr(resource_providers.c, \u0027name\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_01ce5a2d","line":30,"updated":"2016-02-23 15:52:02.000000000","message":"Note that default\u003d0 is a *Python-side* default, not the default in the database. :) You likely want server_default\u003d0 here as well.\n\nhttp://docs.sqlalchemy.org/en/rel_1_0/core/metadata.html#sqlalchemy.schema.Column.params.server_default","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3c306d08b3b4bb3f688d14f183f2e654fb70fc0f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        mysql_charset\u003d\u0027latin1\u0027"},{"line_number":58,"context_line":"    )"},{"line_number":59,"context_line":"    Index(\u0027resource_provider_aggregates_aggregate_id_idx\u0027,"},{"line_number":60,"context_line":"          resource_provider_aggregates.c.aggregate_id)"},{"line_number":61,"context_line":"    resource_provider_aggregates.create(checkfirst\u003dTrue)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_c12f5286","line":60,"updated":"2016-02-23 15:42:37.000000000","message":"is it me or this index is not referenced ?","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2af96dd7823f6d6c933cbca4ddfada7d7892d85d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        mysql_charset\u003d\u0027latin1\u0027"},{"line_number":58,"context_line":"    )"},{"line_number":59,"context_line":"    Index(\u0027resource_provider_aggregates_aggregate_id_idx\u0027,"},{"line_number":60,"context_line":"          resource_provider_aggregates.c.aggregate_id)"},{"line_number":61,"context_line":"    resource_provider_aggregates.create(checkfirst\u003dTrue)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_538030f7","line":60,"in_reply_to":"bae84128_c12f5286","updated":"2016-02-23 17:34:04.000000000","message":"Because we\u0027ve already given a `meta` to the resource_provider_aggregates table, when a row from it is used in the Index() call, it becomes side effecty and is implicitly created. Such is the nature of sqlalchemy\u0027s declarative style.\n\nJust to be sure I commented out that line and the migration test did indeed fail. With the line present, all good.\n\n(BTW, I borrowed doing it declaratively from existing migrations, I\u0027m not winging some new style here.)","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0d69bd1dd6309b013c497dfc4f785280f48d49c6","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":64,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":65,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":66,"context_line":"                     \u0027used\u0027])"},{"line_number":67,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":68,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_61cf6629","line":66,"updated":"2016-02-23 15:52:02.000000000","message":"Thanks for adding this.","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2af96dd7823f6d6c933cbca4ddfada7d7892d85d","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":64,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":65,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":66,"context_line":"                     \u0027used\u0027])"},{"line_number":67,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":68,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_53979039","line":66,"in_reply_to":"bae84128_61cf6629","updated":"2016-02-23 17:34:04.000000000","message":"I figure may as well get it in there ASAP. More migrations makes puppies sad.","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3c306d08b3b4bb3f688d14f183f2e654fb70fc0f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":66,"context_line":"                     \u0027used\u0027])"},{"line_number":67,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":68,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_3e157b48","line":68,"updated":"2016-02-23 15:42:37.000000000","message":"I was originally worried by the index modification made in models.py but you confirm me the right migration path here","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"}],"nova/db/sqlalchemy/migrate_repo/versions/318_resource_provider_name_aggregates.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ad2311f13daad039863e86c28eb35320b87b3f46","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if migrate_engine.name \u003d\u003d \u0027mysql\u0027:"},{"line_number":42,"context_line":"            name_col_ddl \u003d DDL("},{"line_number":43,"context_line":"                \"ALTER TABLE resource_providers MODIFY name \""},{"line_number":44,"context_line":"                \"VARCHAR(200) CHARACTER SET utf8\")"},{"line_number":45,"context_line":"            conn \u003d migrate_engine.connect()"},{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_551f1c5b","line":44,"updated":"2016-02-24 22:29:55.000000000","message":"just to make sure, that means that other engines won\u0027t support UTF8 names ?","commit_id":"b0293a798cae1ffb77a3bff859f1d12460ed4edd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"78d220a8748504f72d1002f458430523a935a0e4","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if migrate_engine.name \u003d\u003d \u0027mysql\u0027:"},{"line_number":42,"context_line":"            name_col_ddl \u003d DDL("},{"line_number":43,"context_line":"                \"ALTER TABLE resource_providers MODIFY name \""},{"line_number":44,"context_line":"                \"VARCHAR(200) CHARACTER SET utf8\")"},{"line_number":45,"context_line":"            conn \u003d migrate_engine.connect()"},{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_68722caf","line":44,"in_reply_to":"bae84128_551f1c5b","updated":"2016-02-25 11:13:59.000000000","message":"They will support utf8. This is in place because an earlier migration declared the table, if mysql, to be latin1 so we need to compensate for that for this column. For other engines, things work in their usual way.\n\nAll of this is because of the interesting ways in which mysql handles character encoding. sqlite and postgresql have different approaches.","commit_id":"b0293a798cae1ffb77a3bff859f1d12460ed4edd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1a5a66e46cff2ede988b749e443ac72dc8158b8d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if migrate_engine.name \u003d\u003d \u0027mysql\u0027:"},{"line_number":42,"context_line":"            name_col_ddl \u003d DDL("},{"line_number":43,"context_line":"                \"ALTER TABLE resource_providers MODIFY name \""},{"line_number":44,"context_line":"                \"VARCHAR(200) CHARACTER SET utf8\")"},{"line_number":45,"context_line":"            conn \u003d migrate_engine.connect()"},{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9aed3d3a_122bed31","line":44,"in_reply_to":"bae84128_68722caf","updated":"2016-02-25 20:51:06.000000000","message":"okay thanks for explaining","commit_id":"b0293a798cae1ffb77a3bff859f1d12460ed4edd"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cc1c92c8b4f01ffcc77a3342c5af6bc2b6e820b6","unresolved":false,"context_lines":[{"line_number":9,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"\"\"\"Add name column to resource-providers.\"\"\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from migrate import UniqueConstraint"},{"line_number":15,"context_line":"from oslo_db.sqlalchemy import utils"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_b7b7f7d6","line":12,"updated":"2016-02-29 17:21:39.000000000","message":"Nit: this is out of date. Might be easier just to drop this comment?","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d8afa4f1a6f32588469af3bd690d8dd5e7380a9a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"\"\"\"Add name column to resource-providers.\"\"\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from migrate import UniqueConstraint"},{"line_number":15,"context_line":"from oslo_db.sqlalchemy import utils"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_d9e90ab9","line":12,"in_reply_to":"9aed3d3a_b7b7f7d6","updated":"2016-02-29 18:32:01.000000000","message":"Will do after a bit more feedback rolls in.","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cc1c92c8b4f01ffcc77a3342c5af6bc2b6e820b6","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_2d439843","line":49,"updated":"2016-02-29 17:21:39.000000000","message":"I thought unique constraint on nullable things are bad for ibm_db_sa?\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1509","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"870d3a9dea9e3b802cfe24ce57aee3fa68d7c6e0","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_2c71d1a8","line":49,"in_reply_to":"9aed3d3a_23d5641b","updated":"2016-02-29 20:03:43.000000000","message":"I don\u0027t see the need for having a FK on a string like a name that we don\u0027t provide (it\u0027s provided by the external resource provider), so I think it\u0027s okay.","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d8afa4f1a6f32588469af3bd690d8dd5e7380a9a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_394116aa","line":49,"in_reply_to":"9aed3d3a_2d439843","updated":"2016-02-29 18:32:01.000000000","message":"Ah, that\u0027s interesting. So should I just put it under the if below and we\u0027ll just let ibm_db_sa float along without the constraint?","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31885606aeb2c1e19134c34e289dbf1936b26e26","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_a3433441","line":49,"in_reply_to":"9aed3d3a_394116aa","updated":"2016-02-29 19:06:20.000000000","message":"So...DB2 will not fail on a UniqueConstraint with a nullable column. It won\u0027t create a UniqueConstraint though, it will create a unique index.\n\nWhat will fail, however, is if there is a foreign key later on that nullable column b/c DB2 enforces that foreign keys are on primary keys or unique constraints, so the unique index won\u0027t work and things fall over. If you don\u0027t have a foreign key on name, then it shouldn\u0027t matter if it\u0027s nullable.\n\nBut if you can avoid it and live with requiring name, then it\u0027s makes things easier later if you want to add an fkey.","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8cfbdc312d3dcd1eb5bbcb899bb1398369dc0f91","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_23d5641b","line":49,"in_reply_to":"9aed3d3a_a3433441","updated":"2016-02-29 19:10:18.000000000","message":"Name needs to be nullable because we\u0027ll have some resource providers that either have no name, or keep their name elsewehere, so I\u0027ll let it go.","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31885606aeb2c1e19134c34e289dbf1936b26e26","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":50,"context_line":"        uc.create()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":53,"context_line":"            utils.add_index(migrate_engine, \u0027resource_providers\u0027,"},{"line_number":54,"context_line":"                            \u0027resource_providers_name_idx\u0027,"},{"line_number":55,"context_line":"                            [\u0027name\u0027])"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if not hasattr(resource_providers.c, \u0027generation\u0027):"},{"line_number":58,"context_line":"        resource_providers.create_column(generation)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_239d64bc","line":55,"range":{"start_line":52,"start_character":8,"end_line":55,"end_character":37},"updated":"2016-02-29 19:06:20.000000000","message":"You might want to add a comment here on why you\u0027re doing this (because DB2 automatically creates an index for the unique constraint so it would fail with a duplicate index here, so skip it).","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3fd96ca72e669f525c58597a243c2d618d80523e","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            conn.execute(name_col_ddl)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        uc \u003d UniqueConstraint(\u0027name\u0027, table\u003dresource_providers,"},{"line_number":48,"context_line":"                              name\u003d\u0027uniq_resource_providers0name\u0027)"},{"line_number":49,"context_line":"        uc.create()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        # DB2 automatically creates an index for the unique"}],"source_content_type":"text/x-python","patch_set":23,"id":"9aed3d3a_acb4c134","line":48,"updated":"2016-02-29 20:02:05.000000000","message":"like I said in PS22, I\u0027m fine with adding an UC on something external, but maybe in the next changes, we should make sure that if we have a duplicate error, we should provide a better API return than a 500, right?","commit_id":"39282a9bfa612853c1095e98597035fc977af6d4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b25e60b606e4131b3a5840eb47c4bd7640248039","unresolved":false,"context_lines":[{"line_number":73,"context_line":"          resource_provider_aggregates.c.aggregate_id)"},{"line_number":74,"context_line":"    resource_provider_aggregates.create(checkfirst\u003dTrue)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":77,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":78,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":79,"context_line":"                     \u0027used\u0027])"},{"line_number":80,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":81,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba0121b8_899cfe6a","line":79,"range":{"start_line":76,"start_character":4,"end_line":79,"end_character":29},"updated":"2016-03-28 20:20:54.000000000","message":"Hmm, this isn\u0027t idempotent. If an index already exists with these columns then this is going to fail.","commit_id":"3b2adde944a06a421e7b54595cd2d02698608878"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2d68eacc736e0e0545ba792b5869682f74c5978","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":77,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":78,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":79,"context_line":"                     \u0027used\u0027])"},{"line_number":80,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":81,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba0121b8_b0b017f6","line":79,"in_reply_to":"ba0121b8_70bf9fd0","updated":"2016-03-29 15:02:02.000000000","message":"This rule is more about backports, e.g. you add an index in release N and backport that migration to release N-1. Someone upgrading from N-2 to N-1 gets the new index, but when going from N-1 to N will fail since the index already exists.\n\nThis won\u0027t be a problem here since we\u0027re not backporting this, but that\u0027s where the rule comes from (I believe anyway).","commit_id":"3b2adde944a06a421e7b54595cd2d02698608878"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d2ed793c42f36057fc835a7f4276a1e5e3d3e46e","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":77,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":78,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":79,"context_line":"                     \u0027used\u0027])"},{"line_number":80,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":81,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba0121b8_cfdd3a72","line":79,"in_reply_to":"ba0121b8_899cfe6a","updated":"2016-03-29 11:42:28.000000000","message":"This inconsistency shows up in a few migrations if I recall correctly. I had concluded that it was now considered okay: If you modify the db yourself or you run migrations more than once you\u0027ve broken the rules and have bigger problems.\n\nDo we need a test that runs migrations twice so we can blow things up when not idempotent or do we need to decide it doesn\u0027t matter?","commit_id":"3b2adde944a06a421e7b54595cd2d02698608878"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ee3a5bd9f4302114d2628e839ef2202a212bb5b9","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    utils.add_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":77,"context_line":"                    \u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":78,"context_line":"                    [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"},{"line_number":79,"context_line":"                     \u0027used\u0027])"},{"line_number":80,"context_line":"    utils.drop_index(migrate_engine, \u0027allocations\u0027,"},{"line_number":81,"context_line":"                     \u0027allocations_resource_provider_class_id_idx\u0027)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba0121b8_70bf9fd0","line":79,"in_reply_to":"ba0121b8_cfdd3a72","updated":"2016-03-29 15:00:26.000000000","message":"I\u0027m just pointing out what we\u0027ve always considered a rule for upgrades, see the third bullet here:\n\nhttp://docs.openstack.org/developer/nova/upgrade.html#migration-policy","commit_id":"3b2adde944a06a421e7b54595cd2d02698608878"}],"nova/db/sqlalchemy/models.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cec9fdc050e8aa5aefcf92c1f4029590584d93aa","unresolved":false,"context_lines":[{"line_number":1455,"context_line":""},{"line_number":1456,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":1457,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1458,"context_line":"    name \u003d Column(Unicode(200), nullable\u003dTrue)"},{"line_number":1459,"context_line":"    generation \u003d Column(Integer, default\u003d0)"},{"line_number":1460,"context_line":"    can_host \u003d Column(Integer, default\u003d0)"},{"line_number":1461,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bae84128_13ff2c68","line":1458,"updated":"2016-02-21 20:01:45.000000000","message":"I\u0027m unclear on how to ensure this column is charset utf8 when we have already declared the table latin1. I know what to do if we were talking to mysql directly, but not so much when in sqlalchemy.","commit_id":"1ba6d012738e7a57afeb1d5ced57c12dd65eb777"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"67cfe2b6e3c6c57a2c42541fa2622daa50326bbb","unresolved":false,"context_lines":[{"line_number":1456,"context_line":""},{"line_number":1457,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":1458,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1459,"context_line":"    name \u003d Column(Unicode(200), nullable\u003dTrue)"},{"line_number":1460,"context_line":"    generation \u003d Column(Integer, default\u003d0)"},{"line_number":1461,"context_line":"    can_host \u003d Column(Integer, default\u003d0)"},{"line_number":1462,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bae84128_e58e0ccf","line":1459,"updated":"2016-02-22 22:14:51.000000000","message":"Not clear how to make this column be charset utf8 in a table that has already been declared how to be latin1.","commit_id":"dad7570f94a9f108767fdfdfa62b35a556cc21a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0d69bd1dd6309b013c497dfc4f785280f48d49c6","unresolved":false,"context_lines":[{"line_number":1456,"context_line":""},{"line_number":1457,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":1458,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1459,"context_line":"    name \u003d Column(Unicode(200), nullable\u003dTrue)"},{"line_number":1460,"context_line":"    generation \u003d Column(Integer, default\u003d0)"},{"line_number":1461,"context_line":"    can_host \u003d Column(Integer, default\u003d0)"},{"line_number":1462,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_41d4e2bb","line":1459,"updated":"2016-02-23 15:52:02.000000000","message":"Unfortunately, there\u0027s no way I can tell how to inspect the *column\u0027s* character set in MySQL through SQLAlchemy :(","commit_id":"aee3dcac50795e618f4815e597e24e6e48149169"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b5d1f5b1697524f3254937794df98f0c56b879d6","unresolved":false,"context_lines":[{"line_number":1459,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1460,"context_line":"    name \u003d Column(Unicode(200), nullable\u003dTrue)"},{"line_number":1461,"context_line":"    generation \u003d Column(Integer, default\u003d0)"},{"line_number":1462,"context_line":"    can_host \u003d Column(Integer, default\u003d0)"},{"line_number":1463,"context_line":""},{"line_number":1464,"context_line":""},{"line_number":1465,"context_line":"class Inventory(BASE, models.ModelBase):"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_cd0e6c8b","line":1462,"updated":"2016-02-29 17:28:39.000000000","message":"is this not boolean? I have a feeling I am missing what generation and can_host give us. Is that written up in a spec I have not read yet?","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ab8ca632084b61d570e0814f902818e58b93ab40","unresolved":false,"context_lines":[{"line_number":1459,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1460,"context_line":"    name \u003d Column(Unicode(200), nullable\u003dTrue)"},{"line_number":1461,"context_line":"    generation \u003d Column(Integer, default\u003d0)"},{"line_number":1462,"context_line":"    can_host \u003d Column(Integer, default\u003d0)"},{"line_number":1463,"context_line":""},{"line_number":1464,"context_line":""},{"line_number":1465,"context_line":"class Inventory(BASE, models.ModelBase):"}],"source_content_type":"text/x-python","patch_set":22,"id":"9aed3d3a_089de209","line":1462,"in_reply_to":"9aed3d3a_cd0e6c8b","updated":"2016-02-29 17:47:37.000000000","message":"OK, I see the spec now, makes more sense.","commit_id":"bbe7ce64ea14bc7be1ddf9636eb88c9425c33dff"}]}
