)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":18,"context_line":"1. The initial havana migration does not create any foreign keys which"},{"line_number":19,"context_line":"   require the instances.uuid column since it\u0027s nullable and DB2 won\u0027t"},{"line_number":20,"context_line":"   allow creating a unique constraint over a nullable column. The lack"},{"line_number":21,"context_line":"   of foreign keys has not presented any functional issues. A possible"},{"line_number":22,"context_line":"   solution is a future patch which makes the instances.uuid column"},{"line_number":23,"context_line":"   non-nullable but that presents it\u0027s own difficulties and is outside"},{"line_number":24,"context_line":"   the scope of this change."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"AAAAVn%2F%2Fs5I%3D","line":21,"updated":"2014-03-04 15:54:21.000000000","message":"This is not true, by not having security_group_instance_association_instance_uuid_fkey security groups aren\u0027t deleted via cascading delete so tempest tests like test_server_security_groups fail.  We\u0027re going to have to handle making the instance.uuid column non-nullable in a new migration and then add the missing FKs in for DB2.\n\nThe plan would be to find all instance records where uuid is None and move those into a backup table, then make the column non-nullable.  Then add another migration after that which creates the unique constraint in the DB2 case and creates the missing FKs from the initial migration.\n\nOn downgrade we\u0027d move the instance.uuid\u003d\u003dNone records from the backup table back into the instances table and drop the backup table.\n\nI think Heat has a migration that is similar to this:\n\nhttps://github.com/openstack/heat/blob/master/heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py","commit_id":"1c8b1caff7964d329a21ffd19f181fbb3713763b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":18,"context_line":"1. The initial havana migration does not create any foreign keys which"},{"line_number":19,"context_line":"   require the instances.uuid column since it\u0027s nullable and DB2 won\u0027t"},{"line_number":20,"context_line":"   allow creating a unique constraint over a nullable column. The lack"},{"line_number":21,"context_line":"   of foreign keys has not presented any functional issues. A possible"},{"line_number":22,"context_line":"   solution is a future patch which makes the instances.uuid column"},{"line_number":23,"context_line":"   non-nullable but that presents it\u0027s own difficulties and is outside"},{"line_number":24,"context_line":"   the scope of this change."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"AAAAVn%2F%2FsxI%3D","line":21,"in_reply_to":"AAAAVn%2F%2Fs5I%3D","updated":"2014-03-04 16:04:28.000000000","message":"ndipanov pointed this out as something similar in nova that was done earlier: https://review.openstack.org/#/c/66633/","commit_id":"1c8b1caff7964d329a21ffd19f181fbb3713763b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"Other changes:"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"1. Handle the \u0027ibm_db_sa\u0027 sqlalchemy engine in the modify_indexes"},{"line_number":38,"context_line":"   utility method."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"2. Sync commit 8dccc7b \"Handle ibm_db_sa DBDuplicateEntry integrity"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"AAAAVn%2F%2FGsA%3D","line":37,"updated":"2014-03-09 17:47:08.000000000","message":"This isn\u0027t needed after change Iefa5b431.","commit_id":"1c8b1caff7964d329a21ffd19f181fbb3713763b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"1. Handle the \u0027ibm_db_sa\u0027 sqlalchemy engine in the modify_indexes"},{"line_number":38,"context_line":"   utility method."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"2. Sync commit 8dccc7b \"Handle ibm_db_sa DBDuplicateEntry integrity"},{"line_number":41,"context_line":"   errors\" from oslo-incubator. This is needed for 3rd party CI to pass"},{"line_number":42,"context_line":"   for DB2 against Tempest negative tests that rely on duplicate entries"},{"line_number":43,"context_line":"   failing and being handled in the DB API layer. This is not a full"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"AAAAVn%2F%2FsGY%3D","line":40,"updated":"2014-03-04 17:01:08.000000000","message":"Drop this in favor of https://review.openstack.org/#/c/75922/ which does the session.py sync.","commit_id":"1c8b1caff7964d329a21ffd19f181fbb3713763b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3fd17cab5bc9776a5d0f88b2bcec08697bb33aa3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"   making the pci_devices.deleted column nullable\u003dTrue fails since"},{"line_number":29,"context_line":"   the column is in a UniqueConstraint already (DB2 would require"},{"line_number":30,"context_line":"   it to be in a unique index instead for the column to be nullable)."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Implements blueprint db2-database"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Change-Id: Ic4224e2545bcdfeb236b071642f9f16d9ee3b99f"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":37,"id":"3a961159_80d091ca","line":31,"updated":"2015-01-01 23:30:25.000000000","message":"4. The 252 migration needs to be updated as well since it creates a FKey on instances.uuid which at that point isn\u0027t in a UniqueConstraint for DB2:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/migrate_repo/versions/252_add_instance_extra_table.py#n60","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"}],"nova/db/sqlalchemy/migrate_repo/versions/180_havana.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":918,"context_line":"    # if we can handle this situation down in the ibm_db_sa code."},{"line_number":919,"context_line":"    address_column_kwargs \u003d {\u0027unique\u0027: True}"},{"line_number":920,"context_line":"    if migrate_engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":921,"context_line":"        address_column_kwargs[\u0027nullable\u0027] \u003d False"},{"line_number":922,"context_line":""},{"line_number":923,"context_line":"    virtual_interfaces \u003d Table(\u0027virtual_interfaces\u0027, meta,"},{"line_number":924,"context_line":"        Column(\u0027created_at\u0027, DateTime),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BKLI%3D","line":921,"updated":"2014-01-29 15:57:16.000000000","message":"I think we can remove this - if you\u0027re doing a straight install of icehouse with DB2 10.5 you\u0027ll run through this code path and create a unique index over a nullable column.\n\nThe problem is with DB2 the unique constraint is given a non-standard name, so we need to explicitly name it uniq_virtual_interfaces0address in the DB2 case so migration 192 runs OK.","commit_id":"e5348e3b0c7c75b9b19c9cb195d3a7478e4e3964"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        Column(\u0027updated_at\u0027, DateTime),"},{"line_number":427,"context_line":"        Column(\u0027deleted_at\u0027, DateTime),"},{"line_number":428,"context_line":"        Column(\u0027id\u0027, Integer, primary_key\u003dTrue, nullable\u003dFalse),"},{"line_number":429,"context_line":"        Column(\u0027network_info\u0027, MediumText()),"},{"line_number":430,"context_line":"        Column(\u0027instance_uuid\u0027, String(length\u003d36), nullable\u003dFalse,"},{"line_number":431,"context_line":"               unique\u003dTrue),"},{"line_number":432,"context_line":"        Column(\u0027deleted\u0027, Integer),"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BIkY%3D","line":429,"updated":"2014-01-29 20:42:39.000000000","message":"Need to also handle this case for 185 to work.","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        Column(\u0027updated_at\u0027, DateTime),"},{"line_number":427,"context_line":"        Column(\u0027deleted_at\u0027, DateTime),"},{"line_number":428,"context_line":"        Column(\u0027id\u0027, Integer, primary_key\u003dTrue, nullable\u003dFalse),"},{"line_number":429,"context_line":"        Column(\u0027network_info\u0027, MediumText()),"},{"line_number":430,"context_line":"        Column(\u0027instance_uuid\u0027, String(length\u003d36), nullable\u003dFalse,"},{"line_number":431,"context_line":"               unique\u003dTrue),"},{"line_number":432,"context_line":"        Column(\u0027deleted\u0027, Integer),"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BIYM%3D","line":429,"in_reply_to":"AAAAUH%2F%2BIkY%3D","updated":"2014-01-29 21:20:35.000000000","message":"Done","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":1136,"context_line":""},{"line_number":1137,"context_line":"    # virtual_interfaces unique constraint"},{"line_number":1138,"context_line":"    UniqueConstraint(\u0027address\u0027, table\u003dvirtual_interfaces,"},{"line_number":1139,"context_line":"                     name\u003d\u0027uniq_virtual_interfaces0address\u0027).create()"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    indexes \u003d ["},{"line_number":1142,"context_line":"        # agent_builds"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BIr0%3D","line":1139,"updated":"2014-01-29 20:17:45.000000000","message":"Looks like the 185 script doesn\u0027t like this for mysql:\n\nhttp://64.119.130.115/69047/2/console.log.gz\n\n(OperationalError) (1061, \"Duplicate key name \u0027uniq_virtual_interfaces0address\u0027\") \u0027ALTER TABLE virtual_interfaces ADD CONSTRAINT uniq_virtual_interfaces0address UNIQUE (address)\u0027 ()","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":1136,"context_line":""},{"line_number":1137,"context_line":"    # virtual_interfaces unique constraint"},{"line_number":1138,"context_line":"    UniqueConstraint(\u0027address\u0027, table\u003dvirtual_interfaces,"},{"line_number":1139,"context_line":"                     name\u003d\u0027uniq_virtual_interfaces0address\u0027).create()"},{"line_number":1140,"context_line":""},{"line_number":1141,"context_line":"    indexes \u003d ["},{"line_number":1142,"context_line":"        # agent_builds"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BImY%3D","line":1139,"in_reply_to":"AAAAUH%2F%2BIr0%3D","updated":"2014-01-29 20:42:39.000000000","message":"Done","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ac401dc94fb686d70e1cba18d39ee14456d0b607","unresolved":false,"context_lines":[{"line_number":1162,"context_line":"            name\u003d\u0027uniq_instance_info_caches0instance_uuid\u0027).create()"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"        # virtual_interfaces unique constraint"},{"line_number":1165,"context_line":"        # NOTE(mriedem): Intentionally using the UC name that 185 would create"},{"line_number":1166,"context_line":"        # so that 192 will work as expected."},{"line_number":1167,"context_line":"        UniqueConstraint(\u0027address\u0027, table\u003dvirtual_interfaces,"},{"line_number":1168,"context_line":"                         name\u003d\u0027uniq_virtual_interfaces0address\u0027).create()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BILI%3D","line":1165,"updated":"2014-05-08 18:16:15.000000000","message":"This note is probably not needed.","commit_id":"847a5457ab63d87b62b832af13a0d68731b0d132"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ac401dc94fb686d70e1cba18d39ee14456d0b607","unresolved":false,"context_lines":[{"line_number":1426,"context_line":"                  [[block_device_mapping.c.instance_uuid],"},{"line_number":1427,"context_line":"                      [instances.c.uuid],"},{"line_number":1428,"context_line":"                      \u0027block_device_mapping_instance_uuid_fkey\u0027],"},{"line_number":1429,"context_line":"                  [[consoles.c.instance_uuid],"},{"line_number":1430,"context_line":"                      [instances.c.uuid],"},{"line_number":1431,"context_line":"                      \u0027consoles_instance_uuid_fkey\u0027],"},{"line_number":1432,"context_line":"                  [[instance_info_caches.c.instance_uuid],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BIKY%3D","line":1429,"updated":"2014-05-08 18:16:15.000000000","message":"This isn\u0027t needed anymore.","commit_id":"847a5457ab63d87b62b832af13a0d68731b0d132"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":327,"context_line":"    # constraint on instances.uuid because it\u0027s nullable (so a unique"},{"line_number":328,"context_line":"    # constraint isn\u0027t created for instances.uuid, only a unique index)."},{"line_number":329,"context_line":"    consoles_instance_uuid_column_args \u003d ()"},{"line_number":330,"context_line":"    if migrate_engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":331,"context_line":"        consoles_instance_uuid_column_args \u003d ("},{"line_number":332,"context_line":"            ForeignKey(\u0027instances.uuid\u0027, name\u003d\u0027consoles_instance_uuid_fkey\u0027))"},{"line_number":333,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BH7A%3D","line":330,"updated":"2014-01-29 22:32:14.000000000","message":"Should be !\u003d, d\u0027oh!","commit_id":"721f51b15fbf9dd3e96ca55f0fd5562ef7893c8f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":327,"context_line":"    # constraint on instances.uuid because it\u0027s nullable (so a unique"},{"line_number":328,"context_line":"    # constraint isn\u0027t created for instances.uuid, only a unique index)."},{"line_number":329,"context_line":"    consoles_instance_uuid_column_args \u003d [\u0027instance_uuid\u0027, String(length\u003d36)]"},{"line_number":330,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":331,"context_line":"        consoles_instance_uuid_column_args.append("},{"line_number":332,"context_line":"            ForeignKey(\u0027instances.uuid\u0027, name\u003d\u0027consoles_instance_uuid_fkey\u0027))"},{"line_number":333,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BDzw%3D","line":330,"updated":"2014-01-30 15:32:09.000000000","message":"we still need this for db2","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":424,"context_line":"    # The problem is with DB2 the unique constraint is given a non-standard"},{"line_number":425,"context_line":"    # name, so we need to explicitly name it"},{"line_number":426,"context_line":"    # uniq_instance_info_caches0instance_uuid in the DB2 case."},{"line_number":427,"context_line":"    instance_info_caches_instance_uuid_column_kwargs \u003d {"},{"line_number":428,"context_line":"        \u0027name\u0027: \u0027instance_uuid\u0027,"},{"line_number":429,"context_line":"        \u0027type_\u0027: String(length\u003d36),"},{"line_number":430,"context_line":"        \u0027nullable\u0027: False"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BDz4%3D","line":427,"updated":"2014-01-30 15:32:09.000000000","message":"no longer needed","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":931,"context_line":"    # NOTE(mriedem): We have to do the same thing for the unnamed constraint"},{"line_number":932,"context_line":"    # on virtual_interfaces.address as we did in"},{"line_number":933,"context_line":"    # instance_info_caches.instance_uuid so the 192 script works."},{"line_number":934,"context_line":"    virtual_interfaces_address_column_kwargs \u003d {"},{"line_number":935,"context_line":"        \u0027name\u0027: \u0027address\u0027,"},{"line_number":936,"context_line":"        \u0027type_\u0027: String(length\u003d255)"},{"line_number":937,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD0A%3D","line":934,"updated":"2014-01-30 15:32:09.000000000","message":"no longer needed","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"    if migrate_engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":1159,"context_line":"        # instance_info_caches unique constraint"},{"line_number":1160,"context_line":"        UniqueConstraint(\u0027instance_uuid\u0027, table\u003dinstance_info_caches,"},{"line_number":1161,"context_line":"            name\u003d\u0027uniq_instance_info_caches0instance_uuid\u0027).create()"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        # virtual_interfaces unique constraint"},{"line_number":1164,"context_line":"        UniqueConstraint(\u0027address\u0027, table\u003dvirtual_interfaces,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD0U%3D","line":1161,"updated":"2014-01-30 15:32:09.000000000","message":"No longer needed:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1145","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"            name\u003d\u0027uniq_instance_info_caches0instance_uuid\u0027).create()"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        # virtual_interfaces unique constraint"},{"line_number":1164,"context_line":"        UniqueConstraint(\u0027address\u0027, table\u003dvirtual_interfaces,"},{"line_number":1165,"context_line":"                         name\u003d\u0027uniq_virtual_interfaces0address\u0027).create()"},{"line_number":1166,"context_line":""},{"line_number":1167,"context_line":"    indexes \u003d ["}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD0Q%3D","line":1164,"updated":"2014-01-30 15:32:09.000000000","message":"No longer needed:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1149","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"}],"nova/db/sqlalchemy/migrate_repo/versions/185_rename_unique_constraints.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # {engine: {table_name: (((columns,), old_uc_name), (...))}}"},{"line_number":53,"context_line":"    \"ibm_db_sa\": {"},{"line_number":54,"context_line":"        # NOTE(mriedem): There are no DB2 constraints created for"},{"line_number":55,"context_line":"        # instance_info_caches or virtual_interfaces in the 180 script"},{"line_number":56,"context_line":"        # so nothing special to do here."},{"line_number":57,"context_line":"    },"},{"line_number":58,"context_line":"    \"sqlite\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BIsQ%3D","line":55,"updated":"2014-01-29 20:17:45.000000000","message":"This isn\u0027t true anymore.","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # {engine: {table_name: (((columns,), old_uc_name), (...))}}"},{"line_number":53,"context_line":"    \"ibm_db_sa\": {"},{"line_number":54,"context_line":"        # NOTE(mriedem): There are no DB2 constraints created for"},{"line_number":55,"context_line":"        # instance_info_caches or virtual_interfaces in the 180 script"},{"line_number":56,"context_line":"        # so nothing special to do here."},{"line_number":57,"context_line":"    },"},{"line_number":58,"context_line":"    \"sqlite\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BIXY%3D","line":55,"in_reply_to":"AAAAUH%2F%2BIsQ%3D","updated":"2014-01-29 21:20:35.000000000","message":"Going to use the proper instance_info_caches UC name in 180 so we can just no-op from this in the DB2 case, and use the UC name that would be set here so it can be renamed in 192.","commit_id":"30f62d6ad798efa6c2225c971471c737938c7194"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":50,"context_line":"# some UC names are different for mysql and postgresql"},{"line_number":51,"context_line":"UC_SPEC_DB_DATA \u003d {"},{"line_number":52,"context_line":"    # {engine: {table_name: (((columns,), old_uc_name), (...))}}"},{"line_number":53,"context_line":"    \"ibm_db_sa\": {"},{"line_number":54,"context_line":"        # NOTE(mriedem): We already handled the proper name for the"},{"line_number":55,"context_line":"        # instance_info_caches and virtual_interfaces constraints in the"},{"line_number":56,"context_line":"        # initial havana migration script."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BDzo%3D","line":53,"updated":"2014-01-30 15:32:09.000000000","message":"no longer needed, this is handled in 216 now","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"}],"nova/db/sqlalchemy/migrate_repo/versions/192_change_virtual_interface_uc.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    meta \u003d MetaData(bind\u003dmigrate_engine)"},{"line_number":35,"context_line":"    t \u003d Table(TABLE_NAME, meta, autoload\u003dTrue)"},{"line_number":36,"context_line":"    if migrate_engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        # NOTE(mriedem): When DB2 creates a unique constraint for a single"},{"line_number":38,"context_line":"        # column, a unique index is created but it\u0027s named SQLxxxxx (not the"},{"line_number":39,"context_line":"        # name that\u0027s being used in OLD_UC_NAME). The unique constraint is"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2BKKs%3D","line":36,"updated":"2014-01-29 15:57:16.000000000","message":"We can remove this if we explicitly name the unique constraint over the single address column in the 180 script.","commit_id":"e5348e3b0c7c75b9b19c9cb195d3a7478e4e3964"}],"nova/db/sqlalchemy/migrate_repo/versions/203_make_user_quotas_key_and_value.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                              \u0027project_id\u0027, \u0027deleted\u0027),"},{"line_number":90,"context_line":"                        # TODO(mriedem): might need to pull this out a level"},{"line_number":91,"context_line":"                        Index(\u0027project_user_quotas_user_id_deleted_idx\u0027,"},{"line_number":92,"context_line":"                              \u0027user_id\u0027, \u0027deleted\u0027),"},{"line_number":93,"context_line":"                        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":94,"context_line":"                        mysql_charset\u003d\u0027utf8\u0027,"},{"line_number":95,"context_line":"                        )"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD3o%3D","line":92,"updated":"2014-01-30 15:32:09.000000000","message":"This is now fixed in 216 migration here:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1405","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"}],"nova/db/sqlalchemy/migrate_repo/versions/209_add_missing_foreign_keys.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":57,"context_line":"def upgrade(migrate_engine):"},{"line_number":58,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":59,"context_line":"        return"},{"line_number":60,"context_line":"    # NOTE(mriedem): For DB2 we can only create the compute node-related"},{"line_number":61,"context_line":"    # foreign keys because there is no unique constraint over the instance_uuid"},{"line_number":62,"context_line":"    # column since it\u0027s nullable and DB2 10.5 does not support that. There is"},{"line_number":63,"context_line":"    # a unique index with DB2 but it\u0027s not the same as a unique constraint"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD1Q%3D","line":60,"updated":"2014-01-30 15:32:09.000000000","message":"Looks like maybe this is no longer needed in 216 now?","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":57,"context_line":"def upgrade(migrate_engine):"},{"line_number":58,"context_line":"    if migrate_engine.name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":59,"context_line":"        return"},{"line_number":60,"context_line":"    # NOTE(mriedem): For DB2 we can only create the compute node-related"},{"line_number":61,"context_line":"    # foreign keys because there is no unique constraint over the instance_uuid"},{"line_number":62,"context_line":"    # column since it\u0027s nullable and DB2 10.5 does not support that. There is"},{"line_number":63,"context_line":"    # a unique index with DB2 but it\u0027s not the same as a unique constraint"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BDTw%3D","line":60,"in_reply_to":"AAAAUH%2F%2BD1Q%3D","updated":"2014-01-30 16:49:14.000000000","message":"Right, this is handled in 216 now here:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1511","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"}],"nova/db/sqlalchemy/migrate_repo/versions/210_fix_project_user_quotas_user_id_deleted_index.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def upgrade(migrate_engine):"},{"line_number":37,"context_line":"    # NOTE(mriedem): For DB2 we already fixed this problem in the 203 script"},{"line_number":38,"context_line":"    if migrate_engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":39,"context_line":"        return"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2BD3g%3D","line":37,"updated":"2014-01-30 15:32:09.000000000","message":"This goes away because it\u0027s collapsed and fixed into 216 here:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L1405","commit_id":"b1d9d8204cce9101b849fefb860ed5b74ce0a5a3"}],"nova/db/sqlalchemy/migrate_repo/versions/216_havana.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"274218243505cc7053b4a8b38c704dfb7bace8af","unresolved":false,"context_lines":[{"line_number":1550,"context_line":"                ])"},{"line_number":1551,"context_line":""},{"line_number":1552,"context_line":"    for fkey_pair in fkeys:"},{"line_number":1553,"context_line":"        if migrate_engine.name in (\u0027mysql\u0027, \u0027ibm_db_sa\u0027):"},{"line_number":1554,"context_line":"            # For MySQL and DB2 we name our fkeys explicitly"},{"line_number":1555,"context_line":"            # so they match Havana"},{"line_number":1556,"context_line":"            fkey \u003d ForeignKeyConstraint(columns\u003dfkey_pair[0],"}],"source_content_type":"text/x-python","patch_set":37,"id":"3a961159_6c25b05b","line":1553,"updated":"2014-12-15 22:42:50.000000000","message":"Does DB2 autoname foreign keys like PostgreSQL? If so, it might make more sense to do the same thing PostgreSQL does a few lines below and name them consistently.","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"709a603dba580a7b3644135b1cae2a3f654b3fb3","unresolved":false,"context_lines":[{"line_number":1550,"context_line":"                ])"},{"line_number":1551,"context_line":""},{"line_number":1552,"context_line":"    for fkey_pair in fkeys:"},{"line_number":1553,"context_line":"        if migrate_engine.name in (\u0027mysql\u0027, \u0027ibm_db_sa\u0027):"},{"line_number":1554,"context_line":"            # For MySQL and DB2 we name our fkeys explicitly"},{"line_number":1555,"context_line":"            # so they match Havana"},{"line_number":1556,"context_line":"            fkey \u003d ForeignKeyConstraint(columns\u003dfkey_pair[0],"}],"source_content_type":"text/x-python","patch_set":37,"id":"3a961159_98a932e2","line":1553,"in_reply_to":"3a961159_6c25b05b","updated":"2014-12-16 01:44:31.000000000","message":"DB2 will give a name but it\u0027s like SQLxyz where xyz is some random integer, so if you need to get that foreign key later by name in a migration it\u0027s a pain (you\u0027d have to look it up by columns I guess, like an index), so I\u0027d rather just name them explicitly.\n\nThe ibm-db-sa module might provide a name too, but I\u0027d rather no rely on external libraries for naming things for us.","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"}],"nova/db/sqlalchemy/migrate_repo/versions/245_instance_uuid_non_nullable.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def downgrade(migrate_engine):"},{"line_number":63,"context_line":"    # drop the unique constraint on instances.uuid"},{"line_number":64,"context_line":"    utils.drop_unique_constraint(migrate_engine, \u0027instances\u0027, UC_NAME, \u0027uuid\u0027)"},{"line_number":65,"context_line":"    # We can\u0027t bring the deleted records back but we can make uuid nullable."},{"line_number":66,"context_line":"    for table_name in (\u0027instances\u0027, \u0027shadow_instances\u0027):"},{"line_number":67,"context_line":"        table \u003d utils.get_table(migrate_engine, table_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAW3%2F%2FhPk%3D","line":64,"updated":"2014-04-14 01:21:19.000000000","message":"Huh, apparently this doesn\u0027t work the same between oslo db utils and nova db utils...","commit_id":"41f370b160cbf57ffd5b1d9c464c0e35f08653d1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8bcf75cf9bcf1d5001a1eb8091618881dbaf0c0f","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"# NOTE(mriedem): We have to monkey patch the sqlite unique constraint dropper"},{"line_number":23,"context_line":"# class in sqlalchemy-migrate to make the unit tests work."},{"line_number":24,"context_line":"migration.patch_migrate()"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ae5cdf2_d4b12790","line":24,"updated":"2014-06-04 20:53:12.000000000","message":"Shouldn\u0027t be needed anymore now that we\u0027re using sqlalchemy-migrate-0.9.1.","commit_id":"0fea3706f39ec779a8bf47dd4547e4e5e65112eb"}],"nova/db/sqlalchemy/migrate_repo/versions/246_add_missing_db2_fkeys.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        # instances.uuid this works now because the 245 migration script made"},{"line_number":99,"context_line":"        # instances.uuid non-nullable."},{"line_number":100,"context_line":"        instances \u003d utils.get_table(migrate_engine, \u0027instances\u0027)"},{"line_number":101,"context_line":"        UniqueConstraint(\u0027uuid\u0027, table\u003dinstances, name\u003dUC_NAME).create()"},{"line_number":102,"context_line":"        # create the foreign keys"},{"line_number":103,"context_line":"        _process_db2_foreign_keys(migrate_engine, upgrade\u003dTrue)"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAW3%2F%2Fjb0%3D","line":101,"updated":"2014-04-12 20:21:27.000000000","message":"This should probably happen in the 245 migration so that all engines are running with a unique constraint on the instances.uuid column if we\u0027re going to make it non-nullable for all engines (and drop records where instances.uuid \u003d\u003d None).","commit_id":"08236dcbd0d03048a6ec8c804b0bc9ef84ed854b"}],"nova/db/sqlalchemy/migrate_repo/versions/247_nullable_mismatch.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d4900da981e24611fd5283b244280bc0d9231f6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    quota_usages.c.resource.alter(nullable\u003dFalse)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    pci_devices \u003d Table(\u0027pci_devices\u0027, meta, autoload\u003dTrue)"},{"line_number":27,"context_line":"    # NOTE(mriedem): The deleted column is in a UniqueConstraint so making"},{"line_number":28,"context_line":"    # it nullable breaks DB2 with an SQL0542N error, so skip for DB2."},{"line_number":29,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":30,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":37,"id":"3a961159_acf798d3","line":27,"updated":"2014-12-15 22:37:56.000000000","message":"Hmm, so methinks....if DB2, drop the unique constraint, make the column nullable\u003dTrue, then create the UC which for DB2 will create a unique index.  I\u0027d have to see if there are any foreign keys on this column because if so those would be problematic and have to go into the 269 migration.","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"85a096b1380ff952164aaef528c8f90ee87eea0c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a961159_dbc923ac","line":35,"updated":"2015-01-16 17:56:48.000000000","message":"Added with commit 0e98f5a522c08b17c98ed108459a179d14eacd4a.\n\nLooks like it\u0027s just making the schema align with the model:\n\nWhich I guess makes deleted nullable...\n\nhttp://git.openstack.org/cgit/openstack/oslo.db/tree/oslo_db/sqlalchemy/models.py#n122","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"4135bee50942836d1281454d77b2e686bc1d2f12","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"1a930d6b_44f73959","line":35,"in_reply_to":"1a930d6b_0b98e7be","updated":"2015-01-26 21:01:49.000000000","message":"I\u0027m not sure I like all of the pain in that long term solution, but I think the short term solution is probably the only reasonable one.\n\nI think we could probably make the model side of the hack fairly self contained by processing the resulting model and patching the deleted column in every table. Obviously this would only be for DB2. An alternative could be to do this only for pci_devices to limit the changes to the existing sqlalchemy-migrate migrations just for DB2.\n\nFor the long term, we could either try to accelerate the soft-delete changes which would hopefully drop the deleted column everywhere, or try to figure out a way to make the process fixing the deleted column in existing databases less painful.\n\nWe might not need to decide on a long term solution right now.","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"852bd4b5f66f6ece184ee358a41a413f2027410b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a961159_1babab1e","line":35,"in_reply_to":"3a961159_1b9e4b54","updated":"2015-01-16 18:16:47.000000000","message":"We can\u0027t really drop the deleted column from the unique constraint. Then soft deletes will cause problems.\n\nUltimately I think the problem is letting deleted by null. It doesn\u0027t make sense.\n\nHowever, fixing it is going to be very painful. There needs to be oslo.db changes and Nova changes. Some of which could be take a long time to run.\n\nIt looks like the choice here is either to let DB2 diverge or to do a lot of work and painful migrations.","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"47de5380313dc07cf4425f87989cfd9c76a9779b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"1a930d6b_0b98e7be","line":35,"in_reply_to":"3a961159_1babab1e","updated":"2015-01-26 17:18:22.000000000","message":"Johannes, I\u0027d think we could have both short and long term solutions:\n\n1. Short-term we diverge this for DB2 and make a note of it in the migration that we need to fix it once the deleted column is non-nullable.\n\n2. Long-term we need to add a new mixin to oslo.db which sets the deleted column to non-nullable and get that into a release of oslo.db, then make a change to nova to start using that mixin which is also going to require the model changes and migrations to use it.  I\u0027m not sure yet how painful that will be, or what will all be involved, i.e. will we need a CLI to sniff out rows where the deleted column is NULL like we did with instances.uuid?  And I\u0027m assuming the migration would require dropping all FKs with a UC that has the deleted column in it since we\u0027ll need to alter tables to make the deleted column nullable\u003dFalse, then recreate the UCs and FKs.","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6d64ea3af7dac766f7127f17cb90dfd536c9def8","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a961159_bbd9b757","line":35,"in_reply_to":"3a961159_bb5457c6","updated":"2015-01-16 18:00:54.000000000","message":"Having deleted in the unique constraint when deleted is nullable kind of voids the point of having deleted in the unique constraint, so maybe my solution is going to have to be to drop the unique constraint and re-create it (for all backends) without the deleted column.","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5ce78384d0554e540d7e2aef7a671e9bc368c48","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a961159_1b9e4b54","line":35,"in_reply_to":"3a961159_bbd9b757","updated":"2015-01-16 18:04:27.000000000","message":"Note that there are a lot of unique constraints in other tables over the deleted column, but apparently they aren\u0027t in foreign key constraints which is what\u0027s causing the issue with DB2.","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"486ea73f3d0183a16b2cbd3eb428753404dc76d8","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    # the unique constraint. Looks like there is a FKey in 246 though...so"},{"line_number":33,"context_line":"    # we\u0027re kind of stuck with DB2 since we can\u0027t create the FKey without the"},{"line_number":34,"context_line":"    # unique constraint and we can\u0027t have a unique constraint on a nullable"},{"line_number":35,"context_line":"    # column...why would the deleted column be nullable\u003dTrue anyway?"},{"line_number":36,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"},{"line_number":37,"context_line":"        pci_devices.c.deleted.alter(nullable\u003dTrue)"},{"line_number":38,"context_line":"    pci_devices.c.product_id.alter(nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a961159_bb5457c6","line":35,"in_reply_to":"3a961159_dbc923ac","updated":"2015-01-16 17:58:14.000000000","message":"And the 216 migration made it nullable\u003dFalse:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#n740","commit_id":"d7b056efc7e29a59549f0754a34e5f1d78e134d3"}],"nova/db/sqlalchemy/migrate_repo/versions/271_sqlite_postgresql_indexes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d18de99dff58ada9426335e17c7bed8ceee59036","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    # the missing indexes in PostgreSQL and SQLite have conflicting names"},{"line_number":53,"context_line":"    # that MySQL allowed."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    # TODO(mriedem): figure out what to do here for DB2"},{"line_number":56,"context_line":"    if migrate_engine.name in (\u0027sqlite\u0027, \u0027postgresql\u0027):"},{"line_number":57,"context_line":"        for table_name, index_name, column_names in INDEXES:"},{"line_number":58,"context_line":"            ensure_index_exists(migrate_engine, table_name, index_name,"}],"source_content_type":"text/x-python","patch_set":39,"id":"fa81d914_74a57503","line":55,"updated":"2015-01-27 22:07:12.000000000","message":"Works fine to add ibm_db_sa to the list with sqlite and pg, tested locally, just need to add it.","commit_id":"729ba47723301b57c8a7fc0b7c32d7d1007f891e"}],"nova/db/sqlalchemy/migrate_repo/versions/273_add_missing_db2_fkeys.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cc8747a754d77d7d1cc49f8711e1f103b9dec2f3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 IBM Corp."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":41,"id":"da86d52c_d5737fe5","line":1,"updated":"2015-01-31 01:48:55.000000000","message":"Needs to be 2015.","commit_id":"fe43b9ea33bb684835b9fd929d41242873f365e0"}],"nova/tests/db/test_migration_utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":607,"context_line":"    def test_change_deleted_column_type_to_boolean(self):"},{"line_number":608,"context_line":"        table_name \u003d \u0027test_change_deleted_column_type_to_boolean\u0027"},{"line_number":609,"context_line":"        expected_types \u003d {\u0027mysql\u0027: mysql.TINYINT,"},{"line_number":610,"context_line":"                          \u0027ibm_db_sa\u0027: SmallInteger}"},{"line_number":611,"context_line":"        for key, engine in self.engines.items():"},{"line_number":612,"context_line":"            meta \u003d MetaData()"},{"line_number":613,"context_line":"            meta.bind \u003d engine"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAXX%2F%2F%2B%2B0%3D","line":610,"updated":"2014-04-24 20:58:09.000000000","message":"This was removed as part of this:\n\nhttps://review.openstack.org/#/c/79070/5/nova/tests/db/test_migration_utils.py\n\nSo I need to move this fix into oslo-incubator.  Opened bug 1312423 to work that.","commit_id":"580cc4dc52fc3895a69b0eb06baa89772b909db4"}],"nova/tests/db/test_migrations.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"156b1c902562db792d53d8bd80d7fc528b397cdc","unresolved":false,"context_lines":[{"line_number":571,"context_line":""},{"line_number":572,"context_line":"    def _test_db2_opportunistically(self):"},{"line_number":573,"context_line":"        # Test DB2 database migration walk"},{"line_number":574,"context_line":"        connect_string \u003d self.test_databases[\u0027ibm_db_sa\u0027]"},{"line_number":575,"context_line":"        if not _have_db2(connect_string):"},{"line_number":576,"context_line":"            self.skipTest(\"DB2 (ibm_db_sa) not available\")"},{"line_number":577,"context_line":"        engine \u003d sqlalchemy.create_engine(connect_string)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F97b4%3D","line":574,"updated":"2014-01-31 23:43:12.000000000","message":"This is going to be a KeyError in community/turbo-hipster CI.","commit_id":"be89c30863703b15e074967116784b6c793a8bae"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"bc47e75d7c0c3cd07aeffc0bba31a2be87f811f0","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                 \"database \u0027%(database)s\u0027.\" %"},{"line_number":324,"context_line":"                 {\u0027schema\u0027: schema, \u0027database\u0027: database})"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"        cmd \u003d (\u0027su - %(user)s -c \"db2 \\\u0027connect to %(database)s\\\u0027; \u0027"},{"line_number":327,"context_line":"               \u0027db2 \\\\\"select create_time from syscat.schemata where \u0027"},{"line_number":328,"context_line":"               \u0027schemaname\u003d\\\u0027%(schema)s\\\u0027\\\\\"\"\u0027 %"},{"line_number":329,"context_line":"               {\u0027user\u0027: user, \u0027database\u0027: database, \u0027schema\u0027: schema.upper()})"}],"source_content_type":"text/x-python","patch_set":22,"id":"7adec928_35799fc8","line":326,"updated":"2014-05-15 14:27:27.000000000","message":"This seems wrong to me. Why does it need to su to another user to connect to the database?","commit_id":"0fea3706f39ec779a8bf47dd4547e4e5e65112eb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"deceb8aa8c777ad56e8dc39e828a7969890a16df","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                 \"database \u0027%(database)s\u0027.\" %"},{"line_number":324,"context_line":"                 {\u0027schema\u0027: schema, \u0027database\u0027: database})"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"        cmd \u003d (\u0027su - %(user)s -c \"db2 \\\u0027connect to %(database)s\\\u0027; \u0027"},{"line_number":327,"context_line":"               \u0027db2 \\\\\"select create_time from syscat.schemata where \u0027"},{"line_number":328,"context_line":"               \u0027schemaname\u003d\\\u0027%(schema)s\\\u0027\\\\\"\"\u0027 %"},{"line_number":329,"context_line":"               {\u0027user\u0027: user, \u0027database\u0027: database, \u0027schema\u0027: schema.upper()})"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ae5cdf2_cb528634","line":326,"in_reply_to":"7adec928_35799fc8","updated":"2014-06-11 20:08:37.000000000","message":"Typically you have to source a db2 profile when connecting to db2, which we aren\u0027t doing here. And the user needs to have the correct permissions to the database when you connect, so sometimes it\u0027s easiest to connect as db2inst1 since that user has access already.  You can have multiple db2 instances installed, so you would source a different db2 profile depending on which one you\u0027re connecting to.\n\nIf you have the db2 profile sourced then you can connect like this:\n\ndb2 CONNECT TO database USER userID USING password\n\nSourcing the db2 profile would be part of the environment setup and that\u0027s something I didn\u0027t do when I was coding/testing this.","commit_id":"0fea3706f39ec779a8bf47dd4547e4e5e65112eb"}],"nova/tests/unit/db/test_migrations.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"274218243505cc7053b4a8b38c704dfb7bace8af","unresolved":false,"context_lines":[{"line_number":566,"context_line":""},{"line_number":567,"context_line":"    def _check_269(self, engine, data):"},{"line_number":568,"context_line":"        if engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":569,"context_line":"            # Make sure the last FK in the list was created."},{"line_number":570,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":571,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027migrations\u0027)"},{"line_number":572,"context_line":"            fkey_names \u003d [fkey[\u0027name\u0027] for fkey in fkeys]"}],"source_content_type":"text/x-python","patch_set":37,"id":"3a961159_ac6b181e","line":569,"updated":"2014-12-15 22:42:50.000000000","message":"Why not the rest?","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"709a603dba580a7b3644135b1cae2a3f654b3fb3","unresolved":false,"context_lines":[{"line_number":566,"context_line":""},{"line_number":567,"context_line":"    def _check_269(self, engine, data):"},{"line_number":568,"context_line":"        if engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":569,"context_line":"            # Make sure the last FK in the list was created."},{"line_number":570,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":571,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027migrations\u0027)"},{"line_number":572,"context_line":"            fkey_names \u003d [fkey[\u0027name\u0027] for fkey in fkeys]"}],"source_content_type":"text/x-python","patch_set":37,"id":"3a961159_787ba67b","line":569,"in_reply_to":"3a961159_ac6b181e","updated":"2014-12-16 01:44:31.000000000","message":"Because I assume if you get to the last one, we\u0027ve processed all of them successfully.","commit_id":"c705cd7d923e3d3b5056fdaa4cbf5809733ab3c5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94ea48e7ae9cbeb8f11e787147b9be5c0f815a22","unresolved":false,"context_lines":[{"line_number":751,"context_line":"                                \u0027virtual_interfaces_uuid_idx\u0027, [\u0027uuid\u0027])"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"    def _check_296(self, engine, data):"},{"line_number":754,"context_line":"        if engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":755,"context_line":"            # Make sure the last FK in the list was created."},{"line_number":756,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":757,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027instance_extra\u0027)"}],"source_content_type":"text/x-python","patch_set":53,"id":"ba3cc151_f8b3e798","line":754,"updated":"2015-07-10 10:12:28.000000000","message":"I guess we don\u0027t need this here, as you are adding foreign keys that we already have else where? But its a Nit.","commit_id":"9a84211729ef30c1b568856a91b82d581b02688b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abbb842751e7dc3fd7e48f90072003ca6b65b3b3","unresolved":false,"context_lines":[{"line_number":751,"context_line":"                                \u0027virtual_interfaces_uuid_idx\u0027, [\u0027uuid\u0027])"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"    def _check_296(self, engine, data):"},{"line_number":754,"context_line":"        if engine.name \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":755,"context_line":"            # Make sure the last FK in the list was created."},{"line_number":756,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":757,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027instance_extra\u0027)"}],"source_content_type":"text/x-python","patch_set":53,"id":"ba3cc151_1c08f12c","line":754,"in_reply_to":"ba3cc151_f8b3e798","updated":"2015-07-10 14:49:29.000000000","message":"Yeah I guess that\u0027s true.","commit_id":"9a84211729ef30c1b568856a91b82d581b02688b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"94ea48e7ae9cbeb8f11e787147b9be5c0f815a22","unresolved":false,"context_lines":[{"line_number":756,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":757,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027instance_extra\u0027)"},{"line_number":758,"context_line":"            fkey_names \u003d [fkey[\u0027name\u0027] for fkey in fkeys]"},{"line_number":759,"context_line":"            self.assertIn(\u0027fk_instance_extra_instance_uuid\u0027, fkey_names)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"class TestNovaMigrationsSQLite(NovaMigrationsCheckers,"}],"source_content_type":"text/x-python","patch_set":53,"id":"ba3cc151_d872a3e3","line":759,"updated":"2015-07-10 10:12:28.000000000","message":"its tempting to loop over DB2_FKEYS I guess?","commit_id":"9a84211729ef30c1b568856a91b82d581b02688b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abbb842751e7dc3fd7e48f90072003ca6b65b3b3","unresolved":false,"context_lines":[{"line_number":756,"context_line":"            inspector \u003d reflection.Inspector.from_engine(engine)"},{"line_number":757,"context_line":"            fkeys \u003d inspector.get_foreign_keys(\u0027instance_extra\u0027)"},{"line_number":758,"context_line":"            fkey_names \u003d [fkey[\u0027name\u0027] for fkey in fkeys]"},{"line_number":759,"context_line":"            self.assertIn(\u0027fk_instance_extra_instance_uuid\u0027, fkey_names)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"class TestNovaMigrationsSQLite(NovaMigrationsCheckers,"}],"source_content_type":"text/x-python","patch_set":53,"id":"ba3cc151_ff389fd6","line":759,"in_reply_to":"ba3cc151_d872a3e3","updated":"2015-07-10 14:49:29.000000000","message":"Hmm, maybe, if we can import the actual migration module in here, I\u0027m not sure if that\u0027s possible or necessary since as pointed out, fk_instance_extra_instance_uuid is the last one in the list so if we don\u0027t get that far we already failed.","commit_id":"9a84211729ef30c1b568856a91b82d581b02688b"}]}
