From 81b85445d859b3eff4e4c2089f071a65c2a9e036 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 22 Jan 2022 11:51:34 +0100 Subject: [PATCH] Added missing unique marker on comments table (#2278) --- cps/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/db.py b/cps/db.py index 470ecc1c..ca8768f1 100644 --- a/cps/db.py +++ b/cps/db.py @@ -177,8 +177,8 @@ class Comments(Base): __tablename__ = 'comments' id = Column(Integer, primary_key=True) + book = Column(Integer, ForeignKey('books.id'), nullable=False, unique=True) text = Column(String(collation='NOCASE'), nullable=False) - book = Column(Integer, ForeignKey('books.id'), nullable=False) def __init__(self, text, book): self.text = text