24 lines
549 B
Python
24 lines
549 B
Python
from sqlalchemy.orm import relationship
|
|
|
|
from database import Base
|
|
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
|
|
|
|
|
|
class Post(Base):
|
|
__tablename__ = 'posts'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
thread_id = Column(Integer, ForeignKey("threads.id"))
|
|
author = Column(String)
|
|
title = Column(String)
|
|
content = Column(String)
|
|
|
|
|
|
class Thread(Base):
|
|
__tablename__ = 'threads'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
author = Column(String)
|
|
title = Column(String)
|
|
content = Column(String)
|