Revert "[autotest] Remove synch_id from database"
This reverts commit eb97ee7fffb4a2ef3155b07f2aa71f04d574b642.
But not quite. We never revert DB migration scripts, especially if
they've been run on any servers. So, this CL adds a new migration (111)
to revert the migration (110) that was already applied to the test
servers.
To reland, remove synch_id once again via a new migration.
Reason for revert:
This CL requires lab downtime for push-to-prod because host_scheduler
can not be cleanly restarted across this CL.
To push this CL to lab, one must:
- close the lab.
- migrate DB to the new schema (host_scheduler starts failing)
- push the CL to lab (host_scheduler recovers)
- open the lab.
Now is not the time to do this dance, so reverting with the hope to
reland at a better time.
BUG=chromium:696691
TEST=test_push host_scheduler can start with tip-of-tree code and with
tip-of-prod after applying both migration 110 and 111.
Change-Id: If2f5428f100af400d498eded9dfb08d6f22aa4dc
Reviewed-on: https://chromium-review.googlesource.com/447200
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/frontend/afe/rdb_model_extensions.py b/frontend/afe/rdb_model_extensions.py
index 4444122..12ba892 100644
--- a/frontend/afe/rdb_model_extensions.py
+++ b/frontend/afe/rdb_model_extensions.py
@@ -184,6 +184,9 @@
hostname = dbmodels.CharField(max_length=255, unique=True)
locked = dbmodels.BooleanField(default=False)
leased = dbmodels.BooleanField(default=True)
+ # TODO(ayatane): This is needed until synch_id is removed from Host._fields
+ synch_id = dbmodels.IntegerField(blank=True, null=True,
+ editable=settings.FULL_ADMIN)
status = dbmodels.CharField(max_length=255, default=Status.READY,
choices=Status.choices(),
editable=settings.FULL_ADMIN)