1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Create useless database table

that may become useful at a future time
This commit is contained in:
Steffo 2019-02-03 01:39:33 +01:00
parent d118fddf13
commit 2cdb4d3a42

12
db.py
View file

@ -994,6 +994,7 @@ class WikiEntry(Base):
key = Column(String, primary_key=True) key = Column(String, primary_key=True)
content = Column(Text, nullable=False) content = Column(Text, nullable=False)
locked = Column(Boolean, default=False)
def __repr__(self): def __repr__(self):
return f"<WikiEntry {self.key}>" return f"<WikiEntry {self.key}>"
@ -1014,6 +1015,17 @@ class WikiLog(Base):
return f"<WikiLog {self.edit_id}>" return f"<WikiLog {self.edit_id}>"
class WikiAuthorization(Base):
__tablename__ = "wikiauthorization"
royal_id = Column(Integer, ForeignKey("royals.id"))
royal = relationship("Royal", backref="profile_data", uselist=False, lazy="joined")
page_key = Column(String, ForeignKey("wikientries.key"), nullable=False)
page = relationship("WikiEntry", backref="edit_logs", lazy="joined")
__table_args__ = (PrimaryKeyConstraint("royal_id", "page_key"),)
class Event(Base): class Event(Base):
__tablename__ = "events" __tablename__ = "events"