Source code for sibl_gui.components.core.database.migrations.versions.001_rename_table_Sets
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**001_rename_table_Sets.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
This module defines the *001* version Application Database migrations objects: :func:`upgrade`
and :func:`downgrade` definitions.
**Others:**
"""
#**********************************************************************************************************************
#*** External imports
#**********************************************************************************************************************
import sqlalchemy
import sibl_gui.components.core.database.operations
#**********************************************************************************************************************
#*** Internal imports.
#**********************************************************************************************************************
import foundations.verbose
#**********************************************************************************************************************
#*** Module attributes.
#**********************************************************************************************************************
__author__ = "Thomas Mansencal"
__copyright__ = "Copyright (C) 2008 - 2013 - Thomas Mansencal"
__license__ = "GPL V3.0 - http://www.gnu.org/licenses/"
__maintainer__ = "Thomas Mansencal"
__email__ = "thomas.mansencal@gmail.com"
__status__ = "Production"
__all__ = ["LOGGER", "renameTable", "upgrade", "downgrade"]
LOGGER = foundations.verbose.installLogger()
#**********************************************************************************************************************
#*** Module classes and definitions.
#**********************************************************************************************************************
[docs]def upgrade(databaseEngine):
"""
This definition upgrades the Database.
:param databaseEngine: Database engine. ( Object )
"""
renameTable(databaseEngine, "Sets", "IblSets")
[docs]def downgrade(databaseEngine):
"""
This definition downgrades the Database.
:param databaseEngine: Database engine. ( Object )
"""
renameTable(databaseEngine, "IblSets", "Sets")