)]}'
{"subunit2sql/migrations/versions/4f97b95c04c4_switch_to_myisam_for_append_only_tables.sql":[{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"f828f05368ef0d5353921aaed6019977d08aa2ec","unresolved":false,"context_lines":[{"line_number":4,"context_line":"--"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"-- Convert runs and friends to MyISAM"},{"line_number":7,"context_line":"CREATE TABLE runs_migration LIKE runs;"},{"line_number":8,"context_line":"CREATE TABLE run_metadata_migration LIKE run_metadata"},{"line_number":9,"context_line":"ALTER TABLE runs_migration ENGINE\u003dMyISAM;"},{"line_number":10,"context_line":"ALTER TABLE run_metadata_migration ENGINE\u003dMyISAM;"}],"source_content_type":"text/x-sql","patch_set":4,"id":"1aca2d91_bad1f3fd","line":7,"updated":"2015-05-06 13:14:46.000000000","message":"(nit) I\u0027d use a cleaner namespace such as \"_migration_runs\"","commit_id":"80040d28cc19151ef393925bc395dc96e1614d62"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"f828f05368ef0d5353921aaed6019977d08aa2ec","unresolved":false,"context_lines":[{"line_number":9,"context_line":"ALTER TABLE runs_migration ENGINE\u003dMyISAM;"},{"line_number":10,"context_line":"ALTER TABLE run_metadata_migration ENGINE\u003dMyISAM;"},{"line_number":11,"context_line":"LOCK TABLES runs write, runs_migration write, run_metadata write;"},{"line_number":12,"context_line":"INSERT INTO runs_migration SELECT id, skips, fails, passes, run_time, artifacts, run_at FROM runs;"},{"line_number":13,"context_line":"INSERT INTO run_metadata_migration SELECT id, key, value, run_id FROM run_metadata;"},{"line_number":14,"context_line":"ALTER TABLE run_metadata DROP foreign key run_metadata_ibfk_1;"},{"line_number":15,"context_line":"UNLOCK TABLES;"}],"source_content_type":"text/x-sql","patch_set":4,"id":"1aca2d91_fa340b4b","line":12,"updated":"2015-05-06 13:14:46.000000000","message":"I think there is a race here where data is still being inserted into runs while data is being copied into the migrations.\n\nI would rename the tables so that the new runs table gets new data and then migrate all of the old data across.\n\nIf that\u0027s not possible, we should do another select and insert after the rename to catch ones we\u0027ve missed.","commit_id":"80040d28cc19151ef393925bc395dc96e1614d62"}]}
