예제 #1
0
def create_base_schema():
    log.info('Creating base schema')
    create_log.info("SCHEMA")

    # Functions
    functions = environ.find_resource('sql', 'functions.sql')
    if db_settings.execute_sql(functions) != 0:
        error(u'Failed to create functions')

    # A Base schema shared between all RDBMS implementations
    schema = _get_latest_schema()
    if db_settings.execute_sql(schema) != 0:
        error(u'Failed to create base schema')

    try:
        schema = environ.find_resource('sql',
                                       '%s-schema.sql' % db_settings.rdbms)
        if db_settings.execute_sql(schema) != 0:
            error(u'Failed to create %s specific schema' %
                  (db_settings.rdbms, ))
    except EnvironmentError:
        pass

    migration = StoqlibSchemaMigration()
    migration.apply_all_patches()
예제 #2
0
def create_base_schema():
    log.info('Creating base schema')
    create_log.info("SCHEMA")

    create_database_functions()

    # A Base schema shared between all RDBMS implementations
    schema = _get_latest_schema()
    if db_settings.execute_sql(schema) != 0:
        error(u'Failed to create base schema')

    migration = StoqlibSchemaMigration()
    migration.apply_all_patches()
예제 #3
0
파일: admin.py 프로젝트: Guillon88/stoq
def create_base_schema():
    log.info('Creating base schema')
    create_log.info("SCHEMA")

    create_database_functions()

    # A Base schema shared between all RDBMS implementations
    schema = _get_latest_schema()
    if db_settings.execute_sql(schema) != 0:
        error(u'Failed to create base schema')

    migration = StoqlibSchemaMigration()
    migration.apply_all_patches()
예제 #4
0
파일: admin.py 프로젝트: LeonamSilva/stoq
def create_base_schema():
    log.info('Creating base schema')
    create_log.info("SCHEMA")

    create_database_functions()

    # A Base schema shared between all RDBMS implementations
    schema = _get_latest_schema()
    if db_settings.execute_sql(schema) != 0:
        error(u'Failed to create base schema')

    try:
        schema = environ.find_resource('sql', '%s-schema.sql' % db_settings.rdbms)
        if db_settings.execute_sql(schema) != 0:
            error(u'Failed to create %s specific schema' % (db_settings.rdbms, ))
    except EnvironmentError:
        pass

    migration = StoqlibSchemaMigration()
    migration.apply_all_patches()