changeset 215:5b749cb6aa22

Feed configuration options as parameters to schema upgrade functions.
author Daniele Nicolodi <daniele@grinta.net>
date Mon, 21 Nov 2011 16:10:12 +0100
parents 931577ae72bb
children 66de4aa7d53a
files src/ltpdarepo/upgrade.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ltpdarepo/upgrade.py	Mon Nov 21 16:10:05 2011 +0100
+++ b/src/ltpdarepo/upgrade.py	Mon Nov 21 16:10:12 2011 +0100
@@ -54,7 +54,7 @@
 
         # run upgrade step
         logger.info("upgrading database schema from v%s to v%s", fromr, tor)
-        func(conn)
+        func(conn, **instance.config)
 
         # update current schema version
         curr = tor
@@ -66,7 +66,7 @@
 
 
 @register(2.3, 2.4)
-def upgrade_23_24(conn):
+def upgrade_23_24(conn, **kwargs):
     curs = conn.cursor()
 
     # no idea why this table is here
@@ -79,7 +79,7 @@
 
 
 @register(2.4, 2.5)
-def upgrade_24_to_25(conn):
+def upgrade_24_to_25(conn, **kwargs):
     curs = conn.cursor()
 
     # make mysql beheave: use sql strict mode
@@ -136,7 +136,7 @@
 
 
 @register(2.5, 2.6)
-def upgrade_25_to_26(conn):
+def upgrade_25_to_26(conn, **kwargs):
     curs = conn.cursor()
 
     # crerate "queries" table
@@ -159,7 +159,7 @@
 
 
 @register(2.6, 2.7)
-def upgrade_26_to_27(conn):
+def upgrade_26_to_27(conn, **kwargs):
     logger = logging.getLogger(__name__)
     curs = conn.cursor()
 
@@ -357,7 +357,7 @@
 
 
 @register(2.7, 2.8)
-def upgrade_27_to_28(conn):
+def upgrade_27_to_28(conn, **kwargs):
     curs = conn.cursor()
 
     # for each registered database
@@ -375,7 +375,7 @@
 
 
 @register(2.8, 29)
-def upgrade_28_29(conn):
+def upgrade_28_29(conn, **kwargs):
     curs = conn.cursor()
 
     # support procedure for activity view