def create_tables(): """Create the database tables.""" from redash.models import db db.create_all() # Need to mark current DB as up to date stamp()
def create_tables(): """Create the database tables.""" from redash.models import db _wait_for_db_connection(db) db.create_all() # Need to mark current DB as up to date stamp()
def create_tables(): """Create the database tables.""" from redash.models import db _wait_for_db_connection(db) # To create triggers for searchable models, we need to call configure_mappers(). sqlalchemy.orm.configure_mappers() db.create_all() # Need to mark current DB as up to date stamp()
def setUp(self): self.app = create_app() self.db = db self.app.config['TESTING'] = True self.app_ctx = self.app.app_context() self.app_ctx.push() db.session.close() db.drop_all() db.create_all() self.factory = Factory() self.client = self.app.test_client()
def setUp(self): self.app = create_app() self.db = db self.app.config['TESTING'] = True self.app.config['SERVER_NAME'] = 'localhost' limiter.enabled = False self.app_ctx = self.app.app_context() self.app_ctx.push() db.session.close() db.drop_all() db.create_all() self.factory = Factory() self.client = self.app.test_client()
def create_tables(): """Create the database tables.""" from redash.models import db _wait_for_db_connection(db) # We need to make sure we run this only if the DB is empty, because otherwise calling # stamp() will stamp it with the latest migration value and migrations won't run. if is_db_empty(): load_extensions(db) # To create triggers for searchable models, we need to call configure_mappers(). sqlalchemy.orm.configure_mappers() db.create_all() # Need to mark current DB as up to date stamp()