Rename script for resetting the database.

Renamed this script because it's current name is misleading. It does not
just remove sample data; it truncates every table except the alembic
version table and `permission_sets`.
This commit is contained in:
dandds 2019-11-18 09:50:33 -05:00
parent f40ce3d1aa
commit 7e468f8ac6

View File

@ -11,7 +11,7 @@ from atst.database import db
from atst.app import make_config, make_app from atst.app import make_config, make_app
def remove_sample_data(): def reset_database():
conn = db.engine.connect() conn = db.engine.connect()
meta = sqlalchemy.MetaData(bind=conn, reflect=True) meta = sqlalchemy.MetaData(bind=conn, reflect=True)
@ -32,4 +32,4 @@ if __name__ == "__main__":
config = make_config({"DISABLE_CRL_CHECK": True, "DEBUG": False}) config = make_config({"DISABLE_CRL_CHECK": True, "DEBUG": False})
app = make_app(config) app = make_app(config)
with app.app_context(): with app.app_context():
remove_sample_data() reset_database()