From 0850ea13c19d4f2a382fd7d4bcf6333f446fa68b Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 12 Oct 2015 12:02:43 +0200 Subject: Drop is_visible column from problem table --- db/create.sql | 1 - db/models.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'db') diff --git a/db/create.sql b/db/create.sql index 57c3647..bb7ee35 100644 --- a/db/create.sql +++ b/db/create.sql @@ -68,7 +68,6 @@ create table problem ( problem_group_id integer not null, name varchar(100) not null, identifier varchar(100) not null, - is_visible bool not null default true, constraint problem_pk primary key (id), constraint problem_fk1 foreign key (language_id) references language (id) on delete no action on update cascade, constraint problem_fk2 foreign key (problem_group_id) references problem_group (id) on delete no action on update cascade, diff --git a/db/models.py b/db/models.py index 4eda2ba..b8d64a1 100644 --- a/db/models.py +++ b/db/models.py @@ -27,8 +27,8 @@ class CodeqUser(collections.namedtuple('CodeqUser', ['id', 'username', 'password def solved_problems(user_id, language): return _run_sql('select g.identifier, p.identifier from solution s inner join problem p on p.id = s.problem_id inner join problem_group g on g.id = p.problem_group_id inner join language l on l.id = p.language_id where s.codeq_user_id = %s and l.identifier = %s and s.done = True', (user_id, language), fetch_one=False) -class Problem(collections.namedtuple('Problem', ['id', 'language_id', 'problem_group_id', 'name', 'identifier', 'is_visible'])): - __sql_prefix = 'select id, language_id, problem_group_id, name, identifier, is_visible from problem' +class Problem(collections.namedtuple('Problem', ['id', 'language_id', 'problem_group_id', 'name', 'identifier'])): + __sql_prefix = 'select id, language_id, problem_group_id, name, identifier from problem' @staticmethod def get(**kwargs): -- cgit v1.2.1