From 107b9be0030d57e2e0b8a5920da99d7771f59813 Mon Sep 17 00:00:00 2001 From: Pelle Nilsson Date: Sun, 18 Feb 2018 14:00:18 +0100 Subject: [PATCH] Add notification column to database if needed --- isso/db/comments.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/isso/db/comments.py b/isso/db/comments.py index 3110d25..924a028 100644 --- a/isso/db/comments.py +++ b/isso/db/comments.py @@ -35,6 +35,10 @@ class Comments: ' text VARCHAR, author VARCHAR, email VARCHAR, website VARCHAR,', ' likes INTEGER DEFAULT 0, dislikes INTEGER DEFAULT 0, voters BLOB NOT NULL,', ' notification INTEGER NOT NULL DEFAULT 0);']) + try: + self.db.execute(['ALTER TABLE comments ADD COLUMN notification INTEGER NOT NULL DEFAULT 0;']) + except: + pass def add(self, uri, c): """