# HG changeset patch # User Daniele Nicolodi # Date 1321888212 -3600 # Node ID 5b749cb6aa22ea5fbd846c80ee1c0d51585cca28 # Parent 931577ae72bbc22fa2cff3268bf6b1f45cac6c16 Feed configuration options as parameters to schema upgrade functions. diff -r 931577ae72bb -r 5b749cb6aa22 src/ltpdarepo/upgrade.py --- 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