コード例 #1
0
ファイル: initialize.py プロジェクト: ponnadarahul/csm
def init():
    db_session = DBSession()
    system_version = SystemVersion.get(db_session)

    # Handles database schema migration
    for version in range(system_version.schema_version, CURRENT_SCHEMA_VERSION+1):    
        handler_class = get_schema_migrate_class(version)
        if handler_class is not None:
            try:
                handler_class(version).execute()
            except:
                print(traceback.format_exc())

    # Initialize certain tables 
    initialize()
コード例 #2
0
ファイル: initialize.py プロジェクト: smjurcak/csm
def init():
    db_session = DBSession()
    system_version = SystemVersion.get(db_session)

    # Handles database schema migration starting from the next schema version
    for version in range(system_version.schema_version + 1, CURRENT_SCHEMA_VERSION + 1):
        handler_class = get_schema_migrate_class(version)
        if handler_class is not None:
            try:
                handler_class(version).execute()
            except:
                print(traceback.format_exc())

    apply_dialect_specific_codes()

    # Initialize certain tables 
    initialize()
コード例 #3
0
ファイル: initialize.py プロジェクト: anushreejangid/csm
def init():
    if not is_ldap_supported():
        print('LDAP authentication is not supported because it has not been installed.')

    db_session = DBSession()
    system_version = SystemVersion.get(db_session)

    # Handles database schema migration starting from the next schema version
    for version in range(system_version.schema_version + 1, CURRENT_SCHEMA_VERSION + 1):
        handler_class = get_schema_migrate_class(version)
        if handler_class is not None:
            try:
                handler_class(version).execute()
            except:
                print(traceback.format_exc())

    # Initialize certain tables 
    initialize()
コード例 #4
0
ファイル: initialize.py プロジェクト: smjurcak/csm
def init():
    db_session = DBSession()
    system_version = SystemVersion.get(db_session)

    # Handles database schema migration starting from the next schema version
    for version in range(system_version.schema_version + 1,
                         CURRENT_SCHEMA_VERSION + 1):
        handler_class = get_schema_migrate_class(version)
        if handler_class is not None:
            try:
                handler_class(version).execute()
            except:
                print(traceback.format_exc())

    apply_dialect_specific_codes()

    # Initialize certain tables
    initialize()
コード例 #5
0
def init():
    if not is_ldap_supported():
        print(
            'LDAP authentication is not supported because it has not been installed.'
        )

    db_session = DBSession()
    system_version = SystemVersion.get(db_session)

    # Handles database schema migration starting from the next schema version
    for version in range(system_version.schema_version + 1,
                         CURRENT_SCHEMA_VERSION + 1):
        handler_class = get_schema_migrate_class(version)
        if handler_class is not None:
            try:
                handler_class(version).execute()
            except:
                print(traceback.format_exc())

    # Initialize certain tables
    initialize()
コード例 #6
0
 def update_schema_version(self):
     db_session = DBSession()
     system_version = SystemVersion.get(db_session)
     # system_version.schema_version = self.version
     db_session.commit()