CREATE TABLE image ( time TEXT NOT NULL, -- ISO 8601 @ UTC, eg 2019-01-01T00:00:00Z did TEXT NOT NULL, local_file TEXT NOT NULL, size INTEGER NOT NULL, final_file TEXT NOT NULL, url TEXT NOT NULL ); CREATE INDEX image_time ON image(time); CREATE INDEX image_did ON image(did); CREATE INDEX image_final_file ON image(url); CREATE TABLE user ( did TEXT NOT NULL, per_week INTEGER NOT NULL ); CREATE INDEX user_did ON user(did);