1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00

Create new logintoken table

This commit is contained in:
Steffo 2018-09-13 23:51:06 +02:00
parent 3f47208bc5
commit e08d2ec957

10
db.py
View file

@ -831,6 +831,16 @@ class ParsedRedditPost(Base):
author_username = Column(String) 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 run as script, create all the tables in the db
if __name__ == "__main__": if __name__ == "__main__":
print("Creating new tables...") print("Creating new tables...")