diff options
author | ubq323 <ubq323> | 2021-06-28 23:48:33 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-28 23:48:33 +0000 |
commit | edbd48340de9add59bcf34f312ae036adae8dcfd (patch) | |
tree | 53241bc56c1fd689d841abad73208c14ede30354 /apioforum/db.py | |
parent | cd8b3aa2c5abd414068c8f9f5edbebab807153eb (diff) |
displayation of vote retractions
Diffstat (limited to 'apioforum/db.py')
-rw-r--r-- | apioforum/db.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apioforum/db.py b/apioforum/db.py index 67989df..25bda94 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -102,9 +102,11 @@ CREATE TABLE votes ( id INTEGER PRIMARY KEY, user TEXT NOT NULL REFERENCES users(username), poll INTEGER NOT NULL, - option_idx INTEGER NOT NULL, + option_idx INTEGER, time TIMESTAMP NOT NULL, current INTEGER NOT NULL, + is_retraction INTEGER, + CHECK (is_retraction OR (option_idx NOT NULL)), FOREIGN KEY ( poll, option_idx ) REFERENCES poll_options(poll, option_idx) ); ALTER TABLE posts ADD COLUMN vote INTEGER REFERENCES votes(id); |