16 lines
480 B
Python
16 lines
480 B
Python
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db_engine import Base
|
|
|
|
|
|
class Post(Base):
|
|
__tablename__ = "posts"
|
|
|
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True, nullable=False)
|
|
title = Column(String, index=True, nullable=False)
|
|
content = Column(String, index=True, nullable=False)
|
|
images = Column(String, index=True)
|
|
updated_at = Column(DateTime, index=True)
|
|
|