)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"f60ba3bd2bdd15689c866eecf82de335a21126f9","unresolved":false,"context_lines":[{"line_number":17,"context_line":"pxc_strict_mode \u003d\u003d ENFORCING"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: If70e5df5aea008e8998eaad912ba85dfb6bda77a"},{"line_number":20,"context_line":"Closes-Bug: story/2005531"},{"line_number":21,"context_line":"Signed-off-by: Sahid Orentino Ferdjaoui \u003csahid.ferdjaoui@canonical.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"dfbec78f_22543bca","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":25},"updated":"2019-05-06 08:13:56.000000000","message":"This should be\nStory: 2005531\nTask: 30658","commit_id":"43aa4308a096c6e4951ec072cee813eac1b57f20"}],"octavia/db/migration/alembic_migrations/versions/392fb85b4419_add_primary_key_to_spares_pool.py":[{"author":{"_account_id":24824,"name":"Dmitrii Shcherbakov","username":"dmitriis"},"change_message_id":"94ad9a12deea80d24660e54108dec52e3ab50bb5","unresolved":false,"context_lines":[{"line_number":15,"context_line":"\"\"\"add primary key to spares_pool"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Revision ID: 392fb85b4419"},{"line_number":18,"context_line":"Revises: 46d914b2a5e5"},{"line_number":19,"context_line":"Create Date: 2019-04-30 09:58:54.159823"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"ffb9cba7_eba685ab","line":18,"range":{"start_line":18,"start_character":9,"end_line":18,"end_character":21},"updated":"2019-04-30 10:11:48.000000000","message":"The referenced migration 46d914b2a5e5 does an insert besides just creating the spares_pool table. The original error message is about that insert from the migration code:\n\n\"... prohibits use of DML command on a table (octavia.spares_pool) without an explicit primary key with pxc_strict_mode \u003d ENFORCING or MASTER\u0027) [SQL: \u0027INSERT INTO spares_pool (updated_at) VALUES (%(updated_at)s)\u0027] ...\"\n\nhttps://github.com/openstack/octavia/blob/stable/stein/octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py#L34-L47\n\n    op.bulk_insert(\n        insert_table,\n        [\n            {\u0027updated_at\u0027: datetime.datetime.now()}\n        ]\n    )\n\nUnless I do not see something, the first migration will still fail so we have to modify 46d914b2a5e5 directly instead.","commit_id":"cccef39b1bd750bb8cdd18934bce5ba1af79b457"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"5b29cd1f918d21834c6534618dfe5b11f7b3a310","unresolved":false,"context_lines":[{"line_number":15,"context_line":"\"\"\"add primary key to spares_pool"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Revision ID: 392fb85b4419"},{"line_number":18,"context_line":"Revises: 46d914b2a5e5"},{"line_number":19,"context_line":"Create Date: 2019-04-30 09:58:54.159823"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"ffb9cba7_5db998c9","line":18,"range":{"start_line":18,"start_character":9,"end_line":18,"end_character":21},"in_reply_to":"ffb9cba7_eba685ab","updated":"2019-04-30 12:15:16.000000000","message":"Yes good catch, at the same time we also need to handle already deployed environment with Stein.\n\nSo we probably have to update the migration script that you have referenced and keep that one but before any update ensure that the primary_key does not already exist.\n\nSounds good?","commit_id":"cccef39b1bd750bb8cdd18934bce5ba1af79b457"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"df51562b7d69858c513315d3e3630f059f3d9f2d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        op.create_primary_key("},{"line_number":37,"context_line":"            u\u0027pk_spares_pool\u0027, u\u0027spares_pool\u0027, [u\u0027updated_at\u0027])"},{"line_number":38,"context_line":"    except Exception:"},{"line_number":39,"context_line":"        # Revision \u002746d914b2a5e5\u0027 has been updated to create the"},{"line_number":40,"context_line":"        # missing PK. Depending whether the env is already deployed or"},{"line_number":41,"context_line":"        # not we may or not have to add the primary key."}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_8bc32d57","line":38,"range":{"start_line":38,"start_character":4,"end_line":38,"end_character":20},"updated":"2019-05-02 09:42:46.000000000","message":"I\u0027m not really happy about this. I would be happy to address any suggestions.  Basically there is that \u0027get_pk_constraint\u0027 function but we need to load the engine.","commit_id":"43aa4308a096c6e4951ec072cee813eac1b57f20"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f10f3fe36a7c0ec255d23085ee1fc83c7cb7c98d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        op.create_primary_key("},{"line_number":37,"context_line":"            u\u0027pk_spares_pool\u0027, u\u0027spares_pool\u0027, [u\u0027updated_at\u0027])"},{"line_number":38,"context_line":"    except Exception:"},{"line_number":39,"context_line":"        # Revision \u002746d914b2a5e5\u0027 has been updated to create the"},{"line_number":40,"context_line":"        # missing PK. Depending whether the env is already deployed or"},{"line_number":41,"context_line":"        # not we may or not have to add the primary key."}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_f86494bb","line":38,"range":{"start_line":38,"start_character":4,"end_line":38,"end_character":20},"in_reply_to":"dfbec78f_c20d1f38","updated":"2019-05-06 10:42:12.000000000","message":"Thanks for this Ann. I updated the change according to your suggestion.","commit_id":"43aa4308a096c6e4951ec072cee813eac1b57f20"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"db88f52d86e3c929b4f27a5e7a884158ecb0d42e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    try:"},{"line_number":36,"context_line":"        op.create_primary_key("},{"line_number":37,"context_line":"            u\u0027pk_spares_pool\u0027, u\u0027spares_pool\u0027, [u\u0027updated_at\u0027])"},{"line_number":38,"context_line":"    except Exception:"},{"line_number":39,"context_line":"        # Revision \u002746d914b2a5e5\u0027 has been updated to create the"},{"line_number":40,"context_line":"        # missing PK. Depending whether the env is already deployed or"},{"line_number":41,"context_line":"        # not we may or not have to add the primary key."}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_c20d1f38","line":38,"range":{"start_line":38,"start_character":4,"end_line":38,"end_character":20},"in_reply_to":"ffb9cba7_8bc32d57","updated":"2019-05-06 07:50:00.000000000","message":"Usage get_pk_contraint and inspector is correct - we used such things in neutron db migrations. This should look like:\n\n   bind \u003d op.get_bind()\n   engine \u003d bind.engine\n   # passing just bind is also possible\n   inspector \u003d reflection.Inspector.from_engine(engine)\n   pk \u003d inspector.get_pk_constraint(\u0027spares_pool\u0027) \n   if not pk[\u0027constrained_columns\u0027]:\n        op.create_primary_key(op.f(\u0027pk_spares_pool\u0027),...)","commit_id":"43aa4308a096c6e4951ec072cee813eac1b57f20"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"598f3d0e23b12a88bb05681cd72419f4dd6a19c2","unresolved":false,"context_lines":[{"line_number":24,"context_line":"revision \u003d \u0027392fb85b4419\u0027"},{"line_number":25,"context_line":"down_revision \u003d \u002746d914b2a5e5\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from alembic import op"},{"line_number":28,"context_line":"from sqlalchemy.engine import reflection"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"from oslo_log import log as logging"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dfbec78f_ac3e30b5","line":30,"range":{"start_line":27,"start_character":0,"end_line":30,"end_character":35},"updated":"2019-05-16 12:42:13.000000000","message":"Interesting the haking rules seem to be different in gate.\n\nhttp://logs.openstack.org/59/656459/6/check/openstack-tox-pep8/0ef27d0/job-output.txt.gz","commit_id":"bd15999fca68c3aedae0de7d13fd0559fcba1f2c"}],"octavia/db/migration/alembic_migrations/versions/46d914b2a5e5_seed_the_spares_pool_table.py":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"9e3f09cd5c1205f3fd650ec0fbd67ffab7c025b4","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    # Create temporary table for table data seeding"},{"line_number":36,"context_line":"    insert_table \u003d sa.table("},{"line_number":37,"context_line":"        u\u0027spares_pool\u0027,"},{"line_number":38,"context_line":"        sa.column(u\u0027updated_at\u0027, sa.DateTime, primary_key\u003dTrue),"},{"line_number":39,"context_line":"    )"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    # Note: The date/time doesn\u0027t matter, we just need to seed the table."}],"source_content_type":"text/x-python","patch_set":4,"id":"dfbec78f_c81e950b","line":38,"updated":"2019-05-06 21:46:35.000000000","message":"This is a temp table and would not change the properties of the main \"spares_pool\" table.\nI think you have to change it here: https://review.opendev.org/#/c/642602/3/octavia/db/migration/alembic_migrations/versions/6ffc710674ef_spares_pool_table.py","commit_id":"d0da71ce8bba72706a3f96e04b9c5b7df1ca19fd"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f25a63380d0fce78bf5b1e7d7d91f2e916429d92","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    # Create temporary table for table data seeding"},{"line_number":36,"context_line":"    insert_table \u003d sa.table("},{"line_number":37,"context_line":"        u\u0027spares_pool\u0027,"},{"line_number":38,"context_line":"        sa.column(u\u0027updated_at\u0027, sa.DateTime, primary_key\u003dTrue),"},{"line_number":39,"context_line":"    )"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    # Note: The date/time doesn\u0027t matter, we just need to seed the table."}],"source_content_type":"text/x-python","patch_set":4,"id":"dfbec78f_d57dcd6e","line":38,"in_reply_to":"dfbec78f_c81e950b","updated":"2019-05-07 06:43:10.000000000","message":"Thanks Michael, good call.","commit_id":"d0da71ce8bba72706a3f96e04b9c5b7df1ca19fd"}]}
