예제 #1
0
 def setUp(self):
     db.create_all()
예제 #2
0
 def clear_db(self):
     db.drop_all()
     db.create_all()
예제 #3
0
파일: initdb.py 프로젝트: 51weekend/Simblin
"""Creates a new database but only if the database doesn't exist yet"""
from __future__ import with_statement
import os
from simblin.extensions import db
from simblin import create_app

app = create_app()

with app.test_request_context():
    # The context is needed so db can access the configuration of the app
    db.create_all()

print "Initialized new empty database in %s" % app.config['SQLALCHEMY_DATABASE_URI']
예제 #4
0
"""Creates a new database but only if the database doesn't exist yet"""
from __future__ import with_statement
import os
from simblin.extensions import db
from simblin import create_app

app = create_app()

with app.test_request_context():
    # The context is needed so db can access the configuration of the app
    db.create_all()

print "Initialized new empty database in %s" % app.config[
    'SQLALCHEMY_DATABASE_URI']
예제 #5
0
 def setUp(self):
     db.create_all()
예제 #6
0
 def clear_db(self):
     db.drop_all()
     db.create_all()