)]}'
{"tacker/db/migration/alembic_migrations/versions/975e28392888_add_unique_key_vnf_package_vnfd.py":[{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"27a506ba9e688988d2ed5e463a528b249e43a1ee","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_8792364a","line":62,"updated":"2020-09-21 15:08:54.000000000","message":"This \u0027for\u0027 loop will keep on running till all constraints are traversed, even if we are done with deleting required constraint.\nI suggest to add break-out logic from this for loop once we are done with deleting.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":17255,"name":"Toshiaki Takahashi","email":"ts-takahashi@nec.com","username":"takahashi_ts"},"change_message_id":"d1c6f7a8a6a035e2b5da89a80fa4068cc49cfc29","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_bb100651","line":62,"in_reply_to":"9f560f44_5630b355","updated":"2020-09-23 13:06:05.000000000","message":"OK, I added break from for loop once deleting is done.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"da57ae04aeef1bb0b4d50249d3a3be3394853604","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_9cfa77b7","line":62,"in_reply_to":"9f560f44_79f8557b","updated":"2020-09-22 09:36:18.000000000","message":"Just want to make sure that this table has only 1 constraint.\n- we need not to run for loop if we have only 1 constraint.\n- \"if condition\" is not required in case of 1 constraint.\n\nIn case there is possibility that we can more than 1 constraint, then break-out logic is required.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":17255,"name":"Toshiaki Takahashi","email":"ts-takahashi@nec.com","username":"takahashi_ts"},"change_message_id":"4dc244ab9124c85c528349d2a418e0441d4186b3","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_b550330c","line":62,"in_reply_to":"9f560f44_8792364a","updated":"2020-09-22 07:48:55.000000000","message":"Actually, the table \"vnf_package_vnfd\" has only 1 check constraint which I said in commit message.\nSo deleting \u0027all\u0027 and \u0027once\u0027 are both same meaning now.\nWhy do you think adding break-out is better?","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":25701,"name":"Yasufumi Ogawa","email":"yasufum.o@gmail.com","username":"yasufum"},"change_message_id":"25ce87ebad5cb34603fa5180485bc37e976b66a9","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_5630b355","line":62,"in_reply_to":"9f560f44_9cfa77b7","updated":"2020-09-22 17:47:49.000000000","message":"I agree with Sheel to check the number of constraints to avoid such a implicit expectation.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"7975f206981f5d4dc634a12141a7a66d63a1343b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":60,"context_line":"    check_constraints \u003d (reflection.Inspector.from_engine(op.get_bind())"},{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_79f8557b","line":62,"in_reply_to":"9f560f44_b550330c","updated":"2020-09-22 08:58:18.000000000","message":"break-out is only required if we have more than 1 constraint. If it has only 1 constraint, I guess its ok.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"27a506ba9e688988d2ed5e463a528b249e43a1ee","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"},{"line_number":66,"context_line":"                table_name\u003d\u0027vnf_package_vnfd\u0027,"},{"line_number":67,"context_line":"                type_\u003d\"check\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_a7d13a32","line":64,"updated":"2020-09-21 15:08:54.000000000","message":"If this table has more of such constraints, this code will delete all of them, is this right?","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"7975f206981f5d4dc634a12141a7a66d63a1343b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"},{"line_number":66,"context_line":"                table_name\u003d\u0027vnf_package_vnfd\u0027,"},{"line_number":67,"context_line":"                type_\u003d\"check\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_99eba9a2","line":64,"in_reply_to":"9f560f44_356543e2","updated":"2020-09-22 08:58:18.000000000","message":"If we can not know details in advance, then its ok.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"},{"author":{"_account_id":17255,"name":"Toshiaki Takahashi","email":"ts-takahashi@nec.com","username":"takahashi_ts"},"change_message_id":"4dc244ab9124c85c528349d2a418e0441d4186b3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                         .get_check_constraints(\u0027vnf_package_vnfd\u0027))"},{"line_number":62,"context_line":"    for constraint in check_constraints:"},{"line_number":63,"context_line":"        if \u0027`deleted`\u0027 in constraint[\u0027sqltext\u0027]:"},{"line_number":64,"context_line":"            op.drop_constraint("},{"line_number":65,"context_line":"                constraint_name\u003dconstraint[\u0027name\u0027],"},{"line_number":66,"context_line":"                table_name\u003d\u0027vnf_package_vnfd\u0027,"},{"line_number":67,"context_line":"                type_\u003d\"check\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_356543e2","line":64,"in_reply_to":"9f560f44_a7d13a32","updated":"2020-09-22 07:48:55.000000000","message":"Now, it is correct.\n\nThe process which I add is deleting all check constraints of `deleted` column from vnf_package_vnfd. As I said, vnf_package_vnfd has only 1 check constraint now.\n\nThe remained items which I haven\u0027t specified are constraint name \"CONSTRAINT_1\" and context of check \"in (0,1)\".\nThe name is named by mysql, so we cannot know it in advance.\n\"in (0,1)\" is also added by mysql, not specified by tacker. In my opinion, specifing such context is too much.","commit_id":"f9de2f594fc562aab70d41d24268fcd04b79c72a"}]}
