10 lines
400 B
Python
10 lines
400 B
Python
from sqlalchemy import Column, Integer, String, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from app.api.db.database import Base
|
|
class And(Base):
|
|
__tablename__ = "ands"
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String)
|
|
body = Column(String)
|
|
author_id = Column(Integer, ForeignKey("users.id"))
|
|
author = relationship("User", back_populates="ands") |