This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
from sqlalchemy import JSON as JSONType
|
||||
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
from services.db import Base
|
||||
|
||||
@@ -13,10 +13,6 @@ class AuthorRating(Base):
|
||||
author = Column(ForeignKey("author.id"), primary_key=True, index=True)
|
||||
value = Column(Integer)
|
||||
|
||||
@staticmethod
|
||||
def init_table():
|
||||
pass
|
||||
|
||||
|
||||
class AuthorFollower(Base):
|
||||
__tablename__ = "author_follower"
|
||||
@@ -24,23 +20,25 @@ class AuthorFollower(Base):
|
||||
id = None # type: ignore
|
||||
follower = Column(ForeignKey("author.id"), primary_key=True, index=True)
|
||||
author = Column(ForeignKey("author.id"), primary_key=True, index=True)
|
||||
createdAt = Column(DateTime, nullable=False, default=datetime.now)
|
||||
created_at = Column(Integer, nullable=False, default=lambda: int(time.time()))
|
||||
auto = Column(Boolean, nullable=False, default=False)
|
||||
|
||||
|
||||
class Author(Base):
|
||||
__tablename__ = "author"
|
||||
|
||||
user = Column(String, nullable=False) # unbounded link with authorizer's User type
|
||||
bio = Column(String, nullable=True, comment="Bio") # status description
|
||||
about = Column(String, nullable=True, comment="About") # long and formatted
|
||||
pic = Column(String, nullable=True, comment="Userpic")
|
||||
user = Column(String, unique=True) # unbounded link with authorizer's User type
|
||||
|
||||
name = Column(String, nullable=True, comment="Display name")
|
||||
slug = Column(String, unique=True, comment="Author's slug")
|
||||
|
||||
createdAt = Column(DateTime, nullable=False, default=datetime.now)
|
||||
lastSeen = Column(DateTime, nullable=False, default=datetime.now) # Td se 0e
|
||||
deletedAt = Column(DateTime, nullable=True, comment="Deleted at")
|
||||
|
||||
bio = Column(String, nullable=True, comment="Bio") # status description
|
||||
about = Column(String, nullable=True, comment="About") # long and formatted
|
||||
pic = Column(String, nullable=True, comment="Picture")
|
||||
links = Column(JSONType, nullable=True, comment="Links")
|
||||
|
||||
ratings = relationship(AuthorRating, foreign_keys=AuthorRating.author)
|
||||
|
||||
created_at = Column(Integer, nullable=False, default=lambda: int(time.time()))
|
||||
last_seen = Column(Integer, nullable=False, default=lambda: int(time.time()))
|
||||
updated_at = Column(Integer, nullable=False, default=lambda: int(time.time()))
|
||||
deleted_at = Column(Integer, nullable=True, comment="Deleted at")
|
||||
|
Reference in New Issue
Block a user