CREATE TABLE depstate (
	source TEXT NOT NULL,
	version TEXT NOT NULL,
	architecture TEXT NOT NULL,
	satisfiable BOOLEAN NOT NULL CHECK (satisfiable in (0, 1)),
	reason TEXT,
	UNIQUE (architecture, source, version));

CREATE TABLE depcheck (
	architecture TEXT NOT NULL UNIQUE,
	releasetime TIMESTAMP NOT NULL,
	updatetime TIMESTAMP NOT NULL,
	giveback BOOLEAN NOT NULL CHECK (giveback in (0, 1)));
INSERT INTO depcheck (architecture, releasetime, updatetime, giveback) VALUES
	("arm64", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("armel", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("armhf", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("mips", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("mips64el", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("mipsel", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("ppc64el", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1),
	("s390x", "2000-01-01 00:00:00", "2000-01-01 00:00:00", 1);

CREATE TABLE builds (
	source TEXT NOT NULL,
	version TEXT NOT NULL,
	architecture TEXT NOT NULL,
	success BOOLEAN NOT NULL CHECK (success in (0, 1)),
	starttime TIMESTAMP NOT NULL,
	filename TEXT NOT NULL);
