summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-05-07 19:15:40 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-06-01 15:27:22 +0100
commita8c6a08f46ba49adcde70d1b424b54484d9ee5c5 (patch)
tree17b0fb6679c199d1a4d79e2863367a7bf901ba91
parent604ee5f55698a7362dbeff7ee5be4f1c3e92cabe (diff)
downloadlorry-controller-a8c6a08f46ba49adcde70d1b424b54484d9ee5c5.tar.gz
STATEDB: Comment why the original schema is here, not the current schema
We are using yoyo to do migrations, but did not use it to set the original schema. We can't move the original schema to a migration since it wouldn't be recorded as already done in existing databases.
-rw-r--r--lorrycontroller/statedb.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lorrycontroller/statedb.py b/lorrycontroller/statedb.py
index 69538ed..122cb50 100644
--- a/lorrycontroller/statedb.py
+++ b/lorrycontroller/statedb.py
@@ -110,6 +110,11 @@ class StateDB(object):
logging.debug('Initialising tables in database')
c = self._conn.cursor()
+ # Note that this creates the *original* schema, which will
+ # then be updated by the migrations (_perform_any_migrations
+ # above). Since we did not use yoyo originally, this can't
+ # be moved to a migration.
+
# Table for holding the "are we scheduling jobs" value.
c.execute('CREATE TABLE running_queue (running INT)')
c.execute('INSERT INTO running_queue VALUES (1)')