CREATE TABLE IF NOT EXISTS worklog ( id INTEGER NOT NULL, task_id INTEGER NOT NULL, started DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, stopped DATETIME NULL DEFAULT NULL, duration INTEGER NOT NULL DEFAULT 0, ignored BOOLEAN NOT NULL DEFAULT 0, PRIMARY KEY(id DESC), FOREIGN KEY(task_id) REFERENCES task(id) );