From 34b1faae33e7e456f710ee97860ce0b3674ee12b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 22 Mar 2017 19:12:51 +0100 Subject: [PATCH] Added Discord ID column --- database.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/database.py b/database.py index 7a2efb99..1034427d 100644 --- a/database.py +++ b/database.py @@ -25,6 +25,7 @@ class User(Base): password = Column(String, nullable=False) royal = Column(Boolean, nullable=False) telegram_id = Column(Integer, unique=True) + discord_id = Column(Integer, unique=True) def __str__(self): return self.username @@ -114,5 +115,7 @@ def init_royal_db(): create_user("voltaggio", "ventitre", True) create_user("doc", "ventiquattro", True) -if __name__ == "__main__": - init_royal_db() \ No newline at end of file +with Session() as session: + # Generate the database if it's empty + if session.query(User).first() is None: + init_royal_db()