generated from Eddie/Backend-Boilerplate
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
421 B
18 lines
421 B
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() |