[autotest] Update TKO db schema

1. Add index for tko_tests.finished_time
2. Update tko_test_attributes id key to bigint.

BUG=chromium:617703
TEST=local run migrate.py sync

Change-Id: I9167f2fcea2a99ac2bf6e9757e1d05b1fbe67104
Reviewed-on: https://chromium-review.googlesource.com/436485
Commit-Ready: Dan Shi <[email protected]>
Tested-by: Dan Shi <[email protected]>
Reviewed-by: Prathmesh Prabhu <[email protected]>
diff --git a/frontend/migrations/108_index_tko_tests_finished_time.py b/frontend/migrations/108_index_tko_tests_finished_time.py
new file mode 100644
index 0000000..5360a8c
--- /dev/null
+++ b/frontend/migrations/108_index_tko_tests_finished_time.py
@@ -0,0 +1,7 @@
+UP_SQL = """
+CREATE INDEX finished_time_idx ON tko_tests (finished_time);
+"""
+
+DOWN_SQL = """
+DROP INDEX finished_time_idx ON tko_tests;
+"""
diff --git a/frontend/migrations/109_change_tko_test_attributes_id_data_type.py b/frontend/migrations/109_change_tko_test_attributes_id_data_type.py
new file mode 100644
index 0000000..38a5b79
--- /dev/null
+++ b/frontend/migrations/109_change_tko_test_attributes_id_data_type.py
@@ -0,0 +1,7 @@
+UP_SQL = """
+ALTER TABLE tko_test_attributes MODIFY id bigint(20) AUTO_INCREMENT;
+"""
+
+DOWN_SQL = """
+ALTER TABLE tko_test_attributes MODIFY id int(11) AUTO_INCREMENT;
+"""