From e08d2ec957806f97c90f54289d072c9f87a5393a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 13 Sep 2018 23:51:06 +0200 Subject: [PATCH] Create new logintoken table --- db.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db.py b/db.py index 73cf7a1e..bf470bf5 100644 --- a/db.py +++ b/db.py @@ -831,6 +831,16 @@ class ParsedRedditPost(Base): author_username = Column(String) +class LoginToken(Base): + __tablename__ = "logintoken" + + royal_id = Column(Integer, ForeignKey("royals.id")) + royal = relationship("Royal", backref="tokens", lazy="joined") + + token = Column(String, primary_key=True) + expiration = Column(DateTime, nullable=False) + + # If run as script, create all the tables in the db if __name__ == "__main__": print("Creating new tables...")