summaryrefslogtreecommitdiff
path: root/src/database/models/comment.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/models/comment.py')
-rw-r--r--src/database/models/comment.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database/models/comment.py b/src/database/models/comment.py
index 9501bba..d1ca868 100644
--- a/src/database/models/comment.py
+++ b/src/database/models/comment.py
@@ -1,4 +1,4 @@
-from sqlalchemy import BigInteger, String, DateTime, Text, ForeignKey
+from sqlalchemy import BigInteger, String, DateTime, Text, ForeignKey, Boolean
from sqlalchemy.orm import mapped_column, Mapped, relationship
from src.database import db
@@ -13,6 +13,9 @@ class Comment(db.Model):
author: Mapped[str] = mapped_column(String(128), nullable=True)
post: Mapped[str] = mapped_column(String(1024), nullable=False)
blog_id: Mapped[int] = mapped_column(ForeignKey('blogs.id'), index=True)
+ approved: Mapped[bool] = mapped_column(Boolean, nullable=False,
+ default=True)
blog = relationship('Blog', back_populates='comments')
+ replies = relationship('Reply', back_populates='comment')
created_at = mapped_column(DateTime)
updated_at = mapped_column(DateTime)