tuxbot-bot/database.py

20 lines
490 B
Python
Raw Normal View History

import sqlalchemy
from utils.models import database, metadata
2020-01-15 00:08:53 +01:00
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--migrate", action="store_true")
parser.add_argument("-s", "--seed", action="store_true")
args = parser.parse_args()
if args.migrate:
print("Migrate...")
engine = sqlalchemy.create_engine(str(database.url))
metadata.create_all(engine)
2020-01-15 00:08:53 +01:00
print("Done!")
if args.seed:
print('Seeding...')
# todo: add seeding
2020-01-15 00:08:53 +01:00
print("Done!")