summaryrefslogtreecommitdiff
path: root/schema.sql
blob: b23b8e64603f8eb068bac550209e616a97eaa51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CREATE TABLE package (		-- binary Debian packages
	id INTEGER PRIMARY KEY,
	name TEXT UNIQUE NOT NULL,
	-- binary package name
	version TEXT,		-- Debian version
	architecture TEXT,
	source TEXT);		-- name of the source package it was built from

CREATE TABLE dependency (	-- binary package dependencies
	pid INTEGER NOT NULL REFERENCES package(id) ON DELETE CASCADE,
	-- the package that carries a Depends: header
	required TEXT NOT NULL);
	-- the name of a package that is depended upon without alternative

CREATE VIRTUAL TABLE controlcontent USING fts4(content);

CREATE TABLE control (		-- control.tar contents
	pid INTEGER NOT NULL REFERENCES package(id) ON DELETE CASCADE,
	-- the package that contains a control.tar member
	name TEXT NOT NULL,
	-- the name of the control.tar member without leading "./"
	cid INTEGER NOT NULL);
	-- a reference to the binary contents of the file

CREATE INDEX control_name_index ON control(name);