)]}'
{"doc/source/upgrade.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506ca06bb7e18ba53e5964cbc7ad8616941fdee8","unresolved":false,"context_lines":[{"line_number":70,"context_line":"to ease upgrades:"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"* Additive schema migrations - In general, almost all schema migrations should"},{"line_number":73,"context_line":"  be additive.  Put simply, they should only create elements like columns,"},{"line_number":74,"context_line":"  indices, and tables."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"* Subtractive schema migrations - To remove an element like a column or table"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_1da3b301","line":73,"updated":"2015-08-28 18:25:02.000000000","message":"Might also want to note that the migration should be idempotent, especially in the case of adding a column or index - we should always check if they already exist in the schema before creating them in the migration.  I don\u0027t think that\u0027s documented anywhere but it\u0027s a rule.","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"aee4c60915962cc0c81fbbd5520d09685256c848","unresolved":false,"context_lines":[{"line_number":70,"context_line":"to ease upgrades:"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"* Additive schema migrations - In general, almost all schema migrations should"},{"line_number":73,"context_line":"  be additive.  Put simply, they should only create elements like columns,"},{"line_number":74,"context_line":"  indices, and tables."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"* Subtractive schema migrations - To remove an element like a column or table"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_7e06651e","line":73,"in_reply_to":"da20952f_1da3b301","updated":"2015-08-28 19:49:02.000000000","message":"Done","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506ca06bb7e18ba53e5964cbc7ad8616941fdee8","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"* Additive schema migrations - In general, almost all schema migrations should"},{"line_number":73,"context_line":"  be additive.  Put simply, they should only create elements like columns,"},{"line_number":74,"context_line":"  indices, and tables."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"* Subtractive schema migrations - To remove an element like a column or table"},{"line_number":77,"context_line":"  during the N release cycle:"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_9d3263f1","line":74,"updated":"2015-08-28 18:25:02.000000000","message":"You might want to mention something about constraints (foreign keys and unique constraints).\n\nParticularly in the case of UniqueConstraints, we have to be careful about adding those in a migration which doesn\u0027t first clean up duplicate records so that when we add the UC it fails in the migration, see:\n\nhttps://review.openstack.org/#/c/212908/","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"aee4c60915962cc0c81fbbd5520d09685256c848","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"* Additive schema migrations - In general, almost all schema migrations should"},{"line_number":73,"context_line":"  be additive.  Put simply, they should only create elements like columns,"},{"line_number":74,"context_line":"  indices, and tables."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"* Subtractive schema migrations - To remove an element like a column or table"},{"line_number":77,"context_line":"  during the N release cycle:"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_1ec889a7","line":74,"in_reply_to":"da20952f_9d3263f1","updated":"2015-08-28 19:49:02.000000000","message":"Done","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506ca06bb7e18ba53e5964cbc7ad8616941fdee8","unresolved":false,"context_lines":[{"line_number":80,"context_line":"     (This allows for graceful upgrade from N to N+1.)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"  #. The column can then be removed with a migration at the start of N+2."},{"line_number":86,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_7d3e6f8d","line":83,"updated":"2015-08-28 18:25:02.000000000","message":"It could be helpful to link to http://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/flavor-from-sysmeta-to-blob.html as a reference for how this is done.","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"aee4c60915962cc0c81fbbd5520d09685256c848","unresolved":false,"context_lines":[{"line_number":80,"context_line":"     (This allows for graceful upgrade from N to N+1.)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"  #. The column can then be removed with a migration at the start of N+2."},{"line_number":86,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_3e29cd37","line":83,"in_reply_to":"da20952f_7d3e6f8d","updated":"2015-08-28 19:49:02.000000000","message":"Done","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506ca06bb7e18ba53e5964cbc7ad8616941fdee8","unresolved":false,"context_lines":[{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"  #. The column can then be removed with a migration at the start of N+2."},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"* Data migrations - As mentioned above, data migrations will be done in an"},{"line_number":88,"context_line":"  online fashion by custom code in the object layer that handles moving data"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_7d33cfab","line":85,"updated":"2015-08-28 18:25:02.000000000","message":"Refer to bf8b3946e6964059dce581f54ed4f928e2cdf5ab as an example since it would build nicely on the example in step 2.","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"aee4c60915962cc0c81fbbd5520d09685256c848","unresolved":false,"context_lines":[{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"  #. The column can then be removed with a migration at the start of N+2."},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"* Data migrations - As mentioned above, data migrations will be done in an"},{"line_number":88,"context_line":"  online fashion by custom code in the object layer that handles moving data"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_1ea96990","line":85,"in_reply_to":"da20952f_7d33cfab","updated":"2015-08-28 19:49:02.000000000","message":"Done","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506ca06bb7e18ba53e5964cbc7ad8616941fdee8","unresolved":false,"context_lines":[{"line_number":88,"context_line":"  online fashion by custom code in the object layer that handles moving data"},{"line_number":89,"context_line":"  between the old and new portions of the schema.  In addition, for each type"},{"line_number":90,"context_line":"  of data migration performed, there should exist a nova-manage option for an"},{"line_number":91,"context_line":"  operator to manually request that rows be migrated."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"*Future* work -"},{"line_number":94,"context_line":"   #. Adding plumbing to enforce that relevant data migrations are completed"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_5dd5ab19","line":91,"updated":"2015-08-28 18:25:02.000000000","message":"If you refer to the blueprint above for flavor sys_meta migrations, that would also cover this as a nice example.","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9acb56676d6c4f43bc1cc2113c0bd4157856f6f4","unresolved":false,"context_lines":[{"line_number":93,"context_line":"*Future* work -"},{"line_number":94,"context_line":"   #. Adding plumbing to enforce that relevant data migrations are completed"},{"line_number":95,"context_line":"      before running `contract` in the expand/migrate/contract schema migration"},{"line_number":96,"context_line":"      workflow."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"Concepts"},{"line_number":99,"context_line":"--------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"da20952f_ccccaf6c","line":96,"updated":"2015-08-28 17:20:57.000000000","message":"Note that we did this in the \"legacy\" migration path here:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/291_enforce_flavors_migrated.py","commit_id":"23e1444ba9ad40f4bb583da72c554fc7981c3ab1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"40605250035d2fe39e962b4d886fb0f64a6e2062","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":"     "},{"line_number":85,"context_line":"     * `Data migration example"},{"line_number":86,"context_line":"       \u003chttp://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/flavor-from-sysmeta-to-blob.html\u003e`_"},{"line_number":87,"context_line":"     * `Data migration enforcement example"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_2613ff5c","line":84,"updated":"2015-08-28 21:31:00.000000000","message":"whitespace","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7295cc5a53b96e17c48d2c43e2b8ec2b8ac96d88","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"  #. Data migration, by the objects layer, must completely migrate data from"},{"line_number":83,"context_line":"     the old version of the schema to the new version."},{"line_number":84,"context_line":"     "},{"line_number":85,"context_line":"     * `Data migration example"},{"line_number":86,"context_line":"       \u003chttp://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/flavor-from-sysmeta-to-blob.html\u003e`_"},{"line_number":87,"context_line":"     * `Data migration enforcement example"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_3de1922d","line":84,"in_reply_to":"da20952f_2613ff5c","updated":"2015-08-31 15:07:46.000000000","message":"Done","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"40605250035d2fe39e962b4d886fb0f64a6e2062","unresolved":false,"context_lines":[{"line_number":95,"context_line":"  it.)  This logic comes for free in the autogenerated workflow of"},{"line_number":96,"context_line":"  the online migrations."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"* Constraints - When adding a foreign or unique key constrain, the schema"},{"line_number":99,"context_line":"  migration code needs to handle possible problems with data before applying"},{"line_number":100,"context_line":"  the constraint. (Example:  A unique constraint must clean up duplicate"},{"line_number":101,"context_line":"  records before applying said constraint.)"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_864f6b6a","line":98,"updated":"2015-08-28 21:31:00.000000000","message":"s/constrain/constraint/","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7295cc5a53b96e17c48d2c43e2b8ec2b8ac96d88","unresolved":false,"context_lines":[{"line_number":95,"context_line":"  it.)  This logic comes for free in the autogenerated workflow of"},{"line_number":96,"context_line":"  the online migrations."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"* Constraints - When adding a foreign or unique key constrain, the schema"},{"line_number":99,"context_line":"  migration code needs to handle possible problems with data before applying"},{"line_number":100,"context_line":"  the constraint. (Example:  A unique constraint must clean up duplicate"},{"line_number":101,"context_line":"  records before applying said constraint.)"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_5ddc8672","line":98,"in_reply_to":"da20952f_864f6b6a","updated":"2015-08-31 15:07:46.000000000","message":"Done","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"40605250035d2fe39e962b4d886fb0f64a6e2062","unresolved":false,"context_lines":[{"line_number":104,"context_line":"  online fashion by custom code in the object layer that handles moving data"},{"line_number":105,"context_line":"  between the old and new portions of the schema.  In addition, for each type"},{"line_number":106,"context_line":"  of data migration performed, there should exist a nova-manage option for an"},{"line_number":107,"context_line":"  operator to manually request that rows be migrated.  "},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"  * See `flavor migration spec"},{"line_number":110,"context_line":"    \u003chttp://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/flavor-from-sysmeta-to-blob.html\u003e`_"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_c61b2372","line":107,"updated":"2015-08-28 21:31:00.000000000","message":"whitespace","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"7295cc5a53b96e17c48d2c43e2b8ec2b8ac96d88","unresolved":false,"context_lines":[{"line_number":104,"context_line":"  online fashion by custom code in the object layer that handles moving data"},{"line_number":105,"context_line":"  between the old and new portions of the schema.  In addition, for each type"},{"line_number":106,"context_line":"  of data migration performed, there should exist a nova-manage option for an"},{"line_number":107,"context_line":"  operator to manually request that rows be migrated.  "},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"  * See `flavor migration spec"},{"line_number":110,"context_line":"    \u003chttp://specs.openstack.org/openstack/nova-specs/specs/kilo/implemented/flavor-from-sysmeta-to-blob.html\u003e`_"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da20952f_1de28e2f","line":107,"in_reply_to":"da20952f_c61b2372","updated":"2015-08-31 15:07:46.000000000","message":"Done","commit_id":"fefc7058f6dd98c174583f49779340e81e5f2a76"}]}
