tuxbot-bot/database.py
Romain J be1e6d24e4 breaking change !
update(database): change database ORM

todo: update Admin, Poll and User cogs
2020-01-15 22:56:54 +01:00

19 lines
490 B
Python

import sqlalchemy
from utils.models import database, metadata
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)
print("Done!")
if args.seed:
print('Seeding...')
# todo: add seeding
print("Done!")