summaryrefslogtreecommitdiffstats
path: root/upgrading/3.2.0.txt
blob: cde93676808470e1614d8eccc049e605ffe68289 (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
26
27
28
29
30
1. Add support for package requests to the database:

----
CREATE TABLE RequestTypes (
	ID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
	Name VARCHAR(32) NOT NULL DEFAULT '',
	PRIMARY KEY (ID)
) ENGINE = InnoDB;
INSERT INTO RequestTypes VALUES (1, 'deletion');
INSERT INTO RequestTypes VALUES (2, 'orphan');
INSERT INTO RequestTypes VALUES (3, 'merge');

CREATE TABLE PackageRequests (
	ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
	ReqTypeID TINYINT UNSIGNED NOT NULL,
	PackageBaseID INTEGER UNSIGNED NULL,
	PackageBaseName VARCHAR(255) NOT NULL,
	MergeBaseName VARCHAR(255) NULL,
	UsersID INTEGER UNSIGNED NULL DEFAULT NULL,
	Comments TEXT NOT NULL DEFAULT '',
	RequestTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
	Status TINYINT UNSIGNED NOT NULL DEFAULT 0,
	PRIMARY KEY (ID),
	INDEX (UsersID),
	INDEX (PackageBaseID),
	FOREIGN KEY (ReqTypeID) REFERENCES RequestTypes(ID) ON DELETE NO ACTION,
	FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE SET NULL,
	FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE SET NULL
) ENGINE = InnoDB;
----