diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-12 12:02:43 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-12 12:04:00 +0200 |
commit | 0850ea13c19d4f2a382fd7d4bcf6333f446fa68b (patch) | |
tree | eac97facaf39d8a79a068b1c90279c3d069431f0 /db | |
parent | 7ab74a08a68bcb3afce03b089e57df5aff66bdd9 (diff) |
Drop is_visible column from problem table
Diffstat (limited to 'db')
-rw-r--r-- | db/create.sql | 1 | ||||
-rw-r--r-- | db/models.py | 4 |
2 files changed, 2 insertions, 3 deletions
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): |