1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Added Discord ID column

This commit is contained in:
Steffo 2017-03-22 19:12:51 +01:00
parent 7c1195e1dd
commit 34b1faae33

View file

@ -25,6 +25,7 @@ class User(Base):
password = Column(String, nullable=False) password = Column(String, nullable=False)
royal = Column(Boolean, nullable=False) royal = Column(Boolean, nullable=False)
telegram_id = Column(Integer, unique=True) telegram_id = Column(Integer, unique=True)
discord_id = Column(Integer, unique=True)
def __str__(self): def __str__(self):
return self.username return self.username
@ -114,5 +115,7 @@ def init_royal_db():
create_user("voltaggio", "ventitre", True) create_user("voltaggio", "ventitre", True)
create_user("doc", "ventiquattro", True) create_user("doc", "ventiquattro", True)
if __name__ == "__main__": with Session() as session:
init_royal_db() # Generate the database if it's empty
if session.query(User).first() is None:
init_royal_db()