11 lines
453 B
Python
11 lines
453 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)
|
|
name = Column(String, nullable=False)
|
|
description = Column(String, nullable=True)
|
|
# Relationships
|
|
blog_id = Column(Integer, ForeignKey("blogs.id"))
|
|
blog = relationship("Blog", back_populates="ands") |