Class s.d.m.SchemaMigration(object):

Part of stoqlib.database.migration View In Hierarchy

Known subclasses: stoqlib.database.migration.PluginSchemaMigration, stoqlib.database.migration.StoqlibSchemaMigration

Schema migration management

Is currently doing the following things:

Method __init__ Undocumented
Method _patchname_is_valid Undocumented
Method _get_patches Undocumented
Method _update_schema Check the current version of database and update the schema if
Method check_uptodate Verify if the schema is up to date.
Method apply_all_patches Apply all available patches
Method update Updates the database schema
Method get_current_version This method is revision for returning the database schema version
Method generate_sql_for_patch This method is responsible for creating an SQL
Method after_update This can be implemented in a subclass, but it is not mandatory.
def __init__(self):
Undocumented
def _patchname_is_valid(self, filename):
Undocumented
def _get_patches(self):
Undocumented
def _update_schema(self):
Check the current version of database and update the schema if it's needed
def check_uptodate(self):
Verify if the schema is up to date.
ReturnsTrue or False.
def apply_all_patches(self):
Apply all available patches
def update(self):
Updates the database schema
def get_current_version(self):
This method is revision for returning the database schema version for a migration subclass

This must be implemented in a subclass

Returnsthe current database patch version
def generate_sql_for_patch(self, patch):
This method is responsible for creating an SQL statement which is used to update the migration versioning information

This must be implemented in a subclass

Parameterspatchthe patch that was applied
Returnsan SQL string
def after_update(self):
This can be implemented in a subclass, but it is not mandatory. It'll be called after applying all patches
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.