Module upgrade
source code
Stuff dealing with the upgrade of the database schema.
From software version 0.8.2 on, there is a dc.metastore table with a
key schemaversion. Each change in the central schema increases the value
(interpreted as an integer) by one, and this module will contain a
corresponding upgrader.
An upgrader inherits form the Upgrader class. See there for more
details.
This module contains the current schemaversion expected by the
software; gavo upgrade does everything required to bring the what's in
the database in sync with the code (or so I hope).
|
|
|
relationExists(tableName,
connection)
returns True if tableName (as schema.name) exists, False otherwise. |
source code
|
|
|
showProgress(msg)
outputs msg to stdout without lf "immediately". |
source code
|
|
|
|
|
dumpExtensionUpdater(conn)
prints SQL to bring [db]managedExtensions up to date. |
source code
|
|
|
iterStatements(startVersion,
endVersion=20,
upgraders=None)
yields all upgraders from startVersion to endVersion in sequence. |
source code
|
|
|
upgrade(forceDBVersion=None)
runs all updates necessary to bring a database to the
CURRENT_SCHEMAVERSION. |
source code
|
|
|
|
|
|
|
CURRENT_SCHEMAVERSION = 20
|
|
__package__ = ' gavo.user '
|
returns (normalised) column names for tableId.
(tableId is something like //tap#tables)
|
returns the schemaversion given in the database.
This will return -1 if no schemaversion is declared.
|
runs all updates necessary to bring a database to the
CURRENT_SCHEMAVERSION.
Unless catastrophic things go on, each upgrade is a transaction of its
own; the first failed transaction stops the upgrade at the version last
successfully upgraded to.
|