diff --git a/db/newsgroup.sql b/db/newsgroup.sql index cc76631..8170522 100644 --- a/db/newsgroup.sql +++ b/db/newsgroup.sql @@ -5,7 +5,8 @@ create table newsgroup ( created_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, created_by TEXT NOT NULL, name TEXT NOT NULL, - description TEXT NOT NULL + description TEXT NOT NULL, + active BOOLEAN NOT NULL DEFAULT FALSE ); create table message ( diff --git a/lib/nntp/tiny/newsgroup.py b/lib/nntp/tiny/newsgroup.py index 27e2a08..4c2c700 100644 --- a/lib/nntp/tiny/newsgroup.py +++ b/lib/nntp/tiny/newsgroup.py @@ -5,7 +5,10 @@ from nntp.tiny.db import DatabaseTable class Newsgroup(DatabaseTable): name = 'newsgroup' key = 'id' - columns = 'id', 'created_on', 'created_by', 'name', 'description', + columns = ( + 'id', 'created_on', 'created_by', 'name', 'description', + 'active' + ) @staticmethod def __from_row__(row): @@ -15,6 +18,7 @@ class Newsgroup(DatabaseTable): newsgroup.created_by = row['created_by'] newsgroup.name = row['name'] newsgroup.description = row['description'] + newsgroup.active = row['active'] return newsgroup @@ -23,5 +27,6 @@ class Newsgroup(DatabaseTable): self.created_on.isoformat(), self.created_by, self.name, - self.description + self.description, + self.active )