agatha
2db6e18d5b
Reviewed-on: #2 Co-authored-by: agatha <agatha@juggalol.com> Co-committed-by: agatha <agatha@juggalol.com>
32 lines
766 B
Python
32 lines
766 B
Python
from database import Base
|
|
from sqlalchemy import Column, Integer, String, ForeignKey
|
|
|
|
|
|
class Post(Base):
|
|
__tablename__ = 'posts'
|
|
|
|
id = Column(Integer, primary_key=True, index=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, index=True)
|
|
author = Column(String)
|
|
title = Column(String)
|
|
content = Column(String)
|
|
|
|
|
|
class User(Base):
|
|
__tablename__ = 'users'
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
username = Column(String, unique=True)
|
|
email = Column(String, unique=True)
|
|
password = Column(String)
|
|
role = Column(String)
|