@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1/* Patch 060 neglected to make this an AUTO_INCREMENT PRIMARY KEY */
2ALTER TABLE {$NAMESPACE}_phriction.phriction_document
3 CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
4
5/* Needs to be initially nullable for insert when documents are created. */
6ALTER TABLE {$NAMESPACE}_phriction.phriction_document
7 CHANGE contentID contentID INT UNSIGNED;
8
9CREATE TABLE {$NAMESPACE}_phriction.phriction_content (
10 id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
11 documentID INT UNSIGNED NOT NULL,
12 version INT UNSIGNED NOT NULL,
13 UNIQUE KEY (documentID, version),
14 authorPHID VARCHAR(64) BINARY NOT NULL,
15 KEY (authorPHID),
16 title VARCHAR(512) NOT NULL,
17 slug VARCHAR(512) NOT NULL,
18 KEY (slug(128)),
19 content LONGBLOB NOT NULL,
20 dateCreated INT UNSIGNED NOT NULL,
21 dateModified INT UNSIGNED NOT NULL
22) ENGINE=InnoDB;