rename commands in the manager
This commit is contained in:
@@ -5,18 +5,18 @@ from api.models import Designer
|
|||||||
manager = Manager(app)
|
manager = Manager(app)
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def initdb():
|
def init_db():
|
||||||
db.create_all()
|
db.create_all()
|
||||||
print("All tables created")
|
print("All tables created")
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def dropdb():
|
def drop_db():
|
||||||
if prompt_bool("Are you sure you want to lose all your data"):
|
if prompt_bool("Are you sure you want to lose all your data?"):
|
||||||
db.drop_all()
|
db.drop_all()
|
||||||
print("All tables dropped")
|
print("All tables dropped")
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def seed():
|
def seed_db():
|
||||||
print("Adding sample data")
|
print("Adding sample data")
|
||||||
designer = Designer(name="Martin", path='/martin')
|
designer = Designer(name="Martin", path='/martin')
|
||||||
db.session.add(designer)
|
db.session.add(designer)
|
||||||
|
|||||||
Reference in New Issue
Block a user