예제 #1
0
def teardown_module():
    metadata.drop_all()
    fresh_metadata.drop_all()
    fresh_metadata.bind.dispose()
    if os.path.exists('freshtest.db'):
        os.unlink('freshtest.db')
    sqlalchemy_cleanup()
예제 #2
0
def teardown_module():
    metadata.drop_all()
    fresh_metadata.drop_all()
    fresh_metadata.bind.dispose()
    if os.path.exists('freshtest.db'):
        os.unlink('freshtest.db')
    sqlalchemy_cleanup()
 def tearDown(self):
     """Clear database configuration and drop database.
     """
     try:
         session.expunge_all()
     except:
         session.clear()
     clear_mappers()
     metadata.drop_all()
     metadata.clear()
     set_db_uri(self.sa_dburi, 'sqlalchemy')
예제 #4
0
파일: model.py 프로젝트: mbeavitt/pingpong
def create_tables(drop_all=False):
    """Create all tables defined in the model in the database.

    Optionally drop existing tables before creating them.

    """
    get_engine()
    if drop_all:
        print "Dropping all database tables defined in model."
        metadata.drop_all()
    metadata.create_all()

    print "All database tables defined in model created."
예제 #5
0
파일: model.py 프로젝트: Dimouse/melomaniac
def create_tables(drop_all=False):
    """Create all tables defined in the model in the database.

    Optionally drop existing tables before creating them.

    """
    get_engine()
    if drop_all:
        print "Dropping all database tables defined in model."
        metadata.drop_all()
    metadata.create_all()

    print "All database tables defined in model created."
def drop_tables():
    metadata.drop_all()