import os from config import db from termcolor import colored from config import app def RebuildDatabase(): if os.path.exists('acceth.db'): print(colored('Removing existing DB', 'blue')) os.remove('acceth.db') with app.app_context(): db.create_all() db.session.commit() print(colored('New DB created.', 'green')) if __name__ == '__main__': RebuildDatabase()