Incomplete implementation of createVotes

This commit is contained in:
2025-01-02 19:24:32 +01:00
parent 9efe9a3537
commit 0229f78976
9 changed files with 136 additions and 13 deletions

View File

@ -3,7 +3,7 @@ CREATE TABLE elections (
name TEXT NOT NULL,
tokens INTEGER NOT NULL,
are_voters_known INTEGER NOT NULL,
max_voters INTEGER, -- mandatory when voters are known
max_voters INTEGER NOT NULL, -- must be greater than 0 when voters are known
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
expires_at DATETIME NOT NULL,
CHECK (are_voters_known = 0 OR (are_voters_known = 1 AND max_voters IS NOT NULL AND max_voters >= 1))