blob: 816409d54c8977b6424f03ab1e56030ba043082a (
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
31
32
33
34
35
36
37
|
1. Add DepDesc column to PackageDepends and split dependency names:
---
ALTER TABLE PackageDepends ADD COLUMN DepDesc VARCHAR(255) NULL DEFAULT NULL;
UPDATE PackageDepends
SET DepDesc = SUBSTRING(DepName FROM POSITION(': ' IN DepName) + 2)
WHERE POSITION(': ' IN DepName) > 0;
UPDATE PackageDepends
SET DepName = SUBSTRING(DepName FROM 1 FOR POSITION(': ' IN DepName) - 1)
WHERE POSITION(': ' IN DepName) > 0;
---
2. Add RenderedComment column to PackageComments:
---
ALTER TABLE PackageComments ADD COLUMN RenderedComment TEXT NOT NULL;
---
3. Add Terms and AcceptedTerms tables:
---
CREATE TABLE Terms (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
Description VARCHAR(255) NOT NULL,
URL VARCHAR(8000) NOT NULL,
Revision INTEGER UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY (ID)
) ENGINE = InnoDB;
CREATE TABLE AcceptedTerms (
UsersID INTEGER UNSIGNED NOT NULL,
TermsID INTEGER UNSIGNED NOT NULL,
Revision INTEGER UNSIGNED NOT NULL DEFAULT 0,
FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE CASCADE,
FOREIGN KEY (TermsID) REFERENCES Terms(ID) ON DELETE CASCADE
) ENGINE = InnoDB;
---
|