teichmann@0: CREATE TABLE projects ( teichmann@0: id INTEGER PRIMARY KEY AUTOINCREMENT, teichmann@0: key VARCHAR(16), teichmann@0: description VARCHAR(256), teichmann@0: active BOOLEAN DEFAULT 1 teichmann@0: ); teichmann@0: teichmann@0: CREATE TABLE entries ( teichmann@0: id INTEGER PRIMARY KEY AUTOINCREMENT, teichmann@0: project_id INTEGER REFERENCES projects(id), teichmann@0: start_time TIMESTAMP NOT NULL, teichmann@0: stop_time TIMESTAMP NOT NULL, teichmann@0: description VARCHAR(256), teichmann@0: teichmann@0: CHECK (strftime('%s', start_time) <= strftime('%s', stop_time)) teichmann@0: );