[autotest] Add afe_stable_versions table to store stable versions for each board.
As a sample setup:
+----+---------+----------------------------+
| id | board | version |
+----+---------+----------------------------+
| 1 | lumpy | R41-6531.0.0 |
| 2 | DEFAULT | R41-6550.0.0 |
+----+---------+----------------------------+
For lumpy, the stable build is stable_build_pattern % (lumpy, 'R41-6531.0.0').
For any other board, the stable build is
stable_build_pattern % (board, 'R41-6550.0.0')
BUG=chromium:436656
TEST=local db:
database/migrate.py sync
database/migrate.py sync 97
Change-Id: I94fc61e1ca18ab1cafd77bebd710a6af40f6c15e
Reviewed-on: https://chromium-review.googlesource.com/236414
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
diff --git a/frontend/migrations/098_add_stable_versions.py b/frontend/migrations/098_add_stable_versions.py
new file mode 100644
index 0000000..78e983f
--- /dev/null
+++ b/frontend/migrations/098_add_stable_versions.py
@@ -0,0 +1,12 @@
+UP_SQL = """
+CREATE TABLE afe_stable_versions (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ board VARCHAR(255) NOT NULL,
+ version VARCHAR(255) NOT NULL,
+ UNIQUE KEY `board_UNIQUE` (`board`)
+) ENGINE=innodb;
+"""
+
+DOWN_SQL = """
+DROP TABLE afe_stable_versions;
+"""