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:
parent
3f47208bc5
commit
e08d2ec957
1 changed files with 10 additions and 0 deletions
10
db.py
10
db.py
|
@ -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...")
|
||||||
|
|
Loading…
Reference in a new issue