from sqlalchemy import Column
from sqlalchemy import Date
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String

from ..db import Base


class Blog(Base):
    __tablename__ = "blogs"

    id = Column(Integer, primary_key=True, index=True)
    title = Column(String, unique=True)
    content = Column(String)
    created_on = Column(Date)
    last_updated = Column(Date)
    image = Column(String)

    author_id = Column(Integer, ForeignKey("admins.id"))
