2020-01-15 22:56:54 +01:00
|
|
|
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...")
|
2020-01-15 22:56:54 +01:00
|
|
|
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...')
|
2020-01-15 22:56:54 +01:00
|
|
|
# todo: add seeding
|
2020-01-15 00:08:53 +01:00
|
|
|
print("Done!")
|