id SERIAL PRIMARY KEY,
contest TEXT REFERENCES contests ON DELETE CASCADE,
daemon TEXT,
- date BIGINT NOT NULL,
+ date BIGINT NOT NULL DEFAULT CAST(EXTRACT(epoch from now()) AS bigint),
errors TEXT,
extension TEXT NOT NULL,
format TEXT NOT NULL,
ORDER BY solved DESC, attempted DESC, id);
CREATE OR REPLACE VIEW contest_entry AS (SELECT
- id,name,description,editorial,start,stop,owner,
+ id,name,description,start,stop,owner,
(EXTRACT(epoch from NOW()) >= start) AS started,
(EXTRACT(epoch from NOW()) >= stop) AS finished
FROM contests