
shouldn't actually cause any issues currently since SQLAlchemy is (to my annoyance) import *ed everywhere but.
17 lines
503 B
Python
17 lines
503 B
Python
from sqlalchemy import *
|
|
from files.classes.base import Base
|
|
|
|
class Marsey(Base):
|
|
__tablename__ = "marseys"
|
|
|
|
name = Column(String, primary_key=True)
|
|
author_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
|
tags = Column(String(length=200), nullable=False)
|
|
count = Column(Integer, default=0, nullable=False)
|
|
|
|
Index('marseys_idx2', author_id)
|
|
Index('marseys_idx3', count.desc())
|
|
Index('marseys_idx', name)
|
|
|
|
def __repr__(self):
|
|
return f"<{self.__class__.__name__}(name={self.name})>"
|