CREATE TABLE revisions (
	revision_uri TEXT NOT NULL PRIMARY KEY,
	flake_uri TEXT NOT NULL,
	store_path TEXT,
	last_modified INT
);

CREATE TABLE output_attributes (
	revision_uri TEXT NOT NULL,
	output_attribute_name TEXT NOT NULL,
	derivation_path TEXT,
	PRIMARY KEY (revision_uri, output_attribute_name)
);

CREATE TABLE build_outputs (
	derivation_path TEXT NOT NULL,
	build_output_name TEXT NOT NULL,
	store_path TEXT,
	PRIMARY KEY (derivation_path, build_output_name)
);
